bip39-sss-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

bip39-sss-js-sdk

Split BIP39 mnemonics using Shamir's Secret Sharing Scheme Integrated 'bip39' lib

Guild

  1. To generate mnemonic with 'bip39' lib.

    import { generateTwelveWordsMnemonic } from 'bip39-sss-js-sdk';
    
    const generated_mnemonic = generateTwelveWordsMnemonic();
  2. To generate M/N mnemonic shares

    To generate M shares and require N to recover the mnemonic, (N >= M/2 + 1).

    Accepts a BIP39 mnemonic and returns a Shares map, in which the keys are the share id's, and the values are the BIP39 mnemonics.

    import { splitMnemonic } from "bip39-sss-js-sdk"
    
    splitMnemonic(example_mnemonic, 3, 2); // to split 3 shares and requeire 2 share to recover the mnemonic
    splitMnemonic(example_mnemonic, 5, 3);
    splitMnemonic(example_mnemonic, m, n);
  3. To recover mnemonic

    import { recoverMnemonic } from "bip39-sss-js-sdk"
    
    recoverMnemonic(split_1_3_5_for_generated_5_3) // use the 1st, 3rd, 5th to recover the orginal/real mnemonic
  4. To get address or private key with 'web3'

    import { getEntropyByMnemonic } from 'bip39-sss-js-sdk';
    
    web3.eth.accounts.create(getEntropyByMnemonic(generated_mnemonic)) // to get account with web3

Reference

Readme

Keywords

none

Package Sidebar

Install

npm i bip39-sss-js-sdk

Weekly Downloads

3

Version

0.1.2

License

none

Unpacked Size

75.2 kB

Total Files

36

Last publish

Collaborators

  • davidwilde