How unit 3 is examined
This unit covers permissioned blockchains and the consensus protocols they use (state machine replication, Paxos, RAFT, Byzantine fault tolerance); no topic has been asked recently, so learn each definition and its key numbers.
Permissioned Block chain: Permissioned model and use cases, Design issues, Execute contracts
Not asked since 2022
Definition. A permissioned blockchain is a ledger where only known, authorised participants may join, read, write or validate transactions, and every member has an identity issued by a membership authority. Permissioned blockchains trade open participation for identity, privacy and speed.
Key points.
- Members are identified and approved, so trust is partial and consensus can be cheap, using voting instead of mining.
- Use cases include trade finance, supply chain tracking, KYC, interbank settlement and healthcare records shared by a consortium.
- Design issues are membership and identity management, data privacy between competitors, throughput and latency, the choice of consensus protocol, and governance of who may change the rules.
- Smart contracts (chaincode) run only on authorised nodes; the result is agreed by the endorsing or validating nodes before it is committed to the ledger.
- Because the participants are known, a misbehaving member can be identified and removed, which a public chain cannot do.
| Point | Public chain | Permissioned chain |
|---|---|---|
| Joining | Anyone | Invited and approved only |
| Identity | Pseudonymous | Known and verified |
| Consensus | PoW or PoS, slow | Voting (Paxos, RAFT, BFT), fast |
| Privacy | Ledger visible to all | Restricted to members or channels |
| Example | Bitcoin | Hyperledger Fabric |
State machine replication and consensus models for a closed environment
Not asked since 2022
Definition. State machine replication (SMR) keeps identical deterministic copies of a service on several nodes, applying the same commands in the same order, so that all replicas reach the same state even if some nodes fail. Agreement on the order of transactions is what makes all replicas end in the same state.
Key points.
- A blockchain is a replicated state machine: the ledger is the state and each block is a batch of commands applied in agreed order.
- A closed environment has a known, fixed set of nodes, so agreement is reached by voting among them and not by proof of work.
- Crash fault tolerant (CFT) models such as Paxos and RAFT survive nodes that stop; Byzantine fault tolerant (BFT) models survive nodes that lie or act maliciously.
- Determinism is essential: the same input in the same order must always give the same output on every replica.
- A consensus protocol must give safety (no two replicas decide differently) and liveness (the system eventually decides).
| Model | Faults tolerated | Nodes needed for f faults |
|---|---|---|
| CFT (Paxos, RAFT) | Crash | 2f+1 |
| BFT (PBFT, LSP) | Arbitrary or malicious | 3f+1 |
Paxos and RAFT Consensus
Not asked since 2022
Definition. Paxos and RAFT are crash-fault-tolerant protocols in which a majority of nodes agrees on a single value or on the order of a replicated log. With N nodes, they tolerate up to f crashes when N is at least 2f+1.
Key points.
- Paxos has three roles: proposers suggest a value, acceptors vote, and learners learn the chosen value.
- Paxos runs in two phases: prepare/promise, where a proposer asks acceptors to promise to ignore lower-numbered proposals, and accept/accepted, where the value is sent; it is chosen once a majority accepts.
- RAFT is designed to be easier to understand: it elects one leader per term, and only the leader accepts client commands and replicates log entries to followers.
- RAFT nodes are in one of three states, follower, candidate or leader; a follower that hears no heartbeat before its random election timeout becomes a candidate and asks for votes, and a majority of votes makes it leader.
- A log entry is committed when a majority of nodes has stored it, so a minority of crashed nodes cannot stop progress.
Example: N = 5 nodes, majority = 3, so f = 2 crashes are tolerated.
N >= 2f + 1 -> 5 >= 5
Diagram. RAFT states.
Byzantine general problem, Byzantine fault tolerant system, Lamport-Shostak-Pease BFT Algorithm
Not asked since 2022
Definition. The Byzantine generals problem asks how loyal generals, who communicate only by messengers, can agree on a common plan (attack or retreat) when some generals are traitors who send conflicting messages. ==A system with f Byzantine nodes needs at least N = 3f+1 nodes to reach agreement.==
Key points.
- A Byzantine fault is any arbitrary or malicious behaviour, such as sending different values to different nodes, which is worse than a simple crash.
- A Byzantine fault tolerant system must satisfy two conditions: all loyal generals decide on the same plan, and if the commander is loyal, every loyal general follows the commander's order.
- The Lamport-Shostak-Pease algorithm uses oral (unsigned) messages: with m traitors it needs at least 3m+1 generals and m+1 rounds of message exchange.
- In the algorithm, the commander sends his value to all lieutenants; each lieutenant then relays what he received to the others, recursively for m rounds, and finally takes the majority of the values received.
- With only 3 generals and 1 traitor agreement is impossible, because a loyal lieutenant cannot tell whether the commander or the other lieutenant is lying.
Example: m = 1 traitor needs N = 3(1) + 1 = 4 generals and 2 rounds.
Round 1: commander C sends "attack" to L1, L2, L3.
Round 2: each lieutenant relays what he heard; traitor L3 lies.
L1 sees (attack, attack, retreat) -> majority = attack. L2 does the same.
Diagram. Four generals, one traitor.
BFT over Asynchronous systems
Not asked since 2022
Definition. An asynchronous system has no bound on message delay or processing time, so a slow node cannot be told apart from a failed one. The FLP result proves that no deterministic protocol can guarantee consensus in an asynchronous system if even one node may fail.
Key points.
- The internet behaves asynchronously, so a BFT protocol for it cannot rely on timing assumptions for safety.
- Practical BFT (PBFT) keeps safety always, and guarantees liveness only when the network is eventually synchronous, which avoids the FLP impossibility in practice.
- PBFT needs N = 3f+1 replicas; a primary orders the requests, and the phases are pre-prepare, prepare and commit, each needing agreement from 2f+1 replicas.
- If the primary is faulty or too slow, the replicas run a view change and elect a new primary.
- Randomised protocols such as HoneyBadgerBFT avoid the FLP limit by using randomness and give liveness even without synchrony.
| Phase | What happens |
|---|---|
| Pre-prepare | Primary assigns a sequence number and multicasts the request |
| Prepare | Replicas multicast agreement on the order |
| Commit | After 2f+1 matching messages, replicas execute and reply |
Last-minute revision
- Permissioned chain: known, authorised members; no mining needed.
- Public chain uses PoW or PoS; permissioned chain uses voting.
- SMR: same deterministic commands in the same order give the same state.
- Consensus needs safety (agree) and liveness (eventually decide).
- Crash fault tolerance (Paxos, RAFT): N ≥ 2f+1, majority quorum.
- Byzantine fault tolerance: N ≥ 3f+1.
- Lamport-Shostak-Pease oral messages: 3m+1 generals, m+1 rounds.
- RAFT: follower, candidate, leader; a term has one leader.
- Paxos roles: proposer, acceptor, learner; phases prepare and accept.
- FLP: no deterministic consensus in an asynchronous system with one fault.
- PBFT phases: pre-prepare, prepare, commit; view change replaces a bad primary.
Memory hooks
- Crash needs a majority (2f+1); traitors need two thirds (3f+1).
- RAFT = Raise a leader, Append, Follow.
- Paxos = Prepare, Promise, Accept.
- FLP: in async you cannot tell slow from dead, so no guarantee.
- PBFT = Pre-prepare, Prepare, Commit: three P/C steps.
Coverage checklist
- Permissioned Block chain: Permissioned model and use cases, Design issues for Permissioned block chains, Execute contracts — no past questions.
- State machine replication, Overview of Consensus models for permissioned block chain- Distributed consensus in closed environment — no past questions.
- Paxos, RAFT Consensus — no past questions.
- Byzantine general problem, Byzantine fault tolerant system, Lamport-Shostak-Pease BFT Algorithm — no past questions.
- BFT over Asynchronous systems — no past questions.