PBFT - Private Blockchain
PBFT - Private Blockchain
Introduction
Practical Byzantine Fault Tolerance (PBFT) is a consensus mechanism used
in permissioned blockchains, where nodes are known and have access control.
PBFT can tolerate up to f faulty or malicious nodes in a network of 3f + 1
nodes, ensuring the system’s security and reliability.
• Prepare: Each backup node validates the request and broadcasts a ”pre-
pare” message.
• Commit: Nodes exchange ”commit” messages with each other.
• Reply: After reaching a consensus (agreeing on the same state), nodes
send replies to the client.
1
Step 1: Client Request
The client sends the request for transaction T1 to the primary node N0 .
Client → N0 : T1
Step 2: Pre-prepare
The primary node N0 forwards the request T1 to the backup nodes N1 , N2 , and
N3 as a pre-prepare message.
N0 → {N1 , N2 , N3 } : Pre-prepare(T1 )
Step 3: Prepare
Each node (including N0 ) validates the request T1 . If valid, they send a prepare
message to the other nodes.
N1 → {N0 , N2 , N3 } : Prepare(T1 )
N2 → {N0 , N1 , N3 } : Prepare(T1 )
N3 → {N0 , N1 , N2 } : Prepare(T1 )
Step 4: Commit
After receiving enough prepare messages, each node sends a commit message to
the other nodes.
N1 → {N0 , N2 , N3 } : Commit(T1 )
N2 → {N0 , N1 , N3 } : Commit(T1 )
N3 → {N0 , N1 , N2 } : Commit(T1 )
Each node waits until it receives 2f + 1 = 3 commit messages (including its
own).
Step 5: Reply
Once a node collects enough commit messages, it executes the transaction T1
and sends a reply back to the client.
N0 → Client : Reply(T1 )
N1 → Client : Reply(T1 )
N2 → Client : Reply(T1 )
N3 → Client : Reply(T1 )
2
Handling Faults
In this system, PBFT can tolerate up to 1 faulty node. For example, if N2 is
malicious and sends conflicting prepare or commit messages, the remaining 3
nodes (N0 , N1 , N3 ) can still reach consensus since they outnumber the faulty
node.
Summary of Communication
Conclusion
This example demonstrates how PBFT enables consensus in permissioned blockchains,
ensuring security and fault tolerance even when up to f nodes are faulty. The
process involves multiple stages of message exchange to achieve consensus on a
transaction, making PBFT suitable for small networks where nodes are trusted
or semi-trusted.