Since the creation of Bitcoin in 2008, as a peer-to-peer (peer-to-peer) electronic money system, several other cryptocurrencies have been created, each with a particular mechanism. But something that almost all of them have in common is a Blockchain network as a central element of their architecture.

With some exceptions, Blockchain networks are intentionally designed to be decentralized, functioning as a digital ledger that is maintained by a distributed network of nodes represented by computers. For this reason, Blockchain technology has allowed the creation of an economic system where financial transactions are transparent and reliable without the need for intermediaries. Cryptocurrencies are gaining more and more space by presenting themselves as an alternative to the traditional banking system, which is very dependent on trust placed in third parties.

In most distributed computer systems, participants in a cryptocurrency network need to regularly agree on the current state of their Blockchains, and this is what we call reaching consensus. However, reaching consensus in distributed networks, in a secure and reliable way, is far from being an easy task.

Therefore, how can a distributed network of computers reach a decision if some nodes are doomed to act faulty or dishonestly? This is a fundamental question of the well-known problem of Byzantine Generals, which gave rise to the concept of Byzantine Fault Tolerance (BFT) - or Byzantine Fault Tolerance in Portuguese.

 

What is the problem with Byzantine generals?

Briefly, it was conceived in 1982 as a logic dilemma that illustrated how a group of Byzantine generals could have communication difficulties in trying to reach an agreement on the next war move.

The dilemma assumes that each general has his own army and that each group is situated in different locations around the city they wish to attack. Generals need to agree on when to attack or retreat. It doesn't matter if they are attacking or retreating, it is necessary for all of them to agree, for example, to reach consensus on the execution of tactics together.

 

Therefore, we must consider the following objectives:

  • Each general needs to decide: attack or retreat (yes or no);

  • Once you have made the decision, it cannot be changed;

  • All generals need to agree on the same tactic and execute it synchronously.

 

The communication problems already mentioned are related to the fact that one general can only communicate with another through messages, which are delivered by mail. Consequently, the central challenge of the Byzantine General’s Problem is that messages can somehow be delayed, destroyed or lost.

Furthermore, even if a message is successfully delivered, one or more generals may choose (for whatever reason) to act maliciously or send a fraudulent message to confuse other generals, leading to a total disaster.

If we apply this dilemma to the context of Blockchain networks, each general represents a node in the network and the nodes need to reach a consensus when it comes to the current state of the system. Put another way, the majority of participants within a distributed network need to agree on the same process to avoid widespread failure.

However, the only way to achieve consensus in these types of distributed systems is to have at least ⅔ or more nodes on the network that are trustworthy and honest. This means that if the majority of the network decides to act maliciously, the system will be susceptible to failures and attacks (such as the 51% Attack).

 

Byzantine Fault Tolerance

In a nutshell, BFT is the property that a system has to resist various types of failures that can be caused by the Byzantine generals' dilemma. This means that a BFT system is capable of continuing to operate even if some nodes in the network behave in a faulty or malicious manner.

There are several ways to solve the Byzantine generals problem and, therefore, several methods of building a BFT system. Similarly, many approaches can be explored so that a Blockchain system can make BFT work correctly, leading us to the much-desired consensus algorithm.

 

Blockchain Consensus Algorithm

We can define the consensus algorithm as a mechanism by which each Blockchain network reaches an agreement on its state. The best-known implementations are Proof of Work(PoW) and Proof of Stake(PoS). But let's use the case of Bitcoin as an example.

While the Bitcoin protocol prescribes the primary rules of the system, the PoW consensus algorithm defines how these rules will be followed in an attempt to reach consensus (for example, during verification and validation of transactions).

Although the concept of PoW is very old in cryptocurrencies, Satoshi Nakamoto developed a modified version that made it possible to create Bitcoin as a BFT system.

Note that the PoW algorithm is not 100% tolerant to Byzantine faults, but given the intensive cost of the mining process and the underlying cryptographic techniques, PoW has already proven that it is one of the most secure and reliable implementations for Blockchain networks. In this aspect, the PoW consensus algorithm, developed by Satoshi Nakamoto, is considered by many to be a genius solution for solving the Byzantine problem.

 

Final considerations

The Byzantine problem is an intriguing dilemma that eventually gave rise to BFT systems, which are applied in various scenarios. In addition to the Blockchain world, the BFT system is used in aviation, space and nuclear power plants industries.

In the context of cryptocurrencies, having an efficient communication network along with a good consensus mechanism is vital for any Blockchain ecosystem. Making these systems secure is an ongoing effort and many consensus algorithms in existence have not yet transcended some limitations (such as scalability). However, PoW and PoS algorithms are interesting approaches to functioning as BFT systems, and the possible applications certainly inspire widespread innovation.