Original archived Re: Suspected damaged wallet.dat
Scraped on 29/04/2025, 22:18:47 UTC
When you encrypt it, it creates new private keys.
Unless I misunderstood you, are sure this is the case?
I just tried to create a new wallet and then dumped the keys. Then I encrypted it and dumped the keys again. I see the same private keys.
The current private keys in a Bitcoin Core wallet are not created when it is encrypted instead, they are encrypted and secured by a passphrase bitcoin Core does not remove, replace, or regenerate the key material when you encrypt the wallet it only secures the already existing key material. This expected behaviour is confirmed by your test, which involves dumping the keys before and after encryption and noting that they are identical. The original keys remain unaltered only subsequent keys created after encryptio for example, when creating new addresses are encrypted with the passphrase.