Keys from seed¶
Key generation from seeds follows BIP39/BIP44.
The derivation path used here by default is m/44'/441'/0'/0/n
, but you can supply a custom one.
Mnemonic seed¶
BIP39 mnemonic seed phrases
-
privateKeysFromMnemonic
(mnemonic, options)¶ Returns n private keys derived from mnemonic
Arguments: - mnemonic (string) –
- options (seed.Options) – (optional) { count: number, hdpath: string }
Returns: Promise<Buffer[]> –
-
privateKeyFromMnemonic
(mnemonic, options)¶ Returns the first private key derived from mnemonic
Arguments: - mnemonic (string) –
- options (seed.Options) – (optional) { hdpath: string }
Returns: Promise<Buffer> –
-
generateMnemonic
(strength, rng, wordlist)¶ Generate random mnemonic
Arguments: - strength (undefined|number) – in bits, default 128
- rng (undefined|<TODO>) – optional, function to generate random bots
- wordlist (string[]) – optional, custom wordlist
Returns: string –
-
mnemonicToSeed
(mnemonic, password)¶ Convert mnemonic string to seed
Arguments: - mnemonic (string) –
- password (undefined|string) – optional
Returns: Promise<Buffer> –
Raw seed¶
-
privateKeysFromSeed
(seed, options)¶ Returns n private keys derived from seed
Arguments: - seed (Buffer) –
- options (seed.Options) – (optional) { count: number, hdpath: string }
Returns: Buffer[] –
-
privateKeyFromSeed
(seed, options)¶ Returns the first private key derived from seed
Arguments: - seed (Buffer) –
- options (seed.Options) – (optional) { hdpath: string }
Returns: Promise<Buffer> –