<p>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.</p>

<p>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. </p>

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

<p>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.</p>

<p>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?</p>

<blockquote>
  <p>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?</p>
</blockquote>

<p>Yes, you could.</p>

CC BY-SA 3.0
2013-03-23T17:29:24.440Z
2013-03-23T17:34:24.887Z
2013-03-23T17:34:24.887Z
Nick ODell
<p>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.</p>

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

<p>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.</p>

<p>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).</p>

<p>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.</p>

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

CC BY-SA 3.0
2013-03-23T19:21:43.147Z
2013-03-23T19:21:43.147Z
Stephen Gornick
<p>I'm a little confused by this, which i found in the technical documention:</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>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?</p>

<p>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?</p>

<wallet><encryption><keypool>
Do keypool keys from an unencrypted wallet backup become unusable once I encrypt my wallet?
noobStuff
# Do keypool keys from an unencrypted wallet backup become unusable once I encrypt my wallet?

(Asked by: username_0 on 2013-03-23)

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?

**Tags:** wallet, encryption, keypool


---

## 2 answers

### Answer by username_1 on 2013-03-23. Score: 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.


---

### Answer by username_2 on 2013-03-23. Score: 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.


---

