0
No matter how high the difficuly is (or how low the target is), I don't understand how the Bitcoin network takes an average of 10 minutes to solve each block.
For any given block header, there are only 2^32 possible values for the nonce. Even if we take into account that the timestamp can be changed by up to 1 hour (for example), that's 3600 x 2^32 possible combinations, which is approximately 1.5e13
On blockchain.info it says the current hash rate of the network is 7,991,378,504 GH/s, which means that, every second, there are multiple orders of magnitude more hashes being calculated than the number of possible hashes that can result from the current block header.
So howcome blocks aren't solved in only a few seconds, and take about 10 minutes instead?
I understand that miners want to include as many transactions as they can in a block to collect the fees, so one could argue it's best to wait until there are many transaction in a block before solving it. But even that doesn't make sense, because there's absolutely nothing to lose in solving each block as fast as possible anyway.
So the current difficulty is so high that even if a miner computes the hashes for all possible 2^32 nonces, it is still unlikely to find one below the current target. Thus, it needs to keep trying with a different coinbase until one of the 2^32 nounces actually works. Could you please point me to some documentation explaining all about coinbase transactions and new block candidates? I think that's what's missing in my puzzle. – Edward Eisenberg – 2017-09-04T15:13:45.283
@EdwardEisenberg: Basically, miners are free to choose which transactions, or even if any at all, they would like to include in a mined block. Run through all the nonces? No problem, just add or remove a transaction and you've immediately got another few trillion hashes to try. – Greg Hewgill – 2017-09-04T20:29:26.757
1It is not necessary to remove or add transactions. There are some malicious miners which even mine empty blocks (apart from the coinbase), so have nothing to change in that regard. The coinbase transaction can contain arbitrary data and just putting some additional nonce bytes in there is sufficient. – Leonidaz0r – 2017-09-05T10:28:27.587
@EdwardEisenberg https://en.bitcoin.it/wiki/Transaction#Generation
– Leonidaz0r – 2017-09-05T10:30:59.607