1
I have the following test Mnemonic:
stable primary already collect buffalo bike into robust fury cement proof agree neither blouse course
From this I can generate a BIP39 Wallet: https://iancoleman.io/bip39/
From this I can get all the private keys of the derived addresses (if you scroll down to the bottom).
But I'm not sure what format they're in.
The library, bitconjs-lib does the following:
const ONE = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')
keyPair = ECPair.fromPrivateKey(ONE)
https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/ecpair.js#L29
But the private keys generated by https://iancoleman.io/bip39/ do not match the length required by bitcoinjs-lib
Thanks so much @Thorkil, just one last question: which line in the file you added shows a derivation to a regular private key? – timothyylim – 2019-01-08T12:01:36.957
Can you call this?
const seed = bip39.mnemonicToSeed(mnemonic); const node = bip32.fromSeed(seed); const privateKey = node.toWIF(); – Thorkil Værge – 2019-01-08T13:43:08.187
that worked! Just for future reference, I used the wif node module to decode it to hex. – timothyylim – 2019-01-09T16:12:26.263