Consensus Protocols in Blockchain
Cong Yan
Jan 30, 2018
Recap: Proof of Work
Alternative Consensus Protocols
| Efficiency | Security | Simplicity |
PoW | | | |
PBFT | | | |
PoS | | | |
Agenda
Practical Byzantine Fault Tolerance (PBFT)
Practical Byzantine Fault Tolerance (PBFT)
Client:
Primary:
v: view number
n: sequence number
d: message digest
: primary p’s signature
m: value to agree on
Practical Byzantine Fault Tolerance (PBFT)
Client:
Primary:
If node i receives >=2f ‘prepare’ with the same m as itself, then ‘prepare’ is confirmed.
v: view number
n: sequence number
i : replica i
m: value to agree on
Practical Byzantine Fault Tolerance (PBFT)
Client:
Primary:
If node i receives >=2f ‘prepare’ with the same m as itself, then ‘prepare’ is confirmed.
v: view number
n: sequence number
i : replica i
m: value to agree on
Practical Byzantine Fault Tolerance (PBFT)
Client:
Primary:
v: view number
n: sequence number
i : replica i
m: value to agree on
If ‘prepare’ is confirmed, and node i receives >=2f ‘commit’ with the same m as itself and the m in ‘prepare’, then ‘commit’ is confirmed.
Practical Byzantine Fault Tolerance (PBFT)
Client:
Primary:
If a client receives >f replies, the result is confirmed.
i : replica i
r: reply
Practical Byzantine Fault Tolerance (PBFT)
For more details, check http://pmg.csail.mit.edu/papers/osdi99.pdf
PBFT Recap
Proof of Stake: basic
Proof of Stake: basic
Proof of Stake: basic
Casper
White paper: https://arxiv.org/abs/1710.09437
Original Ethereum
$$$: block rewards +
$: transaction fee
Ethereum with Casper
Casper gets validators agree on which path to choose
$: transaction fee
$$$: block rewards
Goals of Casper’s Validator Protocol
Casper Checkpoint Tree
Root
Checkpoint (every 100 blocks, for efficiency reason)
Supermajority link: >⅔ validators vote on this link
Finalized checkpoint
Casper Slashing Condition
s1, s2: source
t1, t2: target
h(s): height of s
V: vote
Casper Slashing Condition
Condition 1:
b’
1
2
3
4
5
6
7
Casper Slashing Condition
Condition 2:
1
2
3
4
5
6
7
Casper Discussion
Hyperledger Fabric
Hyperledger Fabric Architecture
Application
Peers with distributed ledger
Smart contract
Figure source: https://hyperledger-fabric.readthedocs.io
Hyperledger Fabric Architecture
Hyperledger Fabric Architecture
Hyperledger Fabric Architecture
client
endorsing peers
global ordering service
Hyperledger Fabric Consensus Process
Step 1:
proposal
Hyperledger Fabric Consensus Process
Step 2:
endorsement
Hyperledger Fabric Consensus Process
Step 3:
Transaction
(encrypted)
Hyperledger Fabric Consensus Process
Step 4:
Block of txns to be executed
Hyperledger Fabric Consensus Process
Step 5:
Confirmed txn result
Hyperledger Fabric Discussion
Hyperledger Fabric Throughput
Figure source: BLOCKBENCH: A Framework for Analyzing Private Blockchains, SIGMOD’17
Conclusion
| Efficiency | Security | Simplicity |
PoW | | | |
PBFT | | | |
PoS | | | |