ARCHIVED from builddistributedsystem.com on 2026-04-28 — URL: https://builddistributedsystem.com/tracks/advanced/tasks/task-10-3-pbft
TASK

Implementation

Implement PBFT: tolerates f Byzantine faults with 3f+1 nodes. Three phases: pre-prepare, prepare, commit.

Sample Test Cases

Pre-prepare phaseTimeout: 5000ms
Input
{
  "src": "c0",
  "dest": "n1",
  "body": {
    "type": "init",
    "msg_id": 1,
    "node_id": "n1",
    "node_ids": [
      "n1"
    ]
  }
}
Expected Output
{"src":"n1","dest":"c0","body":{"type":"init_ok","in_reply_to":1,"msg_id":0}}

Hints

Hint 1
Need 3f+1 nodes to tolerate f faults
Hint 2
Pre-prepare, Prepare, Commit phases
Hint 3
Wait for 2f+1 matching messages
OVERVIEW

Theoretical Hub

Byzantine Fault Tolerance

Byzantine faults include malicious behavior. PBFT requires 3f+1 nodes to tolerate f faulty nodes. Uses 3 phases with quorum certificates.

Key Concepts

ByzantinePBFTf faults
main.py
python
Implement Byzantine Fault Tolerance - Advanced | Build Distributed Systems