<p>A very relevant answer can be found here: <a href="https://bitcoin.stackexchange.com/q/8804/51948">Is Each Bitcoin Address Unique?</a></p>

<p>This is a question of the birthday attack on the hashes. Bitcoin addresses (assuming the "normal" style starting with a 1) encode 160 bit hashes, so the output space has a possible 2^160 hashes. Because its a hash function, we assume all outputs have equal probability of being output.</p>

<p>At the rate you gave in the OP, you would generate 1.971 * 10^11 addresses in 1 year. Using the approximate birthday formula <code>n^2 / 2H</code>, the probability of a collision in 1 year is thus roughly on the order of 10^-26. That is, basically 0. In 20 years that probability becomes around the order of 10^-24. Still basically 0. If all 8 billion people in the world generated addresses at that rate for 20 years, in total 3.1536 * 10^22 addresses would be generated. Even then, the probability of a collision is only around 0.0003. And remember that a collision like this is completely different from a targeted attack to find the private key of a specific address. If there was a collision, chances are overwhelming that there would be no funds ever sent to the address anyway, making the attack useless.</p>

CC BY-SA 4.0
2019-01-19T23:25:21.883Z
"A collision can't be a collision if there were no funds ever sent to the address" in regards to the last sentence of your answer. Other than that, great answer! Thank you!
Anonymous
CC BY-SA 4.0
2019-01-19T23:26:29.293Z
@AnonymousUser You say you're able to generate 90 million addresses per 4 hours. MeshCollider is pointing out that that's actually irrelevant, as there aren't 90 million addresses being _paid_ at that rate.
Pieter Wuille
CC BY-SA 4.0
2019-01-19T23:27:10.187Z
Oh gotcha, you may want to be more clear in that. Thanks again.
Anonymous
CC BY-SA 4.0
2019-01-19T20:39:04.400Z
2019-01-19T20:39:04.400Z
meshcollider
<p>Because of the <a href="https://en.wikipedia.org/wiki/Birthday_problem" rel="noreferrer">Birthday paradox</a>, you only need <em>2<sup>80</sup></em> addresses (despite there existing <em>2<sup>160</sup></em> different address combinations) before a collision becomes probable.</p>

<p>Thankfully, that is still an enormous number. At 90 million addresses per 4 hours, it will take about 445 times the age of the universe to reach that number.</p>

<p>It's also irrelevant. Even if anyone - or everyone - generates 90 million addresses per 4 hours, there aren't that many addresses receiving funds. Thus only actually used addresses matter.</p>

CC BY-SA 4.0
2019-01-19T20:36:56.377Z
Also, in that case the collision would almost certainly be between two addresses you yourself generated... which isn't usually very useful for an attacker.
G. Maxwell
CC BY-SA 4.0
2019-01-20T01:17:32.440Z
@fredsbend, the actual formula for the birthday paradox is complicated, but as the numbers get bigger, taking the square root becomes an increasingly better approximation to it.  When talking about cryptography, the numbers are so huge that the difference isn't worth worrying about.
Mark
CC BY-SA 4.0
2019-01-20T01:17:38.150Z
@fredsbend Technically, the square root of the number of possibilities gives you a 39.3% probability for collisions (1-exp(-1/2)), that's about where you see the probability go from negligable to negligably not. 1/2 sqrt(n) gives you 11.75%. 2 sqrt(n) gives you 86.5%. In cryptography the exact factor is usually ignored, and we just say that you need approximately sqrt(n) elements to see a probable collision.
Pieter Wuille
CC BY-SA 4.0
2022-02-01T08:05:26.037Z
Why 2^80? Where did you get this value? Can somebody explain if this is right? Thanks.
z3nth10n
CC BY-SA 4.0
2022-02-01T13:35:08.580Z
There are 2^160 P2PKH addresses. The birthday paradox says that you'll reach a collision (the same address generated twice) when you hit approximately the square root of the total space; that's 2^80.
Pieter Wuille
CC BY-SA 4.0
2019-01-19T20:28:04.503Z
2019-01-19T23:33:35.610Z
2019-01-19T23:33:35.610Z
Pieter Wuille
<p>I am running a test to see if I can obtain a successful bitcoin address collision after generating billions of addresses. I am not entirely sure how I would check them yet. Basically I have an extra 10TB hard drive and am running supervanitygen on my 32-core, 128gb ram linux work computer. It seems to be generating about 90,000,000 (90 million) addresses (address + private key pair) every 4 hours. </p>

<p>Do you think it's possible or likely to run into an address collision this way? Or perhaps if everyone in the world did the same thing? Or what if I waited 10-20 years, and then checked the addresses?</p>

<p>This is all just a test to see if the bitcoin system is secure enough for big investment decision.</p>

CC BY-SA 4.0
2019-01-20T17:28:03.113Z
Read this, and then do some math. How many addresses do you need to check before you're 1% likely to get a collision? https://ericlippert.com/2010/03/22/socks-birthdays-and-hash-collisions/
Eric Lippert
<security><address-generation><cryptography><vanitygen><key-collision>
Is a bitcoin address collision possible if generating 90 million addresses every 4 hours?
Anonymous
# Is a bitcoin address collision possible if generating 90 million addresses every 4 hours?

(Asked by: username_0 on 2019-01-19)

I am running a test to see if I can obtain a successful bitcoin address collision after generating billions of addresses. I am not entirely sure how I would check them yet. Basically I have an extra 10TB hard drive and am running supervanitygen on my 32-core, 128gb ram linux work computer. It seems to be generating about 90,000,000 (90 million) addresses (address + private key pair) every 4 hours.

Do you think it's possible or likely to run into an address collision this way? Or perhaps if everyone in the world did the same thing? Or what if I waited 10-20 years, and then checked the addresses?

This is all just a test to see if the bitcoin system is secure enough for big investment decision.

**Tags:** security, address-generation, cryptography, vanitygen, key-collision

> **Comments:**
> **username_1**: Read this, and then do some math. How many addresses do you need to check before you're 1% likely to get a collision? https://username_1.com/2010/03/22/socks-birthdays-and-hash-collisions/  

---

## 2 answers

### Answer by username_3 on 2019-01-19. Score: 26 | Accepted answer

Because of the [Birthday paradox](https://en.wikipedia.org/wiki/Birthday_problem), you only need *280* addresses (despite there existing *2160* different address combinations) before a collision becomes probable.

Thankfully, that is still an enormous number. At 90 million addresses per 4 hours, it will take about 445 times the age of the universe to reach that number.

It's also irrelevant. Even if anyone - or everyone - generates 90 million addresses per 4 hours, there aren't that many addresses receiving funds. Thus only actually used addresses matter.

> **Comments:**
> **username_4**: Also, in that case the collision would almost certainly be between two addresses you yourself generated... which isn't usually very useful for an attacker.  
> **username_5**: @fredsbend, the actual formula for the birthday paradox is complicated, but as the numbers get bigger, taking the square root becomes an increasingly better approximation to it.  When talking about cryptography, the numbers are so huge that the difference isn't worth worrying about.  
> **username_3**: @fredsbend Technically, the square root of the number of possibilities gives you a 39.3% probability for collisions (1-exp(-1/2)), that's about where you see the probability go from negligable to negligably not. 1/2 sqrt(n) gives you 11.75%. 2 sqrt(n) gives you 86.5%. In cryptography the exact factor is usually ignored, and we just say that you need approximately sqrt(n) elements to see a probable collision.  
> **username_6**: Why 2^80? Where did you get this value? Can somebody explain if this is right? Thanks.  
> **username_3**: There are 2^160 P2PKH addresses. The birthday paradox says that you'll reach a collision (the same address generated twice) when you hit approximately the square root of the total space; that's 2^80.  

---

### Answer by username_2 on 2019-01-19. Score: 8

A very relevant answer can be found here: [Is Each Bitcoin Address Unique?](https://bitcoin.stackexchange.com/q/8804/51948)

This is a question of the birthday attack on the hashes. Bitcoin addresses (assuming the "normal" style starting with a 1) encode 160 bit hashes, so the output space has a possible 2^160 hashes. Because its a hash function, we assume all outputs have equal probability of being output.

At the rate you gave in the OP, you would generate 1.971 \* 10^11 addresses in 1 year. Using the approximate birthday formula `n^2 / 2H`, the probability of a collision in 1 year is thus roughly on the order of 10^-26. That is, basically 0. In 20 years that probability becomes around the order of 10^-24. Still basically 0. If all 8 billion people in the world generated addresses at that rate for 20 years, in total 3.1536 \* 10^22 addresses would be generated. Even then, the probability of a collision is only around 0.0003. And remember that a collision like this is completely different from a targeted attack to find the private key of a specific address. If there was a collision, chances are overwhelming that there would be no funds ever sent to the address anyway, making the attack useless.

> **Comments:**
> **username_0**: "A collision can't be a collision if there were no funds ever sent to the address" in regards to the last sentence of your answer. Other than that, great answer! Thank you!  
> **username_3**: @AnonymousUser You say you're able to generate 90 million addresses per 4 hours. MeshCollider is pointing out that that's actually irrelevant, as there aren't 90 million addresses being _paid_ at that rate.  
> **username_0**: Oh gotcha, you may want to be more clear in that. Thanks again.  

---

