# Querying UTXOs with random key pairs

As the number of transactions in the bitcoin network grows, the number of addresses with bitcoin will also grow. Is it possible for someone to “scavenge” for bitcoin by generating random key pairs and checking if the derived bitcoin address has any coins ? Is this likely to be profitable at any time in the future? Even if the profitability of this attack is low, it could impact confidence in the bitcoin network, if a few bitcoin were stolen in this manner.

Is it possible for someone to “scavenge” for bitcoin by generating random key pairs and checking if the derived bitcoin address has any coins ?

Yes.

Is this likely to be profitable at any time in the future?

No.

The number of possible addresses is extremely massive, much much too large for the human brain to comprehend.

For starters, there are 2^160 possible P2PKH addresses. Then there are 2^160 possible P2SH addresses. There are also 2^160 possible P2WPKH addresses and 2^256 P2WSH addresses. This means that the current total address space is 3(2^160)+2^256. The probability that you would randomly choose generate an address that has Bitcoin associated with it is so small that it is basically zero.

If we were to assume that 100 billion addresses have Bitcoin associated with them or will be in the future (that's an extremely generous estimate), then the probability that you would be able to find one of those is 8.636 × 10^-67. This probability is so small and so unlikely that it will never be profitable or have any probability of an address collision ever occurring.

• If bitcoin were to equal visas processing rate ( someday) ,it would consume 100 billion addresses in 579 days (100e9/(2000*3600*24) . Assume 1 trillion addresses and 2^96 possible private keys, the number of trials required to encounter any one used address is 2^96/1e12 =7.92e16 trials . The current bitcoin hashrate is 7.3e21 H/s . If that hashrate were diverted to scavenging bitcoin, it would find bitcoin in 1.08e-5 s for 1 trillion addresses and 1.08e-2 s for 1 billion addresses. Do we need to trust that the network will follow the honour code for miners? Nov 10 '17 at 12:10
• Your math is wrong. There are 2^256 possible private keys, not 2^96, where did you get that number? Because of the hash functions used in Bitcoin, the 2^256 is reduced to 2^160 possible addresses. With 2^160 possible P2PKH addresses, it would require 1.46e36 trials, assuming that 1 trillion had Bitcoin. Using your hashrate number, it would actually take 2e14 seconds to find a collision. Lastly, hashrate is not directly convertible to generating addresses. Mining ASICs can only do one thing, sha256d. They cannot be converted to do anything else like searching addresses. Nov 10 '17 at 15:17

The number of BIP39 addresses is close to 2^132. The current utxo set size is close to 60 mill. The number of trials required to encounter any one used address is 2^132/60e6 =9e31 trials. With current hashrate it would find bitcoin in 12.4 trillion seconds ~ 400 years to find non-empty address if the hashrate could be diverted to lookup the utxo set.