<p>A bitcoin address is a 20-byte hash of a 64-byte public key (plus an ID and checksum to bring it up to 25 bytes).  As such, there are two theoretical possibilities with a clash:</p>

<ul>
<li>Two separate people own public keys which hash to the same value</li>
<li>Two separate people own the same public key</li>
</ul>

<p>Due to the way that Bitcoin transactions work, either of these situations would be enough for one party to spend the funds attached to the address.</p>

<p>So it's worth considering the likelihood of such a scenario.  Let's assume we have 7 billion people on the planet and they all use Bitcoin.  For there to be a 0.00000000001% chance of just two of the total in-use addresses clashing somewhere each person would need to have 4 trillion active addresses.</p>

<p>(Note that this is just calculating the chance of a hash collision; the chance of hitting the same keypair is so much more remote it's not worth bothering with).</p>

CC BY-SA 3.0
2013-04-13T21:13:19.297Z
if every person in the planet ends up using bitcoin, and each person has 10 wallets, would it still be so low?
knocte
CC BY-SA 3.0
2013-04-14T16:13:34.617Z
Going back to the same question again, are you sure that by obtaining the same address, you would obtain the same private key? I think an address is a hash, and by having the hash you cannot obtain the private key, but you do in the other way around. So many private keys would resolve to the same hash.
knocte
CC BY-SA 3.0
2013-04-14T16:28:17.153Z
Sorry but I never asked about a duplicate key but about a duplicate address. Can you remove any parts of your reply that cover the "duplicate key" topic?
knocte
CC BY-SA 3.0
2013-04-14T17:36:50.123Z
Okay removed the various comments on the answer and just put it all directly in to the answer itself.
jgm
CC BY-SA 3.0
2013-04-14T18:27:24.240Z
Could you explain how you got that probability?
Jeremy
CC BY-SA 3.0
2013-04-14T19:10:31.477Z
@Jeremy It's from the birthday paradox with a search space of 2^160 (the number of bits in the hash).  The actual math can be found on Wikipedia's Birthday Attack page.
jgm
CC BY-SA 3.0
2013-04-13T21:07:04.657Z
2013-04-14T17:35:43.090Z
2013-04-14T17:35:43.090Z
jgm
<p>Coins sent to the shared address would appear in both wallets, but would then disappear from both of them when one of the persons spends them. As the network acknowledges and confirms that the coins have left that address, the wallet of the second person would be notified of this and decrease its value accordingly.</p>

<p>This would only affect coins sent to that specific address; the other coins in the two wallets would remain unrelated.</p>

CC BY-SA 3.0
2013-04-14T18:18:17.557Z
2013-04-14T18:18:17.557Z
Massimo
<p>The first address would be able to spend bitcoins belonging to the second, and vice-versa.</p>

CC BY-SA 3.0
2013-04-13T19:57:51.303Z
2013-04-13T19:57:51.303Z
Nick ODell
<p>The chances are suuuppppeeeer low, even when every person would have 1.000.000 wallets it would be super low. </p>

<p>And last but not least Bitcoin supports also the OP_HASH256 so if necessary the address range could be easily expanded to an even higher number. So do not worry ;-)</p>

CC BY-SA 3.0
2013-04-13T23:01:36.320Z
While this is true, it doesn't answer the question that knocte posed.
Nick ODell
CC BY-SA 3.0
2013-04-13T21:42:44.370Z
2013-04-13T21:47:50.583Z
2013-04-13T21:47:50.583Z
NJFreeman
<p>Addresses are like GUIDs, no? They are created randomly whenever you request the creation of a new address.</p>

<p>But what if when creating one, it clashes with one already created? I know that the probability of this is <strong>staggeringly low</strong>, but there is a probability, it is not <strong>impossible</strong>.</p>

<p>What would happen in this case?</p>

CC BY-SA 3.0
2013-10-11T12:29:28.533Z
related question: [Is each bitcoin address unique?](http://bitcoin.stackexchange.com/questions/8804/is-each-bitcoin-address-unique)
Murch
<address><algorithms>
What if I create a new address and I'm given one which clashes (already exists, it is being used by other user)
knocte
# What if I create a new address and I'm given one which clashes (already exists, it is being used by other user)

(Asked by: username_0 on 2013-04-13)

Addresses are like GUIDs, no? They are created randomly whenever you request the creation of a new address.

But what if when creating one, it clashes with one already created? I know that the probability of this is **staggeringly low**, but there is a probability, it is not **impossible**.

What would happen in this case?

**Tags:** address, algorithms

> **Comments:**
> **username_1**: related question: [Is each bitcoin address unique?](http://bitcoin.stackexchange.com/questions/8804/is-each-bitcoin-address-unique)  

---

## 4 answers

### Answer by username_2 on 2013-04-13. Score: 4

A bitcoin address is a 20-byte hash of a 64-byte public key (plus an ID and checksum to bring it up to 25 bytes). As such, there are two theoretical possibilities with a clash:

* Two separate people own public keys which hash to the same value
* Two separate people own the same public key

Due to the way that Bitcoin transactions work, either of these situations would be enough for one party to spend the funds attached to the address.

So it's worth considering the likelihood of such a scenario. Let's assume we have 7 billion people on the planet and they all use Bitcoin. For there to be a 0.00000000001% chance of just two of the total in-use addresses clashing somewhere each person would need to have 4 trillion active addresses.

(Note that this is just calculating the chance of a hash collision; the chance of hitting the same keypair is so much more remote it's not worth bothering with).

> **Comments:**
> **username_0**: if every person in the planet ends up using bitcoin, and each person has 10 wallets, would it still be so low?  
> **username_0**: Going back to the same question again, are you sure that by obtaining the same address, you would obtain the same private key? I think an address is a hash, and by having the hash you cannot obtain the private key, but you do in the other way around. So many private keys would resolve to the same hash.  
> **username_0**: Sorry but I never asked about a duplicate key but about a duplicate address. Can you remove any parts of your reply that cover the "duplicate key" topic?  
> **username_2**: Okay removed the various comments on the answer and just put it all directly in to the answer itself.  
> **username_3**: Could you explain how you got that probability?  
> **username_2**: @username_3 It's from the birthday paradox with a search space of 2^160 (the number of bits in the hash).  The actual math can be found on Wikipedia's Birthday Attack page.  

---

### Answer by username_4 on 2013-04-14. Score: 2

Coins sent to the shared address would appear in both wallets, but would then disappear from both of them when one of the persons spends them. As the network acknowledges and confirms that the coins have left that address, the wallet of the second person would be notified of this and decrease its value accordingly.

This would only affect coins sent to that specific address; the other coins in the two wallets would remain unrelated.


---

### Answer by username_5 on 2013-04-13. Score: 0

The first address would be able to spend bitcoins belonging to the second, and vice-versa.


---

### Answer by username_6 on 2013-04-13. Score: 0

The chances are suuuppppeeeer low, even when every person would have 1.000.000 wallets it would be super low.

And last but not least Bitcoin supports also the OP\_HASH256 so if necessary the address range could be easily expanded to an even higher number. So do not worry ;-)

> **Comments:**
> **username_5**: While this is true, it doesn't answer the question that username_0 posed.  

---

