Post
Topic
Board Bitcoin Technical Support
Re: Best practices to use a 2013 wallet on current versions?
by
takuma sato
on 20/11/2023, 02:02:02 UTC
If you had a wallet.dat that was never updated to the new format, and wanted to move to the 25.0 version, does it require any special steps or anything?

The last version I used was around 23.0. I haven't updated since then. I reckon at some point there was some sort of an update on the wallet format that was performed automatically and you didn't have to do anything, not sure if around 0.15 era when segwit was introduced, so im assuming that was applied on the wallet file, but now with the descriptors thing, I've seen some people discussing doing some additional steps. Im old fashioned and I haven't even locked at what the ordinals thing are yet. I use legacy addresses, but had to update because some people request bech32 addresses. As far as I can use Coin Control and generate legacy and bech32 addresses, I would be ok, but im assuming it's best to update for security reasons as bugs get updated. I just don't want to screw up an old wallet in the process. Of course I have backups before any of this is done, but I would like to know if any additional steps are required and why.

If it is a non-HD wallet, upgrade it with -upgradewallet (introduced in 0.17+, I believe).

Then use -migratewallet in 0.25 to upgrade to the descriptor wallet.

It was 0.17 and it seems it doesn't work or poses some problem when the wallet is encrypted:

https://github.com/bitcoin/bitcoin/issues/14422

I would honeslty pass on fiddling with the wallet file unless 100% necessary. Is there any problems at all if I just keep the legacy format? as far as I know, the only issue one would encounter was that there is a limit of addresses you can generate in non-HD wallets before you needed to backup:

Quote
1.5 Backup Frequency

The original Bitcoin Core wallet was a collection of unrelated private keys. If a non-HD wallet had received funds to an address and then was restored from a backup made before the address was generated, then any funds sent to that address would have been lost because there was no deterministic mechanism to derive the address again.

Bitcoin Core version 0.13 introduced HD wallets with deterministic key derivation. With HD wallets, users no longer lose funds when restoring old backups because all addresses are derived from the HD wallet seed.

This means that a single backup is enough to recover the coins at any time. It is still recommended to make regular backups (once a week) or after a significant number of new transactions to maintain the metadata, such as labels. Metadata cannot be retrieved from a blockchain rescan, so if the backup is too old, the metadata will be lost forever.

Wallets created before version 0.13 are not HD and must be backed up every 100 keys used since the previous backup, or even more often to maintain the metadata.

If you were to generate 101 addresses, what happens to address 101 in practice?

Also this always sounded more secure to me even if you required to make backups each time you generated new addresses to keep them:

Quote
The original Bitcoin Core wallet was a collection of unrelated private keys.