Bitcoin Forum
May 06, 2024, 03:21:50 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoin core v25 - set hdseed  (Read 78 times)
blapaz (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 5


View Profile
December 27, 2023, 09:18:02 PM
Merited by o_e_l_e_o (4), ABCbits (1)
 #1

hello, would like some help with the new bitcoin-cli.

- i did create a wallet some time ago with an older version of bitcoin core
- got the dumpfile
- i saved the private key 'L...' with 'hdseed=1' with address 'bc1...'
- i sent some sats to some address that were in the dumpfile
- changed pc
- got bitcoin core v25 installed
- `bitcoin-cli getdescriptorinfo "wpkh(<seedtakenbefore, the one with hdseed=1 mentioned on the 3rd point>)`
- `bitcoin-cli importdescriptors '[{"desc":"wpkh(<seedtakenbefore>)#<checksumfrompreviouscommand>","timestamp":"now"}]'`

now, problem is, that i want to see my addresses.
if i do 'getaddressinfo' with one of the address i sent money to it tells me 'ismine: false'.

question:
- how can i see my previous addresses?

meta question:
- is it correct to save the key with hdseed=1 ?
- should i have used the extended master key in the dump instead of the key with hdseed=1 ?

ps: nothing got lost, i do have the old wallet in a harddrive.
rant: why this is not retro compatible? this legacy wallet story turned me off a little. the network is rock solid, the documentation, guides and backward compatibility of the software is not. at least this is my impression.

thank you in advance
1715008910
Hero Member
*
Offline Offline

Posts: 1715008910

View Profile Personal Message (Offline)

Ignore
1715008910
Reply with quote  #2

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

Posts: 1715008910

View Profile Personal Message (Offline)

Ignore
1715008910
Reply with quote  #2

1715008910
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
December 27, 2023, 10:50:48 PM
Merited by o_e_l_e_o (4), ABCbits (2)
 #2

The HD seed cannot be used in a descriptor as a seed. Using it in a descriptor as you have results in an address with the seed as the private key, not the seed as a seed and then doing derivation on it.

If you want to use the seed in a descriptor wallet, then you will need to compute the BIP 32 master key from it, then specify the derivation paths for deriving the child keys from that master key. Note that the seed is a BIP 32 seed (S in this diagram: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#user-content-Master_key_generation), not a BIP 39 seed phrase or mnemonic.

In general, Bitcoin Core does not intend the seeds that it produces to be handled by people directly since they are incomplete information for restoring a wallet. You should instead be backing up entire wallet files and restoring them when you need to restore backups, rather than trying to find an individual component of the wallet.

If you insist on using the seed, you need to create a legacy wallet and use the sethdseed command. Then you will get the addresses that you expect. Then you should migrate that to a descriptor wallet. However, after migration, the seed will not be used by the wallet anymore. New descriptors are generated which essentially replace that seed.

blapaz (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 5


View Profile
December 27, 2023, 11:01:37 PM
 #3

You should instead be backing up entire wallet files and restoring them when you need to restore backups, rather than trying to find an individual component of the wallet.

If you insist on using the seed, you need to create a legacy wallet and use the sethdseed command. Then you will get the addresses that you expect. Then you should migrate that to a descriptor wallet. However, after migration, the seed will not be used by the wallet anymore. New descriptors are generated which essentially replace that seed.

so would that mean that a paper wallet can't be done anymore?
what are other solutions that do not imply saving a file?

plus, i read the legacy wallet option is going to be removed from the bitcoin core, so that wouldn't be a long term solution.

i wanted to stamp the hd seed in some metal washers, and this is a bummer.
maybe now i find a solution, then in two year that won't work.

consider i want to do something that would last forever. what would you do?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
December 28, 2023, 02:15:40 AM
Merited by ABCbits (2)
 #4

so would that mean that a paper wallet can't be done anymore?
Bitcoin Core has never supported paper wallets.

In any case, single key paper wallets will work with descriptor wallets since they are single private keys. A HD seed is not that.

what are other solutions that do not imply saving a file?
Exporting and storing the descriptors of a descriptor wallet.

plus, i read the legacy wallet option is going to be removed from the bitcoin core, so that wouldn't be a long term solution.
Yes, it will be. However there are plans to reintroduce sethdseed in some form so you could still store just the seed. But that's still not exactly sufficient as you don't have information about derivation paths and scripts. Descriptors contain all of that information, so I recommend you store those.

consider i want to do something that would last forever. what would you do?
Nothing is guaranteed to last forever, but something that follows published standards is certainly more likely. The legacy wallet's HD seed stuff most certainly does not follow the existing standards.

I would suggest using a descriptor wallet and writing down the descriptors. While it's a lot more verbose, it is also much more complete and will not rely on guesswork in the future.

You could also just do a standard BIP 39 mnemonic, but keep in mind that these do not contain derivation path or script information, and they are not (currently) supported by Bitcoin Core.

blapaz (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 5


View Profile
December 28, 2023, 09:06:21 AM
 #5

ok clear, will try things out.
i guess i need to save the xpriv from the `listdescriptors` command, right?

if i may take advantage of your generosity, can you explain this (i take my previous points):
- i sent some sats to some address that were in the dumpfile, *bc1..abcd*
- if i do 'getaddressinfo' of the *bc1..abcd* address i sent money to it tells me 'ismine: false'

i don't have a full node to test this at the moment:
- is the money gone?
- or will it have the ability to 'see' that address balance if i run a node?

thank you again
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
December 28, 2023, 03:47:57 PM
 #6

ok clear, will try things out.
i guess i need to save the xpriv from the `listdescriptors` command, right?
You need to save everything, not just the private key. Otherwise you are throwing away information that is necessary for restoration. If you do not save the entire descriptor, you lose the derivation path information and the address types and will have to guess those in the future. Backups are much better when they contain all of the information necessary in order to rediscover your funds.

if i may take advantage of your generosity, can you explain this (i take my previous points):
- i sent some sats to some address that were in the dumpfile, *bc1..abcd*
- if i do 'getaddressinfo' of the *bc1..abcd* address i sent money to it tells me 'ismine: false'
That address is derived from the master private key that itself is derived from the seed. Since you have not done sethdseed but rather just imported the seed as a normal private key, these derivation steps have not been done. The wallet does not know that the private key you imported is actually a seed and that it needs to do derivation on it. So all addresses that are derived from it are not known by your wallet.

i don't have a full node to test this at the moment:
- is the money gone?
- or will it have the ability to 'see' that address balance if i run a node?
It is not gone. However you need to make the wallet aware of the fact that you have a seed and not just a single private key.

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!