Reaves.dev

v0.1.0

built using

Phoenix v1.7.12

Byzantine Fault Tolerance

Stephen M. Reaves

::

2023-03-10

Notes about Lesson 16 of CS-7210

Required Readings

Optional

Summary

Byzantine Failure and Byzantine Generals

Byzantine failures are where a node fails and continues to behave incorrectly

Could be malicious or arbitrary

Byzantine Fault Tolerance

Goal:

Use cryptographic messages to verify message endpoints and to verify the message has not been tampered with.

To tolerate f failures, we need 3f + 1 nodes

To guard against corrupt leader, we need additional checks among participants

To handle [FLP Theorem](/posts/consensusindistributedsystems/ have bounded delay (or eventual synchrony) for liveness

Practical Byzantine Fault Tolerance

pBFT algorithm was introduced by Miguel Castro and Barbara Liskov in 1999

High performance algorithm

Setup:

Quorum = n - f nodes

pBFT Algorithm

Client request -> pre-prepare -> prepare -> commit -> reply

PrePrepare

Primary node multicasts pre-prepare piggybacked with message to backups

The message is stored in the log

pre-prepare request includes

Backups accept pre-prepare request if:

Then replica enters prepare phase

Prepare

Multicasts prepare message and adds the message to log, then waits for 2f matching prepares which have same view, sequence number, and digest. Then it moves to commit stage.

Commit

Replica multicasts a commit message and adds the message to log, waits for 2f +1 commit messages, then sends reply to client.

Byzantine Consensus vs Blockchain

Blockchain’s distributed ledger is similar to Paxos’s replicated log

Can we build Blockchain network with just pBFT?

ProsCons
Decentralized consensusTolerate f faults in N=3f+1?
Byzantine failuresCommunication costs O(n^3)
Unreliable network

Not everyone is able to participate in maintaining the ledger

There are also incentives for good behavior