Blockchain mining and forking
When a miner mines a block, what does the miner actually do? What the miner does is take the hash Merkle root of the current block and then append a nonce which they guess by starting the increment from zero. They will hash this concatenated data to get a new hash and compare this result with the target. If this new hash is less than the target, which is basically a 256-bit number specified by bitcoin protocol, then they are done solving the puzzle and get the mining reward. However, if the new hash value is higher than the target value, they have to increase the nonce; that is, increase the nonce from zero to one, and append this one with the hash of the Merkle root, take the hash again to get another completely ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access