Skip to content

karanpokar/wallet-secret-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wallet-Secret Generator

This module helps to generate seedphrase and secret shares using Ethers and Shamir Secret Sharing.

Installation

Install my-project with npm

  npm i wallet-secret-generator

Usage/Examples

Generate Seed Phrase

import {generateSeedPhrase} from 'wallet-secret-generator'

const seedPhrase= await generateSeedPhrase();

Generate Wallet with Secret Shares Phrase

import {generateWalletWithShares} from 'wallet-secret-generator'

const seedPhrase= await generateWalletWithShares(noOfShares,shareThreshold,walletPath);
1. noOfShares: Maximun number of share to be generated from secret
2. shareThreshold: Minimum Shares required to regenerate the secret
3. path: Wallet Path, example:"m/44'/60'/0'/0/0", will create first wallet from seedphrase

Generate SSS Shares

import {generateShares} from 'wallet-secret-generator'

const seedPhrase= generateShares(secret:String,noOfShares:Number,shareThreshold:Number);

 1. noOfShares: Maximun number of share to be generated from secret
 2. shareThreshold: Minimum Shares required to regenerate the secret

Recover Secret

import {recoverShares} from 'wallet-secret-generator'

const seedPhrase= recoverShares(shares:Array<String|Buffer>);

 1. shares: Value generated from generateShares

Generate EOA Wallet

import {generateEOA} from 'wallet-secret-generator'

const seedPhrase= generateEOA(seed:String,path:String);

 1. seed: Seed Phrase from generateSeedPhrase;
 2. path: Wallet Path, example:"m/44'/60'/0'/0/0", will create first wallet from seedphrase. 

Wallet Derivation Paths: https://help.myetherwallet.com/en/articles/5867305-hd-wallets-and-derivation-paths

Shamir Secret Sharing: https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing

EOA: https://ethereum.org/en/developers/docs/accounts/

About

This module helps to generate wallet seed phrase and secret shares.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published