I'm trying to use a mnemonic seed to generate a bitcoin-core wallet. I know core does not support bip39, but it does support bip32 and sethdseed should make it possible to use the seed generated by a given mnemonic.
What I'm trying to do is to generate a seed using https://github.com/iancoleman/bip39 and use that xprv to feed sethdseed on an empty wallet created on bitcoin core.
The main problem I'm facing is that the format required by the bitcoin core wallet is not available, and I'm not being able to generate it on any way:
I've just created a new wallet just for testing and make a dump, it reads something like:
# extended private masterkey: xprv9s21ZrQH143K3ndNedb7hus3kpzuUyAafU9zvKxgqgveg4623gViHrSrkiaweK2WfNNbdANyEa6D9GceWtiyWHPtSdyUCpVweg8A6wdqG7g L5613pTNa7wks3DVt9HrPYDR1aBpMHn3qpxBLfQyDR4kKgaBrNRS 2019-07-14T21:57:10Z hdseed=1 # addr=32AoHsZ6AvTPxiqkACTMbMcdPhD4Xye1nM KyAP4Jf5APLei25PbfeohPWaRNmCj2yQjwWtreqM4ixXJR23Dxo7 2019-07-14T21:57:11Z reserve=1 # addr=36DxZaj6JEXgSSdTtsN6yEdULgGrfc5A5W hdkeypath=m/0'/0'/9' ...
So it says that the masterkey given translate on the given hdseed
xprv = xprv9s21ZrQH143K3ndNedb7hus3kpzuUyAafU9zvKxgqgveg4623gViHrSrkiaweK2WfNNbdANyEa6D9GceWtiyWHPtSdyUCpVweg8A6wdqG7g should translate in some way to: hdseed = L5613pTNa7wks3DVt9HrPYDR1aBpMHn3qpxBLfQyDR4kKgaBrNRS
But I could not found any way to get from one to the other.
It seems that there is already an isssue on bip39, about this, without results.
I've tested using
bitcoinjs-lib with the following code without luck:
const bip32 = require('bip32') const bitcoin = require('bitcoinjs-lib') const xpriv = 'xprv9s21ZrQH143K3ndNedb7hus3kpzuUyAafU9zvKxgqgveg4623gViHrSrkiaweK2WfNNbdANyEa6D9GceWtiyWHPtSdyUCpVweg8A6wdqG7g' const node = bip32.fromBase58(xpriv, bitcoin.networks.bitcoin) console.log(node.toWIF())
But it does generate 'L1UsWzEdexKrXmNaM8b4dyv4TsMHouVFgKhFANuhomHJjNbniWdx'.