Background how I got here:

I have a very old wallet file in .dat format (from 2017) The backup is as far as I remember just a copy of the wallet file from bitcoin-core's ~/.bitcoin directory.

I tried opening it in "modern" bitcoin-core by:

  1. copying the wallet file into ~/.bitcoin/wallets/walletName/walletName.dat
  2. adding the wallet name to list in ~/.bitcoin/settings.json

Now, upon starting bitcoin-core I get this message:

Error: Failed to load database path '/home/{redacted}/.bitcoin/wallets/OldWallet_1'. Data is not in recognized format.

So, having no meaningful results in google other than pywallet, I decided to try importing it to electron... and discovered that electron doesn't have an option to import bitcoin-core wallets (wtf?). I did find some information about "pywallet", I tried using it to recover information from my .dat file, I had to modify it a bit since my encryption password is really long and has many weird characters in it so passing it as an argument for script execution is incredibly difficult.

I managed to get list of all addresses defined in this file and "encrypted_privkey" for each address.

I didn't manage to get it to decrypt anything, because the script crashes with "Segmentation Fault (core dumped)" (everyone loves C/C++).

The question:

So, my question is, given I know the password to this wallet (I think I also recovered the encryption salt) and I have "encrypted_privkey" list, how do I decrypt them so I can import them in electron?


I just tried importing my dashcoin wallet to dash-core, I get the same error message, so it's very likely that something about the wallet file format has changed during the time I wasn't using cryptocurrencies.

If anyone knows how to "upgrade" the file format, please let me know, it'll also solve the problem.

  • if this file is from Bitcoin Core you should be able to open it again using the same software. Bitcoin Core will allow you to open the wallet without type the password, download the Bitcoin core version v0.20.1, then you put your wallet.dat into ~/.bitcoin. Nothing else. Commented May 21, 2021 at 23:26

3 Answers 3


copying the wallet file into ~/.bitcoin/wallets/walletName/walletName.dat

Try ~/.bitcoin/wallets/walletName/wallet.dat -i.e. just wallet.dat

Looking at my wallets, the wallet files are all called wallet.dat irrespective of the name. That might be the problem.


Try pywallet a github repo that has what you need. it will dump your keys in WIF


  • Pywallet.py is mostly not compatible with wallets. Should be updated. Even if dumps then passphrase usage is making an error.
    – pbies
    Commented Dec 19, 2022 at 7:08

there is command opton in bitcoin core, there you can type "upgradewallet" check if something happens.

  • 2
    If bitcoin core can't open the file, it certainly won't be able to upgrade it. Commented May 21, 2021 at 23:27

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.