npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@silencelaboratories/silent-shard-snap

v1.2.10

Published

Distributed wallet between Metamask plugin and SilentShard mobile app

Downloads

9,842

Readme

Silent Shard Snap

The Silent Shard Snap aims to remove single points of failure pertaining to handling of private keys and seed phrases i.e., in current designs of wallets the private keys are stored at a single location- the local storage of the browsers.

Users have been losing access to wallets’ accounts and associated services due to phishing scams and private key theft through associated attack vector for years. This has resulted in loss of approximately USD $14 billion in 2021 alone, a blot in the face of self-sovereign non-custodial wallets which is one of the core tenets of crypto. The Silent Snap Shard aims to remove this entirely with our MPC SDK for {2,2} TSS.

Using Snap, allows us to prove how Multi-Party Computation-based signature schemes can be built at the core of wallets like MetaMask. Users will be able to get access to any WebApps using MetaMask as one shard node wherein Snap provides a way to extend MetaMask’s functionality- provide DAapps with JSON-RPC API methods for MPC supported signatures. Essentially, the snap comprises of the core threshold signature functions and WebApps would be provided with functionality to make necessary calls and handling UI elements.

How to run

  • Use node version 18 or greater.
  • Use yarn version 3.2.1
  • Now run, yarn install, to install the libraries
  • Run, yarn start to run snap on local environment. This also have fast refresh so no need to build snap again after changes.

How to build

  • Run yarn build or yarn build:prod for build production Snap
  • Run yarn build:stg for build staging Snap

How to publish

Pre-publish

  • Update the version of snap in package.json.
  • Run yarn prepublish:stg or yarn prepublish:prod to update correct metadata for package.json and bundle the Snap with right snap.config file.
  • Update the version in firebase function in snapVersion.ts file and deploy.

Publish

  • To publish the snap run npm publish. You will need to login with valid npm account before deploying new version. If you encounter any issue, delete the .npmrc and try again.

How to test

  • Use Snap Jest preset for e2e tests.
  • Run yarn test or yarn test --coverage to see test result and coverage.
  • While you see this warning @firebase/firestore: Firestore (9.23.0): GrpcConnection RPC 'Listen' stream 0x1ce2204b error. Code: 1 Message: 1 CANCELLED: Disconnecting idle stream. Timed out waiting for new targets. after running the test, its due to: https://github.com/jestjs/jest/issues/11464

How to give force update for snap (Experimental)

Update the minimum snap version required in firebase remote config (Firebase remote config). You need permission to open this.

Debugging

If you need to open the snap console, see steps here

Custom RPC methods

Keyring Methods

  • Supported keyring methods
    • listAccounts
    • createAccount
    • updateAccount
    • deleteAccount
    • submitRequest

Methods

tss_isPaired

Checks if the current plugin is paired with a mobile app.

Parameters: None

Returns:

  • isPaired: A boolean that indicates if the plugin is paired with a mobile app.
  • deviceName: A string representing the name of the device paired with, or null if not paired.

tss_unpair

Unpair the plugin from the mobile app.

Parameters: None

Returns: None

tss_initPairing

Initiate pairing with a new mobile application.

Parameters: None

Returns:

  • qrCode: A string representing the QR code message needed for pairing.

tss_runPairing

Run the pairing process.

Parameters: None

Returns:

  • address: A string representing the address of the account if present, otherwise return null.
  • device_name: A string representing the name of the paired device.

tss_runRePairing

Repair with the moible application. This method can be used only when snap is already paired.

Parameters: None

Returns:

  • currentAccountAddress: A string representing the address of current account.
  • newAccountAddress: A string representing the address of current account if repaired with the same account otherwise the new address will be returned corresponding the new account used for pairing.
  • device_name: A string representing the name of the new paired device.

tss_runKeygen

Runs the Distributed Key Generation (DKG) protocol to create a new distributed key.

Parameters: None

Returns:

  • address: A string representing the address of the account if present, otherwise return null.

tss_runSign

(This method is not available outside snap) Send a request to sign a message or Ethereum transaction.

Errors

If an error occurs during any of the methods, an error object is thrown with the following properties:

  • message: A string describing the error.
  • code: A number representing the error code.

Some common error codes are:

  • SnapErrorCode.NotPaired: Indicates the plugin is not paired yet.
  • SnapErrorCode.RejectedRequest: Indicates the user rejected the request.
  • SnapErrorCode.AlreadyPaired: Indicates the plugin is already paired.
  • SnapErrorCode.UnknownMethod: Indicates an unknown method was called.
  • SnapErrorCode.NoDistributedKeyFound: Indicates no distributed key found for the public key provided.
  • SnapErrorCode.InvalidMessageHashLength: Indicates an invalid message hash length, should be 32 bytes.

More details of error can be found here