What is the Byzantine generals' problem in blockchain?

The decentralized blockchain network is tasked with reconciling and verifying transactions. It is the responsibility of peer-to-peer participants, i.e., nodes that work by consensus, usually proof-of-stake or proof-of-work. What happens if a node does not work properly, crashes, or has bad intentions? From this text, you will learn about the Byzantine generals' problem and what action should be taken to reduce the so-called Byzantine fault tolerance.

The theorem of Byzantine generals

Imagine three divisions of the army deployed in different parts of the map, whose task is to storm a city. Whether they want to retreat or attack is irrelevant to this hypothetical situation. The goal is to reach a consensus on the decision to be made. With only goons to deliver the message, the joint decision must be made in a definitive and synchronized manner. If the message does not reach all the generals or one of them decides to act maliciously, then the whole operation will fail. 

Discover Byzantine fault tolerance

Whether a network can work properly, even in a high-risk environment, when some of the servers are not working properly, it is called Byzantine fault tolerance (BFT). Blockchains use different approaches (consensus algorithms) to increase their BFT. The most important assumption in the context of BFT is that the system does not suspect anyone's desire to falsify transactions in advance - the goal is to prevent this through consensus. 

Proof-of-stake

Proof-of-stake (PoS) is a consensus algorithm that selects nodes to validate transactions and create new blocks based on the amount of cryptocurrency held. The validator's random selection process follows, where the factors taken into account are the size of the deposit and how long it has been held in the staking wallet. Once selected, the validator creates a new block, which other PoS participants in the network check. They confirm whether the deposit was used in the correct way - to create only one block. In the case of double use, the staker is excluded from the validation process and loses part of the deposit. Such networks as Ethereum (after Merge on September 15, 2022), Cardano, BNB, Solana, Polkadot, Avalanche, and Algorand use the proof-of-stake algorithm.

Proof-of-work

Proof-of-Work (PoW) is a consensus algorithm that uses the computing power of network participants' devices called miners. They solve mathematical puzzles involving finding a hash that has a certain format. To do this, they try different combinations of numbers until they find a string that has the right hash. This process uses a lot of electricity. Whether the solution is easy to verify - just send the data back to the function and see if it matches. Then the new block is added to the blockchain. Networks that use the proof-of-work algorithm are, e.g., Bitcoin, Litecoin, Bitcoin Cash, Zcash, or Monero. 

Summary

Consensus algorithms solve the problem of Byzantine generals. Still, they are not without drawbacks, e.g., energy inefficiencies or the problem of network centralization when validation is concentrated on a small group causing significant obstacles to network scalability, i.e., the ability to respond to higher demand. Newer and more creative consensus algorithms are being developed to address this problem. Examples include DPoS (Delegated Proof of Stake), PBFT (Practical Byzantine Fault Tolerance), or PoET (Proof of Elapsed Time). We need to remember that blockchain is a relatively young technology, so keep in mind that some limitations may exist. However, this does not change the fact that with the advantages of this network, its disadvantages seem just a small drop in the ocean of possibilities that decentralization provides us with.

latest from blockydevs' blog