With a few exceptions, blockchains are intentionally designed to be decentralized, functioning as a digital ledger maintained by a distributed network of computer nodes. For this reason, blockchain technology has made it possible to create credible economic systems in which it was possible to carry out transparent and reliable financial transactions without the need for intermediaries. Cryptocurrencies are being accepted as a viable alternative to traditional bank payment systems, which are heavily dependent on trust.
Like a majority of distributed computing systems, cryptocurrency network participants must regularly agree on the current state of the blockchain, in other words, they have to reach a consensus. However, reaching a consensus on distributed networks in a way that is both secure and efficient is far from easy.
So how can a distributed network of computer nodes agree on a decision if there is a certain probability that some of the nodes will fail or act dishonestly? This is a fundamental question of the problem of the so-called Byzantine generals, which gave birth to the concept of Byzantine fault tolerance.
What is the Byzantine generals’ problem?
In short, the problem of Byzantine generals was conceived in 1982 as a logical dilemma that illustrates how a group of Byzantine generals may face communication problems as they try to agree on their way forward.
The dilemma assumes that each general has his own army with each of them being located in a different location in the vicinity of the city they intend to attack. The generals must agree on either an attack or a retreat. It does not matter if they attack or retreat unless all the generals reach a consensus on what to do next.
Therefore, we can consider the following requirements:
The above-mentioned communication problems are related to the fact that each general is able to communicate with the other only via messages forwarded by the courier. Therefore, the central challenge to the problem of Byzantine generals is that messages may be delayed, destroyed, or lost in some way.
In addition, even if a message is successfully delivered, one or more generals may choose (for whatever reason) to act in a malicious manner and send a fraudulent message to confuse the other generals, leading them all to complete failure.
The only way to reach a consensus on these types of distributed systems is to have at least ? of reliable and honest network nodes. This means that once the majority of the network decides to act maliciously, the system is prone to failures and attacks (for example, 51% attack).
Byzantine fault tolerance (BFT)
Simply put, Byzantine fault tolerance is a feature of the system that is able to withstand the failures not dissimilar to the problem of Byzantine generals. This means that the BFT system is able to continue to operate even if some of the nodes fail or act maliciously.
There is more than one possible solution to the problem of Byzantine generals and thus more ways to build a BFT system. Likewise, there are different approaches to blockchain to achieve Byzantine error tolerance, which leads us to so-called consensus algorithms.
Blockchain consensus algorithms
The consensus algorithm can be defined as the mechanism by which a blockchain network reaches consensus. The most common implementations are Proof of Work (PoW) and Proof of Stake (PoS). Take Bitcoin as an example.
While the Bitcoin protocol prescribes the primary rules of the system, the PoW consensus algorithm is what defines how these rules will be followed to reach a consensus (for example, when verifying transactions).
Although the concept of Proof of Work is older than cryptocurrencies, Satoshi Nakamoto developed a modified version of it as an algorithm that allowed the creation of Bitcoins as a BFT system.
Sources: academy.binance.com, medium.com