Nonce and Mixhash – Why both values are needed in a blockchain block

blockchainmining

Looking over the sample genesis blocks, I notice that both nonce and mixhash values can be assigned independent values. Reading the yellow paper it's mentioned that:

  • mixhash: is a 256 – bit hash which proves combined with the nonce that a sufficient amount of computation has been carried out on this block
  • nonce: is a 64 – bit hash which proves combined with the mix-hash hat a sufficient amount of computation has been carried out on this block

meaning that these values together with the difficulty are used in mining. But why are they both used?

Best Answer

mixhash is actually calculated from nonce as intermediate value when validating PoW with Hashimoto algorithm. But this calculation is still pretty heavy and a node might be DDoSed by blocks with incorrect nonces. mixhash is included into block to perform lightweight PoW 'pre-validation' to avoid such attack, as generating a correct mixhash still requires at least some work for attacker

Related Topic