Can a BIP39 12-word mnemonic be used to restore a wallet through bitcoin-cli?

1

I could not find documentation on using a 12-word BIP39 Mnemonic to restore a wallet through bitcoin-cli. It seems that importprivkey might be the right RPC call but when I provide the 12 words, it says "Invalid private key encoding" I also tried the following formats which were generated by Ian Coleman's page from https://github.com/iancoleman/bip39:

BIP39 Seed
BIP32 Root Key
Account Extended Private Key
BIP32 Extended Private Key

Perhaps the master seed mnemonic is useless if all you have is bitcoin-cli and the bitcoind to which it's attached. Is that the case?

Dave Scotese

Posted 2019-05-01T04:01:48.810

Reputation: 719

Answers

3

Bitcoin Core does not currently support BIP 39 mnemonics nor the size of the BIP 32 seed produced by a BIP 39 mnemonic. BIP 39 produces 512 bit seeds, but Bitcoin Core currently only supports importing a 256 bit seed via sethdseed.

Andrew Chow

Posted 2019-05-01T04:01:48.810

Reputation: 40 910

Great answer, but too bad sethdseed does not support 512 bit input seeds by allowing xpriv seeds to be imported directly. Then something like the following could have been used:

% echo "army van defense carry jealous true garbage claim echo media make crunch" | bx mnemonic-to-seed -p "" | bx hd-new xprv9s21ZrQH143K3t4UZrNgeA3w861fwjYLaGwmPtQyPMmzshV2owVpfBSd2Q7YsHZ9j6i6ddYjb5PLtUdMZn8LhvuCVhGcQntq5rn7JVMqnieskaht 2019-05-01T15:13:14.017