I am having trouble understanding something related to calculating difficulty.
Target difficulty is described as 2^256 / difficulty .
The difficulty of the genesis block is notated as 0x0400 which is equal to 1024.
So if we take 2^256 (115792089237316195423570985008687907853269984665640564039457584007913129639936)
and divide by 1024 we get : 113078212145816597093331040047546785012958969400039613319782796882727665664
Then we have the block hash for the Ethereum genesis block: 0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3
If you convert this hexadecimal into decimal value it is: 96295644508963302359223866841007920022480890644992946816264522587871600414627
Immediately without a calculation you can tell that the value of the hash is greater than the value of the target difficulty. However the documents clearly state:
If the output of this algorithm is below the desired target, then the nonce is valid
So since we have an output value that is higher than the target, how is the hash on the genesis Ethereum block valid? Can someone please help me understand where I am going wrong here?
0x0400exactly ? – hroussille May 04 '22 at 07:1617,179,869,184which is0x400000000in Hexadecimal. – hroussille May 04 '22 at 07:40crypto.Keccak256(append(seed, digest...))where seed iskeccak512(blockHash, blockNonce)and digest is the mixHash. – hroussille May 04 '22 at 10:57