2
In the Litecoin source it is written:
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 20); // Litecoin: starting difficulty is 1 / 2^12
How does that compute? ~uint256(0) >> 20 is 0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff. Hashes have an equal probability of being any given number, so the chance of getting a valid Litecoin hash (i.e. one that is smaller than this number) is 0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff / 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff = 1 / 2^20, not 1 / 2^12. Is this a typo in the Litecoin source code or am I misunderstanding something?
1A good way to remember it is that a difficulty of 1 means an average of
2^32hashes are needed to mine one block, and it scales linearly from there. This convention comes from Bitcoin where the minimum difficulty is in fact 1. – Nate Eldredge – 2014-05-05T18:57:05.377Hi. At recent source, there is no CBigNum, what it have been changed? – creator – 2018-02-24T10:09:51.203