Consensus
As we can see, the hashing function makes history tampering hard, but not too hard. Even if we have a blockchain that consists of 1000
blocks, it would be trivial to alter the content of the first block and change the 999
parent hashes on the other blocks with recent computers. So, to ensure that bad people cannot alter history (or at least make it hard), we must distribute this append-only database to everyone who wants to keep it (let’s call them miners). Say there are 10 miners. In this case, you cannot just alter the blockchain in your copy because the other nine miners would scold you, saying something like Hey, our records say history A but your record says B. In this case, the majority wins.
However, consensus is not just a case of choosing which blockchain has been chosen by the majority. The problem starts when we want to add a new block to the blockchain.
Where do we start? How do we do it?
The answer is that we broadcast. When we broadcast the candidate...