The Web3 Book
Chapters / Part III
Part III · Technical Foundations, Explained Accessibly

10. Distributed Systems, Trust, and the Byzantine Generals Problem

Chapter 10 · 23 min read · Subscribers

This chapter sets out the single deepest idea behind Web3, the idea from which the word "decentralisation" draws all of its meaning. The previous chapter (Chapter 8, Cryptography for Non-Specialists) showed how mathematics lets a single person prove who they are and prove that a message has not been tampered with. But Web3's central ambition is larger and stranger than that. It is to make a crowd of computers — owned by strangers who do not know or trust one another, scattered across the world, some of them broken and some of them actively dishonest — nonetheless agree on a single shared truth, such as "who owns what money," with no boss, no headquarters, and no referee to settle disputes. For decades, leading computer scientists regarded this as something between extraordinarily difficult and provably impossible. Understanding why it is so hard is the necessary prelude to understanding why the blockchain (Chapter 11) and Bitcoin (Chapter 12) were greeted, by people who knew the history, as a genuine breakthrough rather than mere hype.

Read this chapter free

Invite 3 friends to subscribe and this chapter opens here.

In plain terms

imagine an orchestra with no conductor, in which the musicians cannot see one another and can communicate only by passing handwritten notes down the rows. Somehow they must still start together, stay together, and finish together. A distributed system is that orchestra, and the "music" is whatever task the computers are trying to perform in unison.

picture sending a letter to a friend and getting no reply. Has the letter been lost in the post? Is your friend on holiday? Have they read it and chosen not to answer? Have they died? From silence alone you cannot tell — and yet you must decide whether to wait, write again, or act without them. Every computer in a distributed system lives permanently in this fog of silence, and must make consequential decisions inside it.

a crash fault is a committee member who goes home early; an awkward absence, but at least you know where you stand. A Byzantine fault is a committee member who stays, lies to your face, tells one story to you and the opposite story to the person beside you, and quietly conspires with two others to wreck the meeting. Tolerating absences is hard enough; tolerating deliberate, coordinated deceit is far harder.

consensus is the problem of getting a roomful of people who can only pass notes, who cannot be sure the notes arrive, and some of whom may be lying, to nonetheless all walk out of the room having agreed on the same decision — and to be confident the others agree too. The rest of this chapter is about exactly how hard that is, and where the hard limits lie.

the generals are the computers; the messengers are the network; "attack or retreat, but all together" is the demand for consensus; and the traitors are the Byzantine-faulty machines that lie. The problem asks: can the honest participants always reach a shared decision, even when an unknown subset of them are doing everything in their power to prevent it? The analogy is precise rather than decorative — the abstract problem really is the concrete one computer engineers face.

if you want to be safe against a single liar in the group, three of you are not enough — you need at least four, of whom at most one is lying. Lies are corrosive precisely because a liar can tell different stories to different people, so honest members cannot simply "take a vote": the liar may have voted one way to half the room and the other way to the rest. Defeating that requires a comfortable supermajority of honest participants.

an unsigned rumour can be twisted as it travels — "she told me to attack" is impossible to disprove. A signed, tamper-proof note cannot: it carries its author's unforgeable mark, so a liar can no longer claim someone said something they did not. Digital signatures turn slippery hearsay into verifiable evidence, and that single change dramatically loosens the grip of the problem. Note the dependence, though: the guarantee rests on the assumption that the signatures truly cannot be forged — which is exactly what the cryptography of Chapter 8 is for.

Castro and Liskov took a result that had been admired as theory and turned it into engineering — a recipe a working system could actually follow to keep functioning while some of its own computers were trying to corrupt it. Their design assumed, however, that the participants were a known, fixed list of machines. Letting anyone in the world join and leave at will, without permission, was a further leap — and that leap is exactly what Bitcoin would later make.

FLP says that if you demand an absolute, mathematical guarantee that a group of computers will always reach agreement, and you make no assumptions at all about how fast the network is, then no such guarantee is possible — a single computer going quiet can, in the worst case, stall the decision forever. It is the distributed-systems equivalent of a fundamental speed limit: not a failure of cleverness, but a wall built into the problem itself.

two branches of a bank share a single account ledger and stay in sync over a phone line. One day the phone line goes dead — a network partition. A customer walks into each branch wanting to withdraw from the same account. The branches now face an unavoidable choice. They can refuse all transactions until the line is restored, so the two ledgers never disagree — that is choosing consistency at the cost of availability (the bank is correct but closed). Or they can keep serving customers using whatever balance they last knew, risking that the same money is paid out twice — that is choosing availability at the cost of consistency (the bank is open but possibly wrong). What they cannot do, while the line is down, is be both fully open and fully correct. That impossibility is the CAP theorem.

sending someone a digital coin is, by default, more like sending them a photograph of a coin than handing over the coin itself — you still have your copy afterwards, and so can "send" it again to someone else. Money cannot work that way. Solving digital cash means finding a way to make a digital coin behave like a physical one: spendable only once.

the unsolved problem was never "how do I prove this coin is mine?" — signatures handled that. It was "how do thousands of strangers who do not trust each other, with no boss and no membership list, all agree on the single true order of who paid whom, so the same coin cannot be spent twice?" That is a consensus problem among the mutually distrustful — the Byzantine Generals Problem wearing the costume of money.

What the chapter covers

  1. What a distributed system is
  2. Why distributed systems are hard
  3. Two kinds of failure: honest crashes and active lies
  4. The problem of agreement among the mutually distrustful
  5. The Byzantine Generals Problem
  6. Byzantine fault tolerance becomes practical
  7. The hard limits: the FLP impossibility result
  8. The CAP theorem: you cannot have everything
  9. Why earlier digital cash failed: the double-spend problem
  10. Synthesis

Terms explained in this chapter

The full chapter is in the book.

Buy the full book