How Bitcoin handles addresses collisions?

0

Since the addresses are hashes of a public portion of a public/private ECDSA keypair, what would happen to two different people with different keys that hashes into the same address? How would transactions to those addresses be handled?

Marco

Posted 2016-04-03T23:52:48.760

Reputation: 137

related: Is each Bitcoin address unique?

Murch 2016-04-04T07:48:45.750

Answers

0

In elliptic curve cryptography, public keys are derived from private keys, with seemingly random distribution. You are correct that two different private keys could produce two different public keys that just so happen to hash to the same Bitcoin address.

A SCRIPT_SIG of the transaction that spends from that address would need to provide:

  1. A public key that hashes to that address
  2. A signature of the transaction produced from a private key that matches the given public key

Since two different key pairs could both meet this criteria, either one of them could spend the bitcoins.

However, this is very unlikely. So much so, that it's not even worth considering as a possibility. The best metaphor I've seen on why this isn't an issue is explained in this video: https://www.youtube.com/watch?v=ZloHVKk7DHk

Jestin

Posted 2016-04-03T23:52:48.760

Reputation: 8 339

2

Both people would have access to any funds in the address. Whoever is first to spend these funds wins.

Of course, it is extremely unlikely that there will be such a collision.

Meni Rosenfeld

Posted 2016-04-03T23:52:48.760

Reputation: 18 542

1

As @Meni answered, both people would have access to the funds.

To illustrate how unlikely this is to ever happen, consider the following simple attack:

while True:
    genereate new keys and address
    if address has funds:
        transfer to ME

This attack can scan through an astronomical number of addresses each day. And it is so simple, anyone can carry it out and get rich! Except that it doesn't work. If it did, the bitcoin network would quickly collapse.

The reason it doesn't work is that the address space is so big, it is extremely unlikely for a collision to ever happen purely by chance (bugs in random generators are a different story...).

shx2

Posted 2016-04-03T23:52:48.760

Reputation: 633

1

There is a nice paper on the topic that explains how unlikely it is to perform such an attack and get a profit http://diyhpl.us/~bryan/papers2/bitcoin/bitcoin-birthday.pdf

galileopy 2016-04-04T17:26:21.810