Post
Topic
Board Development & Technical Discussion
Re: probability that 2 clients generate the same public key?
by
realnowhereman
on 22/02/2012, 12:54:52 UTC
This is just quickly banged out, so please forgive me if I've made a mistake...

Assume there are N different bitcoin addresses possible (2^160).

Assume there are M different bitcoin addresses generated.

What M is needed before the probability of a collision is greater than 50%?

Number of different pairs in a pool of M: nCr(M,2) or (M)(M-1)/2

Pick one member at random.  The chance that a second randomly chosen member matches it is 1/N.

Probability that any of the possible pairs match from a pool of M is therefore:

  p = 1/N*nCr(M,2)

or

  p = M(M-1)/2N

Our target p is 0.5; so we are solving the quadratic:

  0 = M^2 - M - N

Schoolboy maths will solve it; but I'm too lazy...

http://www.wolframalpha.com/input/?i=solve+x^2-x-2^160

approx 1.20893 x 10^24

That's 184.18 x 10^12 addresses per person or 77 thousand addresses generated every second of every person on the planet's life (assuming a 75 year life expectancy)

Shall we stop worrying about this problem now?


Edit: Correct my bad 2^256 to 2^160.  Thanks to Pieter Wuille below.