Why Blockchain is secure and tamper-proof

Let's make an example. The TestCoin blockchain currently has 12 blocks.

An attacker changes one transaction in block 10 to give himself more TestCoin and transmits his new version of the blockchain to everybody in the world.
However, by changing the transaction, he changes the Merkle Root of block 10, which in turn changes the hash identifier the entire block.

Now, if you recalculate the hash of block 11, it doesn’t coincide with the one it already has. This makes it extremely obvious that block 10 has been tampered with, and everybody rejects this new version of the blockchain.

This is how the blockchain achieves its security: changing even just one transaction inside an already existing block would render all of the blocks afterwards invalid.

Of course, one could ask: “Can’t the attacker just recalculate all of the blocks after the one he changed, and get away with it?”. Indeed he could, but this is where the concepts of proof-of-work and mining come in, which will be explained in the next installment of the series!