Just as most distributed computing systems, the participants of a cryptocurrency network need to regularly agree on the current state of the blockchain, and that is what we call consensus achievement. However, reaching consensus on distributed networks, in a safe and efficient way, is far from being an easy task.
So, how can a distributed network of computer nodes agree on a decision, if some of the nodes are likely to fail or to act dishonestly? This is the fundamental question of the so-called Byzantine Generalsโ problem, which gave birth to the concept of Byzantine fault tolerance.
What is the Byzantine Generalsโ Problem?
The dilemma assumes that each general has its own army and that each group is situated in different locations around the city they intend to attack. The generals need to agree on either attacking or retreating. It does not matter whether they attack or retreat, as long as all generals reach consensus, i.e., agree on a common decision in order to execute it in coordination.
Therefore, we may consider the following requirements:
- Each general has to decide: attack or retreat (yes or no);
- After the decision is made, it cannot be changed;
- All generals have to agree on the same decision and execute it in a synchronized manner.
The aforementioned communication problems are related to the fact that one general is only able to communicate with another through messages, which are forwarded by a courier. Consequently, the central challenge of the Byzantine Generalsโ Problem is that the messages can get somehow delayed, destroyed or lost.
In addition, even if a message is successfully delivered, one or more generals may choose (for whatever reason) to act maliciously and send a fraudulent message to confuse the other generals, leading to a total failure.
If we apply the dilemma to the context of blockchains, each general represents a network node, and the nodes need to reach consensus on the current state of the system. Putting in another way, the majority of participants within a distributed network have to agree and execute the same action in order to avoid complete failure.
Byzantine Fault Tolerance (BFT)
In a few words, Byzantine fault tolerance (BFT) is the property of a system that is able to resist the class of failures derived from the Byzantine Generalsโ Problem. This means that a BFT system is able to continue operating even if some of the nodes fail or act maliciously.ย
There is more than one possible solution to the Byzantine Generalsโ Problem and, therefore, multiple ways of building a BFT system. Likewise, there are different approaches for a blockchain to achieve Byzantine fault tolerance and this leads us to the so-called consensus algorithms.
Blockchain consensus algorithms
While the Bitcoin protocol prescribes the primary rules of the system, the PoW consensus algorithm is what defines how these rules will be followed in order to reach consensus (for instance, during the verification and validation of transactions).
Final thoughts
The Byzantine Generalsโ Problem is an intriguing dilemma that eventually gave rise to the BFT systems, which are being extensively applied in various scenarios. Beyond the blockchain industry, a few use cases of BFT systems include the aviation, space, and nuclear power industries.
Within the cryptocurrency context, having an efficient network communication along with a good consensus mechanism is vital to any blockchain ecosystem. Securing these systems is an ongoing effort, and the existing consensus algorithms are yet to overcome a few limitations (such as scalability). Nonetheless, PoW and PoS are very interesting approaches as BFT systems, and the potential applications are certainly inspiring widespread innovation.