<p>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.</p>

<p>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.</p>

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

CC BY-SA 3.0
2016-12-31T10:44:29.330Z
2016-12-31T10:44:29.330Z
Pieter Wuille
<p>I have two encrypted <code>wallet.dat</code> 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 <code>bitcoind</code> client was started and recognized the wallet. Is there a way to uniquely identify two unencrypted wallets?</p>

CC BY-SA 3.0
2016-12-29T23:36:12.017Z
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
CC BY-SA 3.0
2016-12-29T23:37:37.793Z
I'll look into that. Is there any way to check of two wallets are the same?
ThomasReggi
<wallet><wallet.dat>
Uniquely identify two wallet.dat files
ThomasReggi
# Uniquely identify two wallet.dat files

(Asked by: username_0 on 2016-12-29)

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?

**Tags:** wallet, wallet.dat

> **Comments:**
> **username_1**: Is there some reason that you can't give the wallets different names and use -wallet to specify to Bitcoin which wallet you want?  
> **username_0**: I'll look into that. Is there any way to check of two wallets are the same?  

---

## 1 answers

### Answer by username_2 on 2016-12-31. Score: 1

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).


---

