[Bitcoin-development] Wallet encryption migration

Gregory Maxwell gmaxwell at gmail.com
Sun Jul 17 08:01:47 UTC 2011


On Thu, Jul 14, 2011 at 10:50 PM, Luke-Jr <luke at dashjr.org> wrote:
> Just wanted to get these suggestions out here:
> 1. Write over the old, unencrypted wallet.dat a couple of times with pseudo-
>   random data in an attempt to secure-delete it.
> 2. Mark all the keys imported from an unencrypted file (wallet or otherwise)
>   as "potentially compromised" and never use them for new addresses
>   (basically, don't use the old keypool for getnewaddress, change, and such).

On Sat, Jul 16, 2011 at 6:38 PM, Arthur Britto <ahbritto at gmail.com> wrote:
> Writing zeros just once should be sufficient:

On many (most?) modern Unix file systems writing zeros just once is
not sufficient because the data won't be written in place, but
multiple writes aren't any better.

Moving the keypool addresses aside so they won't be used sounds like a
good idea.

The lamest thing is that there is no way for wallet to be
born-encrypted. So the only way to prevent a leak is to build the
wallet initially on a ramdisk or the like, then move it over after
encrypting it.

At least luke-jr's (2) would make the key leak on a new wallet
inconsequential— since all keys in it are keypool keys at that point.
So I really think it ought to be done.




More information about the bitcoin-dev mailing list