You learnt a lot about the immutability of data in blockchain in the previous module. However, as they say, " Revision never hurts " and immutability being a key feature of the blockchain, let's revisit the concept to further cement our understanding.
Immutability means something that is permanent and cannot be changed. In practical terms, it refers to the extreme difficulty that one will face in trying to alter or make changes to the existing data.
To ensure immutability of data in databases, organisations employ various mechanisms ranging from access controls, multiple approvers, reconciliation, audit trails and firewalls. In spite of employing these means, data stored in the database are mutable (i.e not immutable) and can be altered once someone gains access to the data. This is where blockchain technology makes the biggest impact.
As you have learnt earlier, a block header hash is calculated as a double SHA 256 hash of all the block constituents.
Block header hash = SHA256 (SHA256 (previous block hash + Merkle root + timestamp + difficulty target + nonce) ).
For example, if there is a modification in the loan amount inside a transaction, the modification will affect the hash value of the transaction, which then will affect the Merkle root. Since Merkle root is one of the components of the block header, this will cause a ripple effect and the block header hash will also undergo a modification. This would lead to a mismatch with the hash value of the next block since the next block’s hash value is dependent on the current block’s hash value. Thus ultimately disrupting the chain of blocks.
Salting is a process of adding a random string to the original string so as to ensure the original data cannot be re-calculated. Thus it will be very difficult for any hacker to compute the hashes of all the blocks to ensure that the chain is not disrupted and the node remains in a valid state.
In the previous video, you understood how the block structure helps in maintaining the immutability of the chain. Let’s assume that a hacker was able to modify the block data to reflect the modification. In the next video, Shebin explains how the consensus mechanism plays a part in ensuring the immutability of a blockchain through the demonstration of the Practical Byzantine Fault Tolerance (PBFT) mechanism.
Practical Byzantine Fault Tolerance or PBFT is one of the most popular mechanisms in a private blockchain since it is energy efficient and has optimized resource utilization. It is the ability of a distributed network to reach consensus despite the presence of malicious nodes in the system. A basic assumption for implementing this mechanism is that at least 2/3rd of the nodes in the network are honest nodes. Conversely, it can also be said that PBFT requires less than 1/3rd nodes in the network to be faulty or malicious.
It works on the principle of state transformation wherein a random node upon receiving a transaction validates it against its current state. This node is designated as the leader node and propagates this transaction to all peer nodes. Each node responds with a vote or a decision and the collective majority decision of all the nodes is accepted as the final decision of the network. To read further about PBFT, please refer to the link below.
Having seen the role of hash and consensus mechanism in ensuring immutability, let’s take a look at the role of the distributed network in ensuring immutability of the blockchain network.
You can learn more about Anders tool from the link below.
Due to the distributed nature of the nodes, even if the hacker is successful in editing his copy of the blockchain, the moment the blockchain synchronises with the network, it will fail again since the other nodes contain the valid copy of the blockchain with valid data that differs from the edited copy of the blockchain. Thus, you can conclude that hash, consensus mechanism and distributed nature of the nodes ensure that the blockchain remains immutable even in situations with malicious participants.
The immutable nature of the blockchain makes it a robust and tamper-evident solution. However, this becomes a limiting factor since there might be a need to modify some incorrect data in the transaction. Hence, organisations have introduced a technique called as chameleon hash, which allows a participant to allow the modify the base transaction data without affecting the hash of the block. The modified block will contain a scar to indicate the modification of data, without affecting the hash value of the block and the subsequent blockchain. More such evolutions are expected to come up in the future to address similar concerns.