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?
Asked
Active
Viewed 80 times
1 Answers
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?

RedGrittyBrick
- 26,841
- 3
- 25
- 51
https://www.blockchain.com/btc/block/00000000000000000004c8d2e38f9e9dc89c16948a05db243207745e86619e8e
– lodeboon Nov 06 '21 at 15:20