Hi, Where does the 2^32 come from?
The nonce for the block "candidate" is a 32bit integer, meaning it can be anything from 0 to 2^32. While mining, you'll iterate through every single possibility before beginning on a new block "candidate".
Incorrect.
The
maximum target* is 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, which has 8 zeros at 4 bits each (each hexadecimal digit has pow(2,4) = 2^4 = 16 possibilities: 0 - 9, A, B, C, D, E, and F). 8 x 4 = 32 bits.
The probability of finding a hash which is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF divided by 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 1/pow(2,32) = 1 / (2^32). Since
the difficulty is the maximum target divided by current target, each hash calculated has 1 / (2^32) probability of being the block solution when the difficulty is 1.
This choice of the maximum target for Bitcoin just so happens to match the number of possible values for the block nonce.
* Note the maximum target is rounded down to 0x00000000FFFF0000000000000000000000000000000000000000000000000000, so all the math presented in this thread is only an approximation.