1

Because the Nonce is uint64 in the Golang code. the code is here:

    // Compute the PoW value of this nonce
        digest, result := hashimotoFull(dataset.dataset, hash, nonce)
        if new(big.Int).SetBytes(result).Cmp(target) <= 0 {
            // Correct nonce found, create a new header with it
            header = types.CopyHeader(header)
            header.Nonce = types.EncodeNonce(nonce)
            header.MixDigest = common.BytesToHash(digest)

            // Seal and return a block (if still needed)
            select {
            case found <- block.WithSeal(header):
                logger.Trace("Ethash nonce found and reported", "attempts", nonce-seed, "nonce", nonce)
            case <-abort:
                logger.Trace("Ethash nonce found but discarded", "attempts", nonce-seed, "nonce", nonce)
            }
            break search
        }
        nonce++

and the target is 0~2^256, the nonce is 0~2^64. so, Is there the possibility that the target is out of the nonce's range, such as only when the nonce is in 2^64~2^256, the target will be satisfied: new(big.Int).SetBytes(result).Cmp(target) <= 0

  • PS. the hashimoto function in the code above is: func hashimoto(hash []byte, nonce uint64, size uint64, lookup func(index uint32) []uint32) ([]byte, []byte) {}. so, as we see, the nonce is uint64 – zxxhere Apr 10 at 8:12
  • well, i think Keccak256 function averagely put the input value into the output value space. so there is no possibility that the 2^64 nonces make the hashimotoFull results all continuous value. – zxxhere Apr 10 at 11:01
  • In PoW the target is dynamically modified such that a solution is found in 15 seconds average. But it should possible to find an arbitrary target that has no solution. – Ismael Apr 10 at 16:19
  • fine, but that means someday in a bad luck, the ETH meets the case which makes all the nonce solutions not to satisfy the target even though the solution is set to be found in 15 seconds average – zxxhere Apr 11 at 4:25
  • I think the event that all miners will not find a solution is very very unlikely. One characteristic of ethereum is that the longer it takes to make a new block it gets easier to find a nonce. – Ismael Apr 11 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.