Package Exports
- mnemonic-to-key-pair
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mnemonic-to-key-pair) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mnemonic-to-key-pair
Obtain a key pair from a BIP 39 mnemonic phrase.
Installation
npm install mnemonic-to-key-pairUsage
const mnemonicToKeyPair = require('mnemonic-to-key-pair')
const { publicKey } = mnemonicToKeyPair(
'maze birth captain runway client pulp vast universe era panda discover access',
"m/44'/0'/0'/0/0",
"1234"
)
console.log(publicKey.toString()) // 0238e831638a96248d1a8ee6b6ee16170667b0e0529cdc838d825b135c927aa95dAPI
mnemonicToKeyPair(mnemonic, derivationPath, [password]) ⇒ keyPair
Obtian a key pair from a BIP39 mnemonic phrase and following the supplied derivation path. Optinally supply a password.
Returns: keyPair - The key pair.
| Param | Type | Description |
|---|---|---|
| mnemonic | string |
The 12-words mnemonic phrase. |
| derivationPath | string |
The derivation path to use. I.e. "m/44'...". |
| [password] | string |
The mnemonic password. |
keyPair
Properties
| Name | Type | Description |
|---|---|---|
| privateKey | Buffer |
The private key. |
| publicKey | Buffer |
The public key. |
License
MIT