Symbol Secret Sharing Library Concept
Warning: This is an experimental library, it is NOT to be used for production applications.
About
This library utilizes Shamir's Secret Sharing, a mechanism in which a given secret is divided in to a series of parts that can be later be combined to reveal the secret (called the threshold scheme). It uses this mechanism to 'shard' Symbol private keys into multiple shares, of which n
of m
shares are required to fully reveal the secret. You can read more about Shamir's Secret Sharing here.
This has a host of use cases with Symbol, such as the ability to distribute a private key to multiple individuals for the purposes of an "offline" sort of Symbol multisig.
Basic Usage
The basic usage is outlined below. You can create sharded private keys, encrypt, and decrypt messages. Please note that this may change in the near future, and some edge cases may not (yet) be covered.
- Install:
npm install symbol-secret-sharing
/* Divide a private key into multiple shares */ ;; /* The network type */ ; ; /* The message that you want to encrypt */ ; /* The 'threshold, or n of m shares needed to unlock the secret' */ ; /* Total number of shares to be issued */ ; /* Sharded private key, can be used for encryption */ ; /* Use a sharded key to encrypt the message. It has to have enough info has defined in the threshold */ ; /* Use the sharded key to decrypt the message */ ;