<p>Bitcoin Core uses a "keypool".  When it first runs, it generates a list of 100 new addresses.  After that, each time the user asks to "generate a new address" (or an address is needed for change, etc), the next address from the keypool list is used, and a freshly generated address is added to the end of the list to replace it.  The keypool keys are stored in <code>wallet.dat</code> along with your other private keys.</p>

<p>The purpose of this feature is so that when you back up <code>wallet.dat</code>, you get not only the keys you have already used, but also the next 100 you will use.  If this were not the case, then everytime you generated an address or made a transaction (generating a change address), you would have to immediately backup <code>wallet.dat</code> again, and you'd be vulnerable to losing coins if your disk crashed in the meantime.</p>

<p>So when you copied the entire Bitcoin data directory, including wallet.dat, you also copied the keypool.  As such, the next 100 addresses "generated" by both installations will be the same.    After that they will differ.</p>

<p>But you probably didn't really want to share the wallet between both installations, since this can cause confusion unless you really pay attention to what you are doing.  So you can delete the <code>wallet.dat</code> from one of the installations (if you have made real transactions with it, back it up first) and let it be regenerated.</p>

CC BY-SA 3.0
2014-08-26T13:50:25.090Z
2014-08-26T13:50:25.090Z
Nate Eldredge
<p>I copied the whole directory for bitcoin data and then ran two instances one for the first directory and the other for the copied one, and then I generated a new address from the old instance go to the new instance and ran validate address it showed "ismine":true !! </p>

<p>Could you please explain this ? </p>

<p><img src="https://i.sstatic.net/i6esT.jpg" alt="enter image description here"></p>

<bitcoind><bitcoin-core>
Test in a box duplicating addresses how come?
Mohamed Farrag
# Test in a box duplicating addresses how come?

(Asked by: username_0 on 2014-08-26)

I copied the whole directory for bitcoin data and then ran two instances one for the first directory and the other for the copied one, and then I generated a new address from the old instance go to the new instance and ran validate address it showed "ismine":true !!

Could you please explain this ?

![enter image description here](https://i.sstatic.net/i6esT.jpg)

**Tags:** bitcoind, bitcoin-core


---

## 1 answers

### Answer by username_1 on 2014-08-26. Score: 2 | Accepted answer

Bitcoin Core uses a "keypool". When it first runs, it generates a list of 100 new addresses. After that, each time the user asks to "generate a new address" (or an address is needed for change, etc), the next address from the keypool list is used, and a freshly generated address is added to the end of the list to replace it. The keypool keys are stored in `wallet.dat` along with your other private keys.

The purpose of this feature is so that when you back up `wallet.dat`, you get not only the keys you have already used, but also the next 100 you will use. If this were not the case, then everytime you generated an address or made a transaction (generating a change address), you would have to immediately backup `wallet.dat` again, and you'd be vulnerable to losing coins if your disk crashed in the meantime.

So when you copied the entire Bitcoin data directory, including wallet.dat, you also copied the keypool. As such, the next 100 addresses "generated" by both installations will be the same. After that they will differ.

But you probably didn't really want to share the wallet between both installations, since this can cause confusion unless you really pay attention to what you are doing. So you can delete the `wallet.dat` from one of the installations (if you have made real transactions with it, back it up first) and let it be regenerated.


---

