I'm assuming difficulty has a "target" of 10 minutes because the coefficient satoshi chose becomes multiplied by a variable to help the network remain in proportion. IE, if the network hashrate is 2x the previous network hashrate, bnProofOfWorkLimit
is multiplied by the previous difficulty and also by 2, which is the measurement of how much faster the network is producing hashes.
This is pretty simple to understand. However, I've been wondering about how the original difficulty was chosen so that the target is 10 minutes.
- Is it based on some hard physical limit of computing?
I've come across this code in chainparams.h
on line 113
:
bnProofOfWorkLimit = CBigNum(~uint256(0) >> 32);
- What does
~uint256(0)
mean in C++? I know that~uint256(0) >> 32
means1 / 2^24
in human-readable terms. - Why is the
~uint256(0)
function used instead of simply256
? - Why was this chosen to be expressed as
256 >> 32
rather than1 >> 24
? Is there a good reason for this?
Any direction to learn more about this would be appreciated as well.
Note: I am not asking why the amount of time chosen was equal to 10 minutes, I am asking how the number 1 / 2^24
was arrived at to estimate 10 minutes in terms of how long it takes to calculate a sha256 digest.