The longest chain rule

Consensus algorithms are intended to ensure that the entire blockchain network agrees on the current state of the distributed ledger. This doesn't always work

The longest chain rule states that the longer of two divergent blockchains should be accepted. An attacker can take advantage of this rule

Example

Imagine you and your friends are playing a game of building a tower using blocks. Each time someone adds a block to the tower, it becomes taller. Now, let's say there are two versions of the tower, one built by the majority of players and another built by a smaller group. According to the longest chain rule, the tower with the most blocks should be considered the official version. This is because the longer tower is theoretically supported by the majority of players.

However, it's important to note that in practice, an attacker could create a longer tower to rewrite the history of the game. This is why attacks against consensus algorithms often focus on taking advantage of the longest chain rule to replace the current version of the blockchain with an attacker-controlled one.

Last updated