liveBook · Manning

Consensus

As explained in Real-World Cryptography

A consensus protocol is a protocol by which distributed participants agree on an ordered system state despite communication or participant failures.

Consensus lets distributed participants agree on an ordered system state even when messages are delayed, dropped, modified, or participants fail. It is useful when eventual consistency is not enough: replicas must agree on leadership and on which database changes become committed. section 12.1.1

A consensus protocol addresses several practical decisions:

  • Leader election chooses which replica takes over after a failure. section 12.1.1
  • Pending changes become committed only after enough participants agree, making committed updates difficult to lose. section 12.1.1
  • Byzantine fault-tolerant protocols aim to prevent contradictory histories, or forks, when participants may misbehave. section 12.1.2
  • Protocol families make different participation tradeoffs: BFT uses a known participant set, while Nakamoto consensus uses proof of work for permissionless participation. section 12.5

Ordering a pizza across unreliable networks

If everyone is in one room, the majority preference is easy to identify. Across a network, delayed, dropped, intercepted, or modified messages make agreement harder; consensus supplies the additional protocol needed to choose one shared decision. The same pattern applies to replicas agreeing on a database update. section 12.1.1

Paxos, published in 1989, and Raft, published in 2013, are well-known consensus algorithms. In cryptocurrency systems, BFT protocols avoid proof-of-work’s heavy electricity overhead, while Bitcoin uses proof of work to select the next transaction block. section 12.1.1 section 12.3.5

How Real-World Cryptography covers it

How deep it goes
Explains leader election, commit thresholds, fault models, and participation schemes, but does not detail protocol algorithms or proofs.
Examples
Uses pizza ordering, replicated database failover, Byzantine generals, Bitcoin block selection, and forks as concrete examples.
What it assumes
Assumes familiarity with distributed databases, replicas, network failures, and eventual consistency; introduces consensus terminology through practical scenarios.
What you can do after
Evaluate how consensus handles replica failure, malicious participants, commitment, participation, and proof-of-work energy tradeoffs.
How it connects
Connects eventual consistency, leader election, state machine replication, atomic broadcast, Byzantine fault tolerance, proof of work, proof of stake, and proof of authority.

Also explained in

Compare how 4 books explain consensus →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.