04
Consensus: Each Party has a Private Input 4<br>
05
They Communicate 5<br>
06
They Agree on One Party’s Input 6<br>
09
Byzantine Failures 9<br>
10
He said, She said … 10 ???<br>
11
He said, She said … 11 ???<br>
12
Identifying Input Values 12 sorry f<br>
13
Identifying Input Values 13 ! f+1<br>
14
Byzantine Model 14 There are n validators<br>
15
Byzantine Model 15 As many as f may be dishonest,
where f < n/3
(or f < n/2 with sigs)<br>
16
Synchronous Model 16<br>
17
Asynchronous Model 17<br>
18
Semi-Synchronous 18<br>
19
Semi-Synchronous 19 Global Stabilization Time
(exactly when unknown)<br>
20
Adaptive Adversary 20 Adaptively decides which f to corrupt and when to corrupt them Example: DoS attack There are many kinds of adaptive adversaries …<br>
21
Adaptive Adversary 21 Rushing adversary can corrupt honest party in round r but cannot suppress honest round-r messages How quickly can the adversary corrupt? Example: DoS attack Same round, next round, polylog rounds .. Strongly rushing adversary can suppress honest round-r messages<br>
22
Static Adversary 22 Like a “mole” in a spy story Corrupts validators at start of protocol Leader-based protocols assume static adversary (or adaptive with slow corruption time)<br>
23
Practical Byzantine Fault-Tolerance 23 First practical Byzantine agreement protocol Precedes blockchain Many improvements, optimizations Semi-Synchronous model<br>
24
Before PBFT 24 Mainstream
Systems Research Distributed Computing Byzantine fault-tolerance will be super-important! You Theory losers disgust me, wasting your lives on BFT!<br>
25
After PBFT 25 Mainstream
Systems Research Distributed Computing You theory losers disgust me: we just invented this super-important BFT thing! Why didn’t you do that? Um, blockchains?<br>
26
HotStuff 26 “Best of breed” improvement on PBFT Less communication Semi-Synchronous model<br>
27
BFT vs PoW 27 Well-understood Proofs and open-source implementations Many protocols, research papers Way faster than PoW Decisions are final<br>
28
BFT vs PoW 28 Requires node identities Because Sybil attacks<br>
29
Hello, I’m your leader Structure 29 I’m evil, LOL<br>
30
Jargon Watch 30 Different papers, different terms, same thing “replica” == “validator” “proposer” == “leader” HotStuff sometimes inconsistent But these mean the exact same thing<br>
31
31 All messages signed by senders Omitted from protocols for brevity All signatures checked by receivers<br>
33
Block Party 33 block Each block eventually: Rejected Committed, or Goal is agreement on … A growing chain of committed blocks<br>
34
Parent Pointers 34 block block block block Transitive closure forms ancestors block<br>
35
Parent Pointers 35 block block block block height
k height
k+1<br>
36
Parent Pointers 36 block block block block height
k height
k+1 Same branch<br>
37
Parent Pointers 37 block block block block height
k height
k+1 conflicting
(different branches)<br>
38
Validators 38 Hello, I’m an honest validator I only vote only once per height … Always at increasing heights If I vote on B, then I have seen B’s ancestors<br>
39
Quorum Certificates 39 whatever Form a quorum certificate (QC) for B If 2f+1 votes collected,<br>
40
Quorum Certificates 40 QC | B QC | B’ QC | W QC | W’ Each block’s QC is for ancestor QC | W’’<br>
41
QC Chains 41 QC | B QC | B’ 1-chain:
2f+1 correct validators voted for B at B.height<br>
42
1-chain:
2f+1 correct validators voted for B at B.height QC Chains 42 QC | B QC | B’ QC | B QC | B’ QC | B’’ 2-chain:
2f+1 correct validators voted for B’’ and received 1-chain B B’<br>
43
QC Chains 1-chain:
2f+1 correct validators voted for B at B.height 2-chain:
2f+1 correct validators voted for B’’ and received 1-chain B B’ 43 QC | B QC | B’ QC | B QC | B’ QC | B’’ QC | B QC | B’ QC | B’’ QC | B’’’ 3-chain:
2f+1 correct validators voted for B’’’ and received 2-chain B B’ B’’<br>
44
height
? height
k+2 height
k+1 height
k Committed Block 44 QC | B QC | B’ QC | B’’ QC | B’’’ B is committed if there is a 3-chain
B B’ B’’ B’’,
where
B parent of B’ parent of B’’<br>
45
Validators 45 Hello, I’m an honest validator<br>
46
Validators 46 And these are my blocks … QC | B QC | B’ QC | B’’<br>
47
Validators 47 B’ B’’ is the highest 1-chain I’ve seen QC | B QC | B’ QC | B’’<br>
48
Validators 48 So B is my preferred block QC | B QC | B’ QC | B’’<br>
49
Validators 49 I will vote for Bnew only if it has my preferred block as ancestor QC | B QC | B’ QC | B’’ QC | Bnew<br>
50
Only Two Kinds of Message 50<br>
51
Only Two Kinds of Message 51<br>
52
Propose Message 52 Bhqc: tail of highest 1-chain
vheight: height of last voted block Hello, I’m an honest validator and this is my state<br>
53
Validators 53 Hello, I’m the leader Bhqc: tail of highest 1-chain
vheight: height of last voted block<br>
54
Propose Message 54 Update Bhqc? Is my preferred block an ancestor of Bnew? Bhqc: tail of highest 1-chain
vheight: height of last voted block<br>
55
Vote Message 55 Send current Bhqc Update my vheight Bhqc: tail of highest 1-chain
vheight: height of last voted block If new blocks now committed, execute their smart contracts in block order<br>
56
Vote Message 56 Collect votes for Bnew until I can form a QC<br>
57
Pacemaker 57 Picking a leader What to propose? Round-robin Get QCs from 2f+1 replicas Extend from latest QC<br>
58
See Paper for Full Spec 58 https://arxiv.org/pdf/1803.05069.pdf<br>
59
Proof of Safety 59<br>
60
Lemma 1 60 Conflicting blocks with the same height cannot both have valid QCs.<br>
61
Proof 61 Suppose B and W with the same height both have valid QCs. Both received 2f+1 votes<br>
62
Proof 62 Quorum: 2f+1<br>
63
Proof 63 Intersection: f+1<br>
64
64 Intersection has at least 1 correct validator Proof<br>
65
65 Intersection has at least 1 correct validator Proof I, a correct validator, must have voted for both, a contradiction!<br>
66
Lemma 2 66 Conflicting blocks cannot become committed by honest replicas<br>
67
Proof 67 Let B,W conflicting blocks, different heights<br>
68
Proof 68 B commits at honest replica that sees:<br>
69
Proof 69 W commits at honest replica that sees:<br>
70
Proof 70 W W’ W’’ Without loss of generality …. B B’ B’’<br>
71
Proof 71 W W’ W’’ By quorum intersection …. B B’ B’’ I, a correct validator, voted for B’’ and W’’<br>
72
Proof 72 W W’ W’’ By quorum intersection …. B B’ B’’ I voted for W’ first<br>
73
Proof 73 W W’ W’’ By quorum intersection …. B B’ B’’ W was my preferred block<br>
74
Proof 74 W W’ W’’ By quorum intersection …. B B’ B’’ To vote for B’’, my preference must have changed branches<br>
75
Proof 75 W W’ W’’ B B’ B’’ Bs There exists Bs W’’.height < Bs.height ≤ B’.height<br>
76
Proof 76 W W’ W’’ B B’ B’’ Bs There exists Bs W’’.height < Bs.height ≤ B’.height Bs has QC from a block<br>
77
Proof 77 W W’ W’’ B B’ B’’ Bs There exists Bs W’’.height < Bs.height ≤ B’.height Bs has QC to block conflicting with W Bs has QC from a block<br>
78
Proof 78 W W’ W’’ B B’ B’’ Bs There exists Bs W’’.height < Bs.height ≤ B’.height Bs has QC to block conflicting with W Bs height is minimal Bs has QC from a block<br>
79
Proof 79 W W’ W’’ B B’ B’’ Bs There exists Bs W’’.height < Bs.height ≤ B’.height Bs has QC from a block Bs has QC to block conflicting with W Bs height is minimal Bs could be B’ so Bs exists<br>
80
Proof 80 W W’ W’’ B B’ B’’ Bs I voted for W’’ then Bs<br>
81
Proof 81 W W’ W’’ B B’ B’’ Bs I prefer W, which conflicts with pred Bs, so I can’t vote for Bs, contradiction<br>
82
Theorem 3 82 If C1 and C2 are block smart contracts, where some honest replica executes C1 before C2, then every honest replica that executes C2 first executes C1<br>
83
Proof 83 From Lemma 1, different heights From Lemma 2, B1‘, B2‘ do not conflict Each replica executes in order<br>
84
Proof of Liveness 84<br>
85
Lemma 4 85 After GST, if any correct replica has B as its preferred block then there exists at least f+1 correct replicas that have a QC for B in a block B’.<br>
86
Proof 86 If a correct replica has B as preferred block, The QC for B’ in B’’ contains 2f+1 votes At least f+1 votes from correct replicas<br>
87
Theorem 5 87 A correct proposer that asks replicas for latest blocks, and waits for n−f responses, can propose a block that will make progress after GST<br>
88
Proof 88 Let B be the preferred block in the highest 1-chain by any correct replica.<br>
89
Proof 89 Hence the correct proposer will follow the branch led by B and extend B’ with a new B’’ All correct replicas make B preferred if not already preferred<br>
90
Proof 90 All correct replicas make B preferred if not already preferred All correct replicas will vote for B’’<br>
91
91 Ideas we covered in this lecture HotStuff Protocol Safety proof Consensus in Byzantine models Liveness Proof Semi-Synchronous models<br>