Whilst moving houses I came across some old HDDs which I've just found contains a wallet.dat from August 2011. The version of Bitcoin-qt must be 0.4.0 as I know the wallet.dat is password encrypted, which was introduced for version 0.4.0. It is 100% *not* >0.4.0, so the vulnerability patched by 0.4.1 is not in place.

What is the best way to go about restoring the encrypted addresses? If I were to install the 0.4.1 Bitcoin-qt update, would there be any problems with current OS dependencies? Should I use Windows, Linux? Any input greatly appreciated. (I will certainly keep a backup)

1 Answer 1


Using wallet /import

If you load the wallet file in a modern Bitcoin Core version, you can use the dumpwallet command (to create an unencrypted dump of the keys), and the importwallet command in a fresh instance with a new empty wallet.dat of the dump. You will need to rescan afterwards, though, which may take a while.

Make sure to wipe the dump file afterwards.

Using db dump/load

One way is to use the following command on a Linux install with db4.8-util installed: db4.8_dump wallet.dat | db4.8_load wallet.dat.new

This will create a new wallet.dat.new file, with the same records as the wallet.dat file, but without any old potentially never-overwritten data.

db4.8-util may be hard to install these days, as most distros stopped distributing db4.8, in favor of 5.1 and later. Bitcoin Core however still uses 4.8 for compatibility reasons. You can use db5.1-util as well, but that means that you'll need a Bitcoin Core version compiled with db5.1 support afterwards to use the newly constructed wallet file.

  • Just for clarity, the rescan which happens after an importwallet doesn't have to be manually initiated, is that correct? Commented May 5, 2015 at 18:34
  • If you are importing multiple keys it's best to add false to the end of the command to prevent the rescan, and then run it manually after you've imported all your keys. Or just import them to a web or SPV wallet and send all the funds to a fresh address which you can import into a newer bitcoin core.
    – George
    Commented May 5, 2015 at 19:12
  • @ChristopherGurnee yes, it will happen automatically. Commented May 5, 2015 at 19:13
  • @George importwallet imports all keys at once already, and only rescans the necessary part intelligently. Commented May 5, 2015 at 19:14
  • @PieterWuille Thanks mate. You're right, the db4.8 is the hard part for a relative Ubuntu newb. I run the node with txindex=1 so no dramas on that front, though I will be sure to use the false flag Commented May 6, 2015 at 3:05

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.