What if I create a new address and I'm given one which clashes (already exists, it is being used by other user)

4

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?

knocte

Posted 2013-04-13T19:25:11.947

Reputation: 1 531

related question: Is each bitcoin address unique?

Murch 2013-10-11T12:29:28.533

Answers

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

jgm

Posted 2013-04-13T19:25:11.947

Reputation: 1 487

if every person in the planet ends up using bitcoin, and each person has 10 wallets, would it still be so low?knocte 2013-04-13T21:13:19.297

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 2013-04-14T16:13:34.617

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 2013-04-14T16:28:17.153

Okay removed the various comments on the answer and just put it all directly in to the answer itself.jgm 2013-04-14T17:36:50.123

2Could you explain how you got that probability?Jeremy Banks 2013-04-14T18:27:24.240

@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 2013-04-14T19:10:31.477

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.

Massimo

Posted 2013-04-13T19:25:11.947

Reputation: 978

0

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

Nick ODell

Posted 2013-04-13T19:25:11.947

Reputation: 26 536

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

NJFreeman

Posted 2013-04-13T19:25:11.947

Reputation: 1

1While this is true, it doesn't answer the question that knocte posed.Nick ODell 2013-04-13T23:01:36.320