6

I'm a little confused by this, which i found in the technical documention:

When wallet passphrase enrcyption becomes enabled, any unused keys from the keypool are flushed (marked as used) and new keys protected with encyption are added. For this reason, make a new backup of your wallet so that you will be able to recover the keys from the new key pool should access to your backups be necessary.

If I were to encrypt my wallet.dat and had a recent backup that was unencrypted do the keypool keys in the unencrypted backup become invalid?

If I hadn't made any new transactions using the new encrypted wallet would I still be able to restore the backup using the unencrypted wallet backup or would this cause problems?

2 Answers 2

3

They don't become invalid. When you ask for a new address from the client, it will not choose any that it has already given you. This is for your privacy, because it makes it more difficult to associate those addresses with you.

In this case, we're making them as used for a different reason. To explain why, let's suppose the wallet didn't treat the previously unencrypted addresses differently.

  • You generate a wallet.
  • You read about the importance of backups, and make a backup to an external flash drive.
  • You read about the importance of encrypting your wallet, and do so.
  • For about 6 months, you use 3 new addresses every week.
  • You get hacked, and you have the external flash drive plugged into your computer at the time.

Your wallet would be encrypted, but that wouldn't matter, because all of the keys that hold a balance are also sitting unencrypted on your flash drive.

In theory, you could just destroy all unencrypted copies of your wallet, but that seems more difficult than generating new keys and making a new backup, no?

If I hadn't made any new transactions using the new encrypted wallet would I still be able to restore the backup using the unencrypted wallet backup or would this cause problems?

Yes, you could.

2

It is also recommended that immediately after encrypting that you then spend your coins that existed prior to encryption to a new address generated post-encryption.

That way if your old wallet backups were to fall in the wrong hands, your funds would still be safe.

If you didn't do that, then your funds are still spendable from the wallet that was backed up prior to adding the passphrase encryption.

But as soon as you do any spend transaction in the wallet with encryption, the change will go to a new address that the wallet from the old backup doesn't know exists. So essentially you should consider any backups made prior to the encryption step as being useless to you (but still possibly dangerous if someone else gets them).

So do yourself a favor, spend the funds to a new address immediately after encrypting (and performing proper backups), so that the old backup has no funds.

Just never forget your encryption passphrase though, and make sure to test that you can recover from your backups that you've made.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.