This is a great question about two important consensus algorithms. Let me break this down comprehensively.
PBFT (Practical Byzantine Fault Tolerance)
Background
- Introduced by Miguel Castro and Barbara Liskov in 1999
- Designed to tolerate Byzantine faults (arbitrary, potentially malicious faults)
- Used in many blockchain systems and distributed systems
- Has quadratic message complexity O(n²)
Why 3f+1 nodes?
Let me think through this carefully:
-
Byzantine vs Crash Faults
- Crash faults: nodes simply stop working (can be detected)
- Byzantine faults: nodes behave arbitrarily, including lying, sending conflicting messages, etc.
-
The quorum intersection principle
For PBFT with 3f+1 nodes tolerate f Byzantine failures:
- Total nodes: n = 3f+1
- One designation: 1 primary + (n-1) backups
- Quorum size: Q = 2f+1
Why 2f+1? Here's the key insight:
- If we have f faulty nodes, the maximum number of faulty nodes in any quorum is f (worst case)
- An honest quorum would have at least 2f+1 - f = f+1 honest nodes
- Any two quorums of size 2f+1 must overlap in at least (2f+1) + (2f+1) - (3f+1) = f+1 nodes
Proof of overlap:
- Total nodes: 3f+1
- If we pick two quorums of size 2f+1 each
- Overlap = |Q1| + |Q2| - total = (2f+1) + (2f+1) - (3f+1) = f+1
- This f+1 > f guarantees at least one honest node in the intersection
-
Why this much?
The core requirement is ensuring at least one honest copy of the state survives even when f nodes fail. When we send a message to all nodes, up to f could be malicious or silent, leaving only f+1 guaranteed honest nodes. Since we need 2f+1 nodes to form a quorum, this ensures any two quorums must share at least one honest node, preserving correctness.
More formally, with Byzantine faults, a quorum must exceed n - f to guarantee containing at least one honest node. For two quorums to intersect with certainty, we need 2Q > n + f, which gives us Q > (n + f) / 2. This is why 3f+1 total nodes are required: f malicious, f crashed, and f+1 honest nodes. For Byzantine fault tolerance, I need enough nodes to confirm messages such that even if f nodes are faulty, the honest majority prevails. The core constraint is that any two quorums must overlap with at least one honest node—this means 2Q - n ≥ 1, or Q ≥ (n+1)/2. Additionally, a quorum must contain more than f honest nodes to guarantee the truth emerges, so Q > n - f. Combining these: if Q = n - f, then n - f > (n+1)/2, which gives n > 2f + 1, meaning n ≥ 3f + 1 is the minimum.
For practical Byzantine fault tolerance like PBFT, the requirement is n > 3f, ensuring that quorums of size 2f + 1 can be formed where any two quorums intersect with at least one honest member. This threshold guarantees that even with f Byzantine nodes actively lying, the system can reach consensus on the truth. For Byzantine fault tolerance, we need enough nodes so that honest nodes can always reach consensus even when some are faulty. With 3f+1 total nodes, if f become Byzantine faulty, we can still form a quorum of 2f+1 nodes that guarantees at least one honest participant. This works because 2f+1 exceeds the number of potential liars (f), ensuring the honest nodes outnumber the faulty ones. Any two quorums of this size must overlap, which means they share at least one honest node that can verify consistency across decisions. Raft tolerates crash faults with just 2f+1 nodes because crashed nodes stop communicating entirely, so the remaining n-f nodes can form a majority as long as n-f > f. PBFT requires 3f+1 nodes because Byzantine nodes can lie and send conflicting messages to different peers, necessitating a larger quorum to ensure honest nodes always overlap and can detect dishonesty.
The core distinction comes down to message behavior: crashed nodes are silent, while malicious nodes actively deceive. With Byzantine faults, even if f nodes collude and equivocate, you need enough honest nodes to outnumber the liars and reach consensus on the truth. This means requiring 2f+1 honest nodes in any quorum, which forces the total to 3f+1.
PBFT operates through distinct phases anchored by a view number representing the current leader epoch. The primary initiates consensus by broadcasting a PRE-PREPARE message containing the view, sequence number, and request digest—this establishes the proposed ordering. Backups that receive a valid PRE-PREPARE log it and enter the Prepare phase, where they broadcast their own PREPARE messages to signal acceptance of that value at that view and sequence number.
Once a node accumulates 2f+1 PREPARE messages for the same view, sequence number, and digest (including its own), it enters a prepared state—this threshold guarantees that more than two-thirds of nodes have acknowledged the proposal, so even if f Byzantine nodes misbehave, honest nodes maintain consensus. The node then moves to the Commit phase, broadcasting a COMMIT message to finalize the value across the network.
When 2f+1 COMMIT messages arrive for the same parameters, the node can safely execute the request, confident that all other honest nodes will reach identical conclusions. The two-phase structure ensures prepared nodes have visibility into what was proposed, while committed nodes can act on the guarantee that the entire honest network has converged on the same value. Each node then gathers its own commit message along with 2 from other backups, reaching the 3-commit threshold needed to execute value v at sequence number 100.
When the primary fails or network issues arise, nodes timeout on the pre-prepare and initiate a view change, advancing by f+1 views to guarantee consensus on suspicion. The new primary assembles a fresh pre-prepare from the highest prepared values observed in the previous view. This ensures that once an honest node executes a message at a given position in a view, no other honest node can execute something different at that same position, maintaining safety even when the primary is Byzantine.
The system progresses as long as either the primary remains honest or f+1 honest nodes collectively trigger a view change. Sequence numbers prevent conflicting values from occupying the same slot.
Once 2f+1 nodes commit the same (view, seqno, digest), the operation executes and the result returns to the client. This threshold ensures that even with f Byzantine failures, the honest majority can guarantee consistency—any two sets of 2f+1 nodes must overlap in at least f+1 honest nodes, forcing agreement on what was committed.
PBFT vs Raft: Byzantine vs Crash Fault Tolerance
Why PBFT Needs 3f+1 vs Raft's 2f+1
The Core Difference: Fault Model
| Aspect | Raft (Crash) | PBFT (Byzantine) |
|---|
| Faulty behavior | Nodes stop responding | Nodes lie, equivocate, collude |
| Nodes required | 2f+1 | 3f+1 |
| Quorum threshold | >f honest (majority) | >2f honest (2/3 majority) |
Mathematical Justification
Raft with 2f+1 nodes:
Total: n = 2f+1
After f crash failures: f+1 nodes remain
Majority needed: f+1 > f ✓
Simple: Need > n/2 = > f
PBFT with 3f+1 nodes:
The requirement stems from quorum intersection under Byzantine conditions:
Total: n = 3f+1
Faulty nodes: f (Byzantine)
Quorum size: 2f+1
Key insight: Any two quorums must overlap with ≥1 honest node
|Q₁| + |Q₂| - n ≥ # honest nodes
(2f+1) + (2f+1) - (3f+1) = f+1 > f ✓
Guarantee: Even if f nodes lie, 2f+1 > f means honest
nodes outnumber Byzantine ones.
Intuitive explanation:
With 3f+1 nodes, partition into three groups:
├─ f nodes (Byzantine faulty)
├─ f nodes (crashed/unreliable)
└─ f+1 nodes (honest)
Total: 3f+1
For consensus: Need 2f+1 = f + (f+1)
This means: all faulty + minimum honest nodes
Even if all f Byzantine nodes lie, f+1 honest > 0 ✓
PBFT Protocol Phases
Overview
Client → Primary (Pre-prepare) → All → Prepare (2f+1 needed)
→ Commit (2f+1 needed) → Execute and reply to client
Phase 1: Pre-Prepare
Who acts: Primary only
What happens:
Primary receives:
REQUEST(operation) from client
Primary broadcasts:
⟨PRE-PREPARE, view, seqno, digest(op)⟩ to all
Purpose:
- Assigns sequence number to prevent reordering attacks
- Proposes value for this slot in this view
Critical invariant:
If two honest nodes pre-prepare different values for ⟨view, seqno⟩, the primary is Byzantine
Phase 2: Prepare
Who acts: All backup nodes (and primary participates)
What happens:
Backup receives PRE-PREPARE and broadcasts:
⟨PREPARE, view, seqno, digest(op), nodeID⟩ to all
Each node collects prepares and when it receives
2f+1 prepares for SAME ⟨view, seqno, digest⟩:
- Mark as "prepared"
- Records this in stable storage
Why 2f+1?
Prepared set contains:
├─ Up to f Byzantine nodes (lying or sending conflicting messages)
├─ Up to f faulty nodes (crashed, sending nothing)
└─ At least f+1 honest nodes
2f+1 > f guarantees honest majority in prepared set
Safety from Prepare:
If an honest node marks value V as "prepared" at ⟨view, seqno⟩,
then no other honest node will mark different value V' as prepared
at the same ⟨view, seqno⟩
Phase 3: Commit
Who acts: All nodes
What happens:
Node broadcasts:
⟨COMMIT, view, seqno, digest(op), nodeID⟩ to all
When node receives 2f+1 commits for SAME ⟨view, seqno, digest⟩:
- Execute operation
- Send result to client
- Forget about this slot (can't be changed in this view)
Why separate from Prepare?
The two phases work together:
Prepare Phase: "I know other nodes saw this value"
Commit Phase: "I know other honest nodes will execute this value"
This separation ensures:
- No honest node commits value A while another commits value B
- Works even if primary is Byzantine
- Handles view changes correctly
Complete Message Flow Example
Setup: n=4 nodes, f=1 faulty, quorum=2f+1=3
View 0, Primary = Node 1
CLIENT → Primary:
REQUEST(transfer $100)
PRIMARY → BACKUPS (nodes 2,3,4):
PRE-PREPARE(view=0, seqno=42, digest=H(op))
BACKUPS PREPARE:
Node 2 → ALL: PREPARE(0, 42, H(op))
Node 3 → ALL: PREPARE(0, 42, H(op))
Node 4 → ALL: PREPARE(0, 42, H(op)) ← maybe Byzantine (no send/lie)
EACH NODE COUNTS:
PRE-PREPARE: 1 (from primary)
+ 2 honest PREPAREs = 3 PREPARES for (0, 42, H(op))
✓ PREPARED
COMMIT PHASE:
Nodes 1,2,3 → ALL: COMMIT(0, 42, H(op))
Node 4 → ALL: (Byzantine - sends conflicting or nothing)
EACH HONEST NODE COUNTS:
3 commits = 2f+1 ✓
EXECUTION:
Nodes 1,2,3 execute transfer
Even if Node 4 is Byzantine, execution is safe
Why Not Just Two Phases?
After Prepare, why need Commit?
❌ Without Commit phase:
Clock advances in view 0, some nodes prepared value V
Meanwhile, network partition or:
- View change proposed
- Primary becomes Node 3
New primary thinks no one prepared V!
Causes different value proposed at same seqno
✓ With Commit phase:
Prepared nodes send COMMIT first
Ensures majority of system agrees before state changes
View changer must respect committed values (built into
view change protocol)
Key Differences from Raft
| Feature | Raft | PBFT |
|---|
| Tolerates | Crash only | Byzantine (malicious) |
| Nodes | 2f+1 | 3f+1 |
| Message rounds | 1-2 | 4 minimum (pre-prep, prep, commit, reply) |
| Message complexity | O(n) | O(n²) |
| Leader role | Trusted | Suspected constantly |
| Safety | With honest majority | With >2/3 honest |
| Used in | etcd, Consul, databases | Hyperledger Fabric, some L1 blockchains |
Performance Trade-off
Raft: Fast but trusts leader not to lie
├─ Log replication: send to f+1 followers, done
└─ Common case: 1-2 round trips
PBFT: Robust but expensive
├─ Must verify with 2f+1 quorum
├─ Pre-prepare → Prepare → Commit → Execute
└─ Quadratic messaging between nodes
Critical Insight
The 3f+1 requirement reflects that Byzantine fault tolerance requires consensus under suspicion—nodes must assume leaders/peers may lie, requiring supermajority (2f+1 out of 3f+1) agreement. Crash fault tolerance only needs majority detection—a simple majority of live nodes to confirm the crashed ones are really down.