Reaching agreement even when some machines lie. The idea behind PBFT and blockchains.
Byzantine Fault Tolerance (BFT) is the ability of a group of machines to agree on one answer even when some of them lie, send conflicting messages, or are controlled by an attacker.
The Byzantine Generals Problem (Lamport, Shostak, Pease, 1982): several generals surround a city. They must all attack or all retreat. Some may be traitors who tell one general "attack" and another "retreat". The loyal generals must still agree on the same plan, and if the commander is loyal, they must follow the commander.
The key result: with 3 generals and 1 traitor it is impossible. A loyal general cannot tell whether the commander or the other lieutenant is lying. With 4 generals and 1 traitor it works, as long as the generals compare what they were told. The rule is n β₯ 3f + 1.
Node 2 sees exactly the same messages in both cases, so it cannot tell which case it is in. With a fourth node, there is a third voice that breaks the tie.
| Step | Who sends | What happens | Why |
|---|---|---|---|
| Request | Client to primary | The client sends a signed request | Start |
| Pre-prepare | Primary to all | Primary picks a sequence number and sends the proposal | Order requests |
| Prepare | Every replica to all | Each tells the others what it accepted | Spot a primary that sends different things to different nodes |
| Commit | Every replica to all | After 2f + 1 matching prepares, each sends a commit | Make sure enough honest nodes are ready |
| Reply | Replicas to client | Run the request, reply. The client waits for f + 1 equal replies | At least one honest node agrees |
| View change | Replicas | If the primary looks faulty, elect a new one | Do not rely on one leader |
| Family | Examples | How agreement is reached | Cost |
|---|---|---|---|
| Voting (classical BFT) | PBFT, Tendermint, HotStuff | Known nodes vote in rounds, need 2f + 1 matching | Many messages, small groups (tens to hundreds) |
| Puzzle-based (Nakamoto) | Bitcoin (proof of work) | The chain with the most work wins. Lying costs real energy | Slow finality, huge energy use, open to anyone |
| Stake-based | Ethereum, Cosmos (proof of stake) | Voters lock coins that are lost if they cheat | Needs a stake and a mechanism to punish |
A simplified teaching model with a fixed lie pattern (no random numbers): traitors are the last f nodes, and they send RETREAT to odd-numbered honest nodes and ATTACK to the others. Real PBFT also uses signatures and three message rounds (pre-prepare, prepare, commit).
| Term | Meaning in easy words |
|---|---|
| Byzantine fault | A node behaves arbitrarily, including lying or contradicting itself |
| Byzantine Generals Problem | Agreement among generals when some may be traitors |
| BFT | Byzantine fault tolerance: staying correct despite Byzantine nodes |
| n β₯ 3f + 1 | The minimum number of nodes to survive f Byzantine nodes |
| Quorum (2f + 1) | A group so large that two of them always share an honest node |
| PBFT | Practical Byzantine Fault Tolerance (1999), a voting protocol with three rounds |
| Primary | The leader who proposes the next request in a round |
| View change | Replacing a primary that is slow or faulty |
| Digital signature | A proof that a message came from a given node and was not changed |
| Proof of work | Solving a costly puzzle to earn the right to add a block |
| Finality | The point after which a decision cannot be undone |
| Sybil attack | One attacker pretending to be many nodes |
| Choice | We gain | We lose |
|---|---|---|
| Crash-fault tolerant (Raft) | Simple, fast, fewer nodes | No protection from lies |
| Voting BFT (PBFT) | Quick finality, no mining | Small, known group and heavy messaging |
| Proof of work | Open to anyone, no member list | Slow and energy hungry |
| Proof of stake | Open and cheaper than work | Needs careful design against stake abuse |
| Checksums and signatures only | Cheap, catches small lies | Not full agreement under attack |