Making blocks immutable
The reason why so much effort is put into ensuring consensus is that after a block is added to the blockchain, it never changes. Well, that’s the goal. Technically, it is possible to change blockchain data, but it is very, very hard to do and very easy for anyone to detect the change. Using POW consensus protocol, the level of effort alone makes changing blocks pretty close to impossible.
Let’s understand why.
So, Before you add a block to the blockchain, you must calculate a cryptographic hash of the previous block. That is the link to the previous block and the guarantee that it will never change. When you calculate the hash value of the previous block, that block’s header (which is part of the data used to calculate the hash value) includes the hash of its predecessor block. So if anyone ever changes any block, all blocks in the blockchain after that one are invalid. They’re invalid because the hash values for all subsequent blocks don’t match up.
It is easy to validate a blockchain. All you have to do is step through the blockchain, block by block, and make sure that the hash value stored in each block is the correct hash of the previous block header. As long as all the hashes match, the blockchain is valid. That’s why blockchains are called immutable. You can change blockchain data, but doing so immediately invalidates that copy of the blockchain.