# what are the chances of vanitygen address - private key pair collision?

With no random number seed specified, assuming all vanitygen runs start with specific chunk for iteration, what are the possibilities of two different vanitygen runs to end up with the same address - private key pair?

Samr's vanitygen gets its initial private key from OpenSSL's random functions, which have been well vetted. Even if you specify a random seed (which is a good idea to add even more randomness) the entropy generation random libraries from the crypto is still used. It has equal randomness and strength as Bitcoin's address/key generator, with the exception that you are discarding millions of addresses that don't start with your vanity phrase.

If two or more people choose the same, non-random seed while looking for vanity address with the same pattern, they will end up with the same private key. This would happen due to them either iterating to the same private key from the seed, or by ending up with the same private key by using the given language's version of rand() function with identical seeds.

However, if one was to chose a random seed, here are the probabilities of accidentally ending up with the same keypair / address:

To obtain the same address, the result of RIPEMD-160 hashing would need to be the same. Probability of that happening is 1 in 2^160.

To obtain the same private key, it is a probability of 1 in n, where n is the order of secp256k1 and equal to FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141, or about 2^256.

• you didn't get the question, I think. vanitygen tool starts random process of finding a key that matches the given pattern. assuming this search always starts from a known specific chunk (with no random number seed), then it is quiet possible that two different runs to end up with the same pair. right? Feb 15, 2013 at 8:06
• @vi.su. edited accordingly Feb 15, 2013 at 9:11
• not true. tried to generate smaller pattern with the same random number seed, and both the runs generated different results. may be there is something like, time seed (current millisecond), but when I checked the code couldn't found anything related. Feb 15, 2013 at 10:14
• @vi.su. It may be the case that the vanity address generator uses cryptographically secure random numbers, meaning that you can't really arrive to the same random number with it. It might take things like random temperature reading and what have you that would be impossible to reproduce. Feb 15, 2013 at 12:24

In simple terms, if you were testing against 500k patterns at 25/Mkey a second, it'd take about 25 quadrillion years to get a few collisions. Factoring out the randomness of course, as the nature of randomness entails that it could take 2 seconds or 2 sextillion years.

Even if you put all the calculating power of the entire bitcoin network on it, it would still take 10^12+ years.

• what if a quantum computer was able to do 999/Mkey's a second? May 12, 2015 at 20:05