Author

Topic: Create Bitcoin Core hd wallet from word list / mnemonic (Read 326 times)

newbie
Activity: 13
Merit: 3
UPD: Resolved. It needs to use  -v 239 for testnet in bx ec-to-wif command
newbie
Activity: 13
Merit: 3
Hello all!

I'm trying understand HD wallets in bitcoin core implementation and got stuck. Here it is:

$ bx seed | bx mnemonic-new -l en
reward awake later spot grass list peanut clog hurry guess question father leg dress only reunion horn napkin

$ echo "reward awake later spot grass list peanut clog hurry guess question father leg dress only reunion horn napkin" | bx mnemonic-to-seed | bx hd-new | bx hd-to-ec | bx ec-to-wif
L1G3dzjDmkPNkrYLs2L9pTbF9BZ4XThqkXVtDxcrP887uPYRjriG

That WIF key L1G3dzjDmkPNkrYLs2L9pTbF9BZ4XThqkXVtDxcrP887uPYRjriG should be ok for sethdseed? Right?

So next:
$ bitcoin-cli createwallet test
{
  "name": "test",
  "warning": ""
}


$ bitcoin-cli -rpcwallet=test sethdseed true L1G3dzjDmkPNkrYLs2L9pTbF9BZ4XThqkXVtDxcrP887uPYRjriG
error code: -5
error message:
Invalid private key


What's wrong?

Thanks in advance.
jr. member
Activity: 35
Merit: 3
Quote
i wonder why you use mnemonic seed with 18 words which isn't common?

The readme was misleading: 9, 12, 15, 18 or 21 words are fine (everything that "bx mnemonic-to-seed" accepts as input).
jr. member
Activity: 35
Merit: 3
To have a way of (re-)creating Bitcoin Core wallets out of a word list I wrote a bash script.

https://github.com/tekbe/wallet-tools

How it works:


This can basically be done with two lines in the terminal:

Code:
$ echo "my random and secret word list" | bx mnemonic-to-seed | bx hd-new | bx hd-to-ec | bx ec-to-wif
L26zbMQRXyhUaaHcTQ13mzHWBauMPsG2qrmZQHx5QpYmMMFkhcWn
$ bitcoin-cli sethdseed true "L26zbMQRXyhUaaHcTQ13mzHWBauMPsG2qrmZQHx5QpYmMMFkhcWn"

A random word list can also be created with Bitcoin Explorer:

Code:
$ bx seed | bx mnemonic-new
sadness arrow artefact expect office carry fatal tape radar ladder dirt hawk echo bone exile uphold topple local

The script provides some extra convenience. Hope it's useful.
Jump to: