You have to keep iterating changes, then hashing with SHA256, to keep trying to find a hash under the current target.
A few of these levers are to include/exclude a transaction, reorder transactions, or iterate the nonce.
All hash attempts are equiprobable in finding a valid block, irrespective of which levers you're pulling.
Login to reply
Replies (2)
Thanks. Yeah, that’s where my brain was going, why introduce more variables like change in tx or tx order, if you can keep these fixed and just iterate on nonce.
But I have no idea how this works, so with every comment I’m learning something new.
Might help you grok this if you mess around with a SHA256 calculator, like
Paste in the first paragraph (the description under the calculator, starting with "The SHA") and it'll give you a hash that starts with ae8b.
If I told you to make changes to that paragraph until you generate a hash that starts with 0, you should hit that target once every 16 modifications on average, regardless of if you start adding letters to the beginning, subtracting from the middle, or changing punctuation at the end.
Instead of that paragraph, hashers are using block templates and nonces as inputs. Both can change every time, or just one can change, and the odds of finding a hash below the target isn't affected by which one is changing (or if it's one or both).
SHA-256 hash calculator | Xorbin
SHA-256 algorithm calculator