0

I have been struggling with this quite a bit. From what I understand is that a miner generates nonces to find a nonce that is smaller than the target hash. However, how does one determine the size of that nonce/hash? Does every digit has a different size or how should I interpret this?

2

From what I understand is that a miner generates nonces to find a nonce that is smaller than the target hash.

No a miner repeatedly assembles data and chooses a value for one datum called a nonce, then calculates the hash of this data (including the nonce). The miner repeats this until the calculated hash, not the nonce, is smaller than the target value.

However, how does one determine the size of that nonce/hash?

The hash is a number. You can compare numbers numerically to see which is larger. For example, 52 is smaller than 57. The original code was

if (hash <= hashTarget)

See How does solving a block work in relation to the first letter/number after the 0's?

2
  • Okay, so the nonce is hashed into the final hash? So for instance, the hash of block 708493 is 00000000000000000004c8d2e38f9e9dc89c16948a05db243207745e86619e8e which has the nonce of 2,905,666,658. blockchain.com/btc/block/…
    – lodeboon
    Nov 6 '21 at 15:20
  • @lodeboon the block header is the part of the block that is hashed, and the nonce is part of the block header. The value of the nonce doesn't matter in regards to the hash target though, only the value of the hash (the output) does.
    – chytrik
    Nov 6 '21 at 21:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.