Bitcoin Forum
December 12, 2024, 07:38:34 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: HD wallet technicals  (Read 244 times)
balambala (OP)
Newbie
*
Offline Offline

Activity: 35
Merit: 0


View Profile
April 28, 2019, 03:51:34 AM
 #1

Hello people, I have a couple questions about bitcoin core HD wallet.


I created an HD wallet as follow :

Code:
./bitcoin-qt -usehd -wallet=hd.dat

I generated 4 receiving btc addresses on that wallet then closed the bitcoin core client.
I made a duplicate file of that hd.dat wallet and named it hd1.dat

I open hd.dat wallet with bitcoin core and generate a new incoming btc address, I do the same with hd1.dat wallet but the address generated is different.

Is this normal or there is an issue with the wallet ?

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3570
Merit: 6927


Just writing some code


View Profile WWW
April 28, 2019, 05:08:13 AM
 #2

This is completely expected. You copied the wallet after generating addresses. and opened the copy. This is the same as opening the original wallet file itself because the wallet file (and thus the one you copied) contains all of the information about the addresses already generated.

If instead you had copied the wallet file before generating addresses, you would see the addresses repeated in the copy.

Regardless, both the copy and the original will generate the same addresses, and you should be able to observe that.

balambala (OP)
Newbie
*
Offline Offline

Activity: 35
Merit: 0


View Profile
April 28, 2019, 05:21:29 AM
 #3

I am not sure to follow.

My goal is to use hd.dat wallet for production, do all the important operations such as receiving funds etc and keep hd1.dat as a backup in case the original wallet file gets corrupted or lost.

Per your reply, should I create a new HD wallet, make a duplicate THEN generate new addresses ?

Thank you for your help.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3570
Merit: 6927


Just writing some code


View Profile WWW
April 28, 2019, 06:21:08 AM
 #4

Nevermind, I misread your question.

What version of Bitcoin Core are you using? If you do open the debug console and do getwalletinfo for both wallets, do they show the same thing for hdseedid? If you do getaddressinfo <addr> where <addr> is the address that was generated for each copy of the wallet file respectively, do you see the same thing for hdkeypath?

You should see the same thing, regardless of HD or not, due to the keypool. It is likely that you simply made an error somewhere or the wrong wallet file was loaded.

balambala (OP)
Newbie
*
Offline Offline

Activity: 35
Merit: 0


View Profile
April 29, 2019, 02:30:03 AM
 #5

I was able to make it work, thank you.

I am unsure what the issue was but I somehow fixed it.

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!