pull down to refresh
3 sats \ 0 replies \ @nullcount 8 Jul 2022 \ on: ʙᴛᴄ ʙʟᴏᴄᴋ ᴘᴜᴢᴢʟᴇ Qᴜᴇꜱᴛɪᴏɴ bitcoin
It's definitely NOT a centralized process.
TL;DR There are many nonces that could result in a valid block, but there are far more nonces that won't. A miner just has to be the first one to find a nonce that works for the current block. Nodes influence the size of the set of valid nonces by adjusting the difficulty. Nodes can agree on a difficulty based on their own observations of block frequency following the consensus rule: "target 10 minute block time every 2016 blocks"
Explained:
Nodes validate blocks. Nodes are in consensus about what the minimum difficulty level of a block should be. That's because every node is trying to target an average block time of 10 minutes.
Nodes can influence how quickly blocks are mined (on average) by raising or lowering the difficulty.
After a node validates 2016 blocks, it calculates the average time it took to mine a block over that 2016 block period.
It sets a new difficulty target for the next 2016 blocks and it will only validate a block if the block hash is LOWER than the new difficulty threshold.
What does it mean for a hash to be lower than the difficulty threshold?
What follows is an oversimplification:
Miners are trying to guess a magic number called a nonce.
The nonce is essentially "added" to the block header (which is another number unique to every block and is calculated by adding all the transactions inside that block).
X = nonce + block_header
Then, this new total is hashed.
result = hash(X)
A hash is a one-way function. It means the result of a hash cannot be done in reverse. Usually, in math, functions can be undone (like how subtraction undoes addition). You also can't predict what the hash of a number will be without actually doing the hash (proof of work).
If the result of this hash is a number that happens to be less than the difficulty target, then it's a valid block and the miner can submit it to the network while claiming the fees and subsidy.