1

I have an old wallet, created with a very old version of bitcoind, which I'm trying to access once again. I'm trying to understand the various issues that might be preventing me from seeing any balance, currently. I put the various questions I encountered in bold, below.

My plan was to access the old wallet using the old build of bitcoind, then run dumpwallet to get the private keys exported, and re-import those keys to a new wallet on a plain, modern build of the software.

Does this sound like a feasible plan? Is there any information that is lost, when going through dumpwallet as I describe? Will it still see every transaction that occurred and be able to do everything I could with the old wallet?

Some relevant tidbits:

  • The bitcoind binary that created this wallet was compiled with --with-incompatible-bdb. It is bdb5, I believe. If I want to run a more modern binary, I will have to compile it with that flag too, right? There's no way to 'downgrade' from 5 to 4.8 (which is the default, I believe), as I understand it? This is my main reason for trying to go through the dumpwallet approach.

So far, I have run the old code, with the old wallet, but it is showing a balance of "0.000..." and "txcount:0", even after the block chain is fully downloaded, and even after doing -rescan on the wallet. I'm trying to figure out what the problem is, here.

  • There have been a few transactions on the wallet, over the years. Probably via different builds of bitcoind (I forget, exactly).

  • There have been a few splits and many upgrades to bitcoin and I have not followed that stuff in detail. Could they explain why I am seeing "0.000..."? Maybe my old client is communicating with a new network and some information is lost, somehow?


Edit: The accepted answer got me on the right track; I was not getting the right wallet loaded.

The error messages from a modern build of bitcoind are much more useful than the old version I was using. Using -wallet=filename.dat was actually creating an empty wallet of that name, not using the one in the current directory. I had to make sure to copy the file to the $HOME/.bitcoin/ directory, first.

3
  • dumpwallet wont have metadata, only keys. But it should be good enough if you just want to access bitcoin from old wallet and maybe move to new wallet or elsewhere. Not sure why you see zero balance.
    – user103136
    Aug 4, 2021 at 2:36
  • @Prayank What info is in the metadata?
    – jwd
    Aug 4, 2021 at 2:50
  • Labels are mentioned in this doc: github.com/bitcoin/bitcoin/blob/…. There is one PR open since 2017 which adds metadata related to HD key in dumpwallet: github.com/bitcoin/bitcoin/pull/11803. I had asked related questions in IRC but got no response so not sure.
    – user103136
    Aug 4, 2021 at 3:01

2 Answers 2

2

You should be able to load the wallet directly into a recent version of Bitcoin Core and it should load just fine. Compatibility has been maintained.

Does this sound like a feasible plan? Is there any information that is lost, when going throuigh dumpwallet as I describe? Will it still see every transaction that occurred and be able to do everything I could with the old wallet?

You will lose all transaction data and any metadata like accounts (now referred to as labels and has a slightly different meaning) and key birth times.

  • The bitcoind binary that created this wallet was compiled with --with-incompatible-bdb. It is bdb5, I believe. If I want to run a more modern binary, I will have to compile it with that flag too, right? There's no way to 'downgrade' from 5 to 4.8 (which is the default, I believe), as I understand it? This is my main reason for trying to go through the dumpwallet approach.

Actually you don't. The wallet.dat file itself is compatible, it's some other temp files surrounding it that are not. However if you cleanly shutdown bitcoind, then those files will be cleaned up and everything consolidated into the wallet.dat file. It can be opened in a release version of Bitcoin Core. A clean shutdown means that the wallet.dat file will be portable, so if you are concerned that the other incompatible temp files remain, you can just keep the wallet.dat file and everything will be fine.

In any case, you can just try with a copy of the wallet file. If it is incompatible, you will just get an error saying so. Nothing is written if it can't be opened.

So far, I have run the old code, with the old wallet, but it is showing a balance of "0.000..." and "txcount:0", even after the block chain is fully downloaded, and even after doing -rescan on the wallet. I'm trying to figure out what the problem is, here.

It is possible that you are not actually using the wallet that you think you are. For a long time Bitcoin Core would always create a new wallet if one did not exist. This would often result in people thinking they have restored their wallet (because a wallet was loaded) when in fact a new one was generated. This may be what is happening here.

Or maybe the wallet file just doesn't have anything in it.

  • There have been a few splits and many upgrades to bitcoin and I have not followed that stuff in detail. Could they explain why I am seeing "0.000..."? Maybe my old client is communicating with a new network and some information is lost, somehow?

No. Any transactions that exist before any splits would still be in the wallet. Furthermore, any transactions that are no longer in the blockchain would still appear because they are stored in your wallet. They would just appear as being unconfirmed or conflicted. That nothing appears indicates the wallet file contains nothing.

3
  • Thanks for the info. Regarding "not actually using the wallet that you think you are": I am using bitcoind -wallet xxx.dat ... to run the program (it is v0.15.1). Should that properly get it loaded, or is there something else you are referring to? Also: you say a (properly shut-down) bdb5 wallet should be compatible with a recent release version; but I thought the default was bdb4.8? Are you saying a bdb5 wallet be loaded with bdb4.8?
    – jwd
    Aug 4, 2021 at 16:29
  • The correct syntax is -wallet=<wallet name> and the wallet needs to be in the data directory. The only way to be absolutely sure that a new wallet isn't being created is to not use a version that makes new wallets when one doesn't exist. bdb5 and bdb4.8 use the same data format. Only the temp files format changed to be incompatible. So you can use the wallet.dat file created with bdb5 in a version built with bdb4.8.
    – Andrew Chow
    Aug 4, 2021 at 16:35
  • Got it working; thank you again for the help. The old bitcoind was taking -wallet=foo.dat and creating an empty wallet of that name (I had foo.dat in the local directory, rather than copied into ~/.bitcoin/... as I should have). Still using bdb5, but I assume that's not actually necessary, from what you said.
    – jwd
    Aug 4, 2021 at 23:29
0

Yeah it show error some time but you can use pywallet.py to retrieve your privatekey easily. If you don't know how use it search on google pywallet.py you need Python2.7 or 3.9

Your Answer

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

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