I have two encrypted wallet.dat files and I'm looking for a way to uniquely identify them from each other. I started using a md5 hash but then I quickly realized that this hash changed each time the bitcoind client was started and recognized the wallet. Is there a way to uniquely identify two unencrypted wallets?

  • 2
    Is there some reason that you can't give the wallets different names and use -wallet to specify to Bitcoin which wallet you want? – Nick ODell Dec 29 '16 at 23:36
  • I'll look into that. Is there any way to check of two wallets are the same? – ThomasReggi Dec 29 '16 at 23:37

Unless you're using HD wallets (only if you created the wallets using Bitcoin Core 0.13 or later), two wallets are never the same as soon as they've done a transaction.

Every time an address is generated or a transaction is sent, a new address is added to the key pool of the wallet (a queue of unused future addresses). If you have two copies of a wallet file, and use generate a new address in one, it is instantly different from the older copy, and it will diverge over time (generate different addresses in the future). So the answer is probably: there is no way to compare two wallets because you shouldn't be relying on the ability to compare them. If you do, you may end up with balance surprises or even monetary loss.

If you're using an HD wallet, you can compare whether the key chains are identical by looking at the hdmasterkeyid in the output of the getwalletinfo RPC call (using bitcoin-cli or the debug console in Bitcoin-Qt).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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