Created
November 6, 2018 11:31
-
-
Save nodech/4dc52f73960bbb08a52e4851f9a7bdbb to your computer and use it in GitHub Desktop.
Get wif from mnemonic for certain path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {hd, KeyRing} = require('bcoin'); | |
const {HDPrivateKey} = hd; | |
const mnemonic = 'midnight volcano start infant error drama bulk disorder' | |
+ ' mouse key cliff climb buyer wage ceiling load express earth trick' | |
+ ' broccoli siege math hope attend'; | |
const privateKey = HDPrivateKey.fromPhrase(mnemonic); | |
const deriveSomething = privateKey.derivePath(`m/44'/1/0/0/0`); | |
const ring = KeyRing.fromPrivate(deriveSomething.privateKey); | |
console.log(ring.toSecret('regtest')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment