Bitcoin Forum
May 09, 2024, 09:25:48 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Create Bitcoin Core hd wallet from word list / mnemonic  (Read 309 times)
tekbe (OP)
Jr. Member
*
Offline Offline

Activity: 35
Merit: 3


View Profile
May 05, 2019, 01:22:51 PM
Last edit: October 24, 2019, 10:06:13 AM by tekbe
Merited by ABCbits (2), Husna QA (1)
 #1

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.
1715246748
Hero Member
*
Offline Offline

Posts: 1715246748

View Profile Personal Message (Offline)

Ignore
1715246748
Reply with quote  #2

1715246748
Report to moderator
1715246748
Hero Member
*
Offline Offline

Posts: 1715246748

View Profile Personal Message (Offline)

Ignore
1715246748
Reply with quote  #2

1715246748
Report to moderator
1715246748
Hero Member
*
Offline Offline

Posts: 1715246748

View Profile Personal Message (Offline)

Ignore
1715246748
Reply with quote  #2

1715246748
Report to moderator
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715246748
Hero Member
*
Offline Offline

Posts: 1715246748

View Profile Personal Message (Offline)

Ignore
1715246748
Reply with quote  #2

1715246748
Report to moderator
tekbe (OP)
Jr. Member
*
Offline Offline

Activity: 35
Merit: 3


View Profile
May 06, 2019, 02:23:56 AM
 #2

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).
croxNN
Newbie
*
Offline Offline

Activity: 13
Merit: 3


View Profile
August 31, 2019, 08:45:37 AM
 #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.
croxNN
Newbie
*
Offline Offline

Activity: 13
Merit: 3


View Profile
August 31, 2019, 09:01:15 AM
 #4

UPD: Resolved. It needs to use  -v 239 for testnet in bx ec-to-wif command
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!