Author

Topic: bitcoin core v25 - set hdseed (Read 91 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
December 28, 2023, 10:47:57 AM
#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.
newbie
Activity: 9
Merit: 5
December 28, 2023, 04: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
staff
Activity: 3458
Merit: 6793
Just writing some code
December 27, 2023, 09:15:40 PM
#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.
newbie
Activity: 9
Merit: 5
December 27, 2023, 06: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?
staff
Activity: 3458
Merit: 6793
Just writing some code
December 27, 2023, 05:50:48 PM
#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.
newbie
Activity: 9
Merit: 5
December 27, 2023, 04:18:02 PM
#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()`
- `bitcoin-cli importdescriptors '[{"desc":"wpkh()#","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
Jump to: