The Web3 Book
Chapters / Part IV
Part IV · The Components of Web3

24. Oracles, Bridges, and the Link to the Off-Chain World

Chapter 24 · 21 min read ·

This chapter examines the seams of Web3 — the places where a blockchain, which is a closed and self-contained system, must somehow touch the messy world outside it, or touch another blockchain. The previous chapters described what happens inside the sealed system: ledgers (Chapter 11, The Blockchain), programmable contracts (Chapter 13, Ethereum and Smart Contracts), and financial machinery built atop them (Chapter 19, Decentralized Finance). But a smart contract that pays out crop insurance when it rains, or settles a bet on an election, or moves a token from one chain to another, needs information and value that originate outside its own ledger. Supplying that link turns out to be one of the hardest and most dangerous problems in the whole field. This chapter argues that the edges — where blockchains meet reality, and where they meet each other — are exactly where the trustlessness that Web3 promises quietly breaks down, and where, empirically, the largest thefts in the history of the technology have occurred.

In plain terms

a blockchain is like a sealed room with no windows and no telephone. The people inside can do arithmetic on the documents already in the room, and they can all check each other's work perfectly — that is its great strength. But the room has no way to learn what the weather is outside, what a stock is trading at, or whether a shipment has arrived. It cannot see out. By design.

you built a vault with a thousand locks so that no one person can open it. Then you cut a single mail slot in the door and trusted whoever pushes notes through it. The oracle is the mail slot. If you are not careful, every lock on the vault becomes irrelevant, because the system will faithfully act on whatever lie comes through the slot.

instead of trusting one witness, you trust a jury, and juries are harder to bribe than individuals. That is a real improvement. But you are still trusting — that the jurors are genuinely different people, that they are not all reading the same rigged newspaper, and that the foreman counts the votes correctly. "Harder to corrupt" is not the same as "impossible to corrupt," and the marketing word trustless papers over that gap.

if a vending machine sets its prices by glancing at the stock ticker, and you can jiggle the ticker for ten seconds, you can buy a fortune in goods for pennies. The machine is not "hacked" in the usual sense — it does exactly what it was told. It was simply told to trust a number that you could bend. That is the oracle problem wearing a different hat.

a bridge is a coat-check between two buildings that cannot pass anything to each other directly. You leave your coat in Building A and receive a numbered ticket usable in Building B; hand the ticket back and your coat is returned. The whole arrangement works only if the coats are really still in the closet and only the right tickets get them out. A bridge is, functionally, a giant pile of locked-up assets watched over by a small set of guardians — which is to say, a target.

the coat-check clerk's rule was "issue a ticket only when a coat is deposited." The attacker found a way to fake the deposit slip. The clerk dutifully issued $320 million in tickets for coats that were never handed over — and then those tickets were cashed for real coats. The vault emptied not because a lock was picked but because the rule for issuing claims had a hole in it.

the safest part of a fortress is the thick interior wall that everyone watches. The dangerous parts are the gates — because a fortress with no gates is useless, and every gate is a place where the wall's strength does not protect you. Web3 built astonishingly strong walls and then discovered that all the fighting happens at the gates. Oracles and bridges are the gates.

What the chapter covers

  1. The sealed room: why a blockchain cannot see out
  2. What an oracle is — and the trap it sets
  3. Oracle networks: trying to decentralize the messenger
  4. When the messenger lies: oracle manipulation
  5. Bridges: moving value between sealed rooms
  6. Why bridges bleed: the honeypot at the edge
  7. The deeper lesson: trust concentrates at the edges
  8. Synthesis

Terms explained in this chapter

The full chapter is in the book.

Buy the full book