Scalable Consensus Algorithms in Technologies Habib Yajam

Secure Communication Lab, University of Tehran

1 Outline

, what are them? Why we need them? And when?

• A Brief History of .

• Consensus Algorithms, Definition and Properties.

• Categorizing Consensus Algorithms.

• Hot Topics for Research.

2 Blockchains What are them? Why we need them? And when?

3 When do we need a ?

Permissionless Is a Shared no Common Database Public Ledger needed? yes (Bitcoin) yes Can everyone no Permissioned no maintain the Are Multiple Traditional Public Ledger database Parties involved? Database (Ripple) integrity? yes yes Do Parties have no Permissioned conflicting Can everyone see no Private Ledger interests? the database? (Bankchain) yes

Blockchain (DLT)

4 Blockchain Use Cases

• P2P Payments • Video Games • Back Office Settlement • Supply Chain Management • Copyright Management • Reliable Log Keeping • Digital Identity Management • Decentralized Voting

5 What are the Ingredients?

• P2P Network • Consensus Algorithm • Ledger Database

6 P2P Network

7 Transaction Flow in Bitcoin

mempool

8 Bitcoin Blockchain

9 Generating a Valid Block (Mining)

4198659816850181691986501

Hash Function

Change nonce no < 푡푎푟푔푒푡

yes

Publish to Network

10 Generating a Valid Block (Mining)

1712039707102730871029375

Hash Function

Change nonce no < 푡푎푟푔푒푡

yes

Publish to Network

11 Generating a Valid Block (Mining)

0000961965911298498619761

Hash Function

Change nonce no < 푡푎푟푔푒푡

yes

Publish to Network

12 Nakamoto Consensus

13 Nakamoto Consensus

14 Nakamoto Consensus

15 Nakamoto Consensus

16 Nakamoto Consensus

17 Nakamoto Consensus

18 Forks

Normal State in Blockchain

19 Double Spending Attack

20 Double Spending Attack

21 Double Spending Attack

22 Double Spending Attack

23 Double Spending Attack

24 Bitcoin A Brief History

25 Bitcoin History (2009)

• 01/03: (Block 1) The genesis block established by Satoshi Nakamoto. marking the creation of the .

• 01/09: (Block 2) Bitcoin v0.1 was released and mining began. Bitcoin History (2009)

• 01/11: (Block 78) the first block mined by an individual other than Satoshi. It was Hal Finney.

• 01/12: (Block 170) The first transaction occurred between Satoshi and Hal Finney.

27 Bitcoin History (2009)

• 10/05: (Block ~24400) first bitcoin exchange price was determined by Libertarian Advocating Website “New Liberty Standard” (~0.0008$)

• 12/10: (Block 32256) The difficulty adjusts for the first time, rising from 1 to 1.18. Bitcoin History (2010)

• 02/06: (Block ~57600) dwdollar’s Bitcoin Market first bitcoin exchange was started. Used PayPal as the method of exchange.

• 05/22: (Block 57043) First purchase of a tangible good using bitcoin. (0.0025$) Bitcoin History (2010)

• 07/02: (Block ~65600) Bitcoin v0.3 was released.

• 07/17: (Block ~67040) Mt.Gox, Second Bitcoin Exchange and most well-known exchange at the time was established.

• 07/18: (Block ~67180) First time GPU Mining by pseudonymous person named ArtForz. Later he Acquired 25% of hashing power using a private GPU program. Bitcoin History (2010)

• 12/13: (Block ~97300) Satoshi’s Last Login on BitcoinTalk. He later said he has “moved on to other things”. That was the last the world heard of the secretive Bitcoin creator.

• 12/16: (Block 97834) First Pool-mined Bitcoin Block by Slush Pool.

31 Bitcoin History (2011)

• 02/01: (~Block 105000) an online and the first modern market, best known as a platform for selling illegal opens.

• 02/09: (~Block 107000) Dollar Parity happens on Mt.Gox.

32 Bitcoin Price History

33 Bitcoin P2P network

34 Number of Nodes

35 Orphan Rate

36 Bitcoin Mining

37 Bitcoin Mining

38 Bitcoin Mining

39 Bitcoin Mining

40 Bitcoin Mining Hashrate Distribution

41 Other

2011 (PoW ) [Currency] • Ripple 2012 (BPFT) [Currency] • 2014 (PoW X11 + PoS) [Privacy] • 2015 (PoW → PoS) [DApps] • 2016 (PoW ) [Privacy] • IOTA 2017 (PoW Curl) [Currency] • Cardano 2017 (PoS Provably Secure) [DApps]

42 Consensus Algorithms Definition, Goals and Properties

43 Defining Consensus

• Consensus: Achieving agreement in a multi-agent system.

• If communication/agents are reliable: Consensus is Trivial

• Consensus Algorithms: Achieving agreement in an unreliable environment

44 Defining Consensus

• Unreliability Model: Fault

• Types of Fault: • Crash fault: node hangs/stops/goes offline

• Byzantine fault: node violates protocol maliciously

45 Defining Consensus

• Properties of Consensus Algorithms:

• Safety (Consistency) • Liveness (Availability)

• Throughput • Latency • Scalability

• Decentralization, Transparency, Order Preserving, …

46 Consistency

• A confirmed transaction in an honest node will eventually be confirmed by all honest nodes.

47 Consistency

Node1 Node2 6 6 8 8 1 1 9 9

Node3 Node4 6 6 8 8 1 1 9 9

48 Consistency

Node1 Node2 Change “8” 6 to “5” 6 8 8 1 1 9 9

Node3 Node4 6 6 8 8 1 1 9 9

49 Consistency

Node1 Node2 Change “8” 6 to “5” 6 5 8 1 1 9 9

Node3 Node4 6 6 8 5 1 1 9 9

50 Availability

• A valid transaction will eventually be confirmed by an honest node.

51 Availability

Node1 Node2 6 Append “7” 6 8 8 1 1 9 9

Node3 Node4 6 6 8 8 1 1 9 9

52 Availability

Node1 Node2 6 6 8 8 1 1 9 9 7 7

Node3 Node4 6 6 8 8 1 1 9 9 7 7 53 Throughput/Scalability

• Throughput: Number of newly confirmed transactions per unit of time.

• Latency: • Time it takes for a newly created transaction to get confirmed in an honest node.

• Scalability: In a scalable consensus algorithm, increasing the number of participants does not affect performance.

54 Categorizing Consensus Algorithms Voting-based, Chain-based, DAG-based

55 Categorization of Consensus Alg.

• Vote-based Consensus: • First Prominent Voting-base Protocol by Leslie Lamport 1998 • Example: PBFT, Paxos, Ripple

• Fast ✓ • Not Scalable 

56 Categorization of Consensus Alg.

• Chain-based Consensus: 1 2 3 4 • Introduced by Satoshi Nakamoto in 2008 Txs Txs Txs Txs • Example: Bitcoin, Ethereum

• Scalable ✓ • Not Fast 

1 2 3 4 5 Txs Txs Txs Txs Txs

57 Categorization of Consensus Alg.

• DAG-based Consensus: • Introduced by Sergio Demian Lerner in 2015 • Example: IOTA,

• Fast ✓ • Scalable ✓

58 Categorization of Consensus Alg.

• Permissioned

Scalable • Permissionless: + • Proof-of-Work Permissionless • Proof-of-Stake + • Proof-of-Importance Byzantine Fault Tolerant • Proof-of-Activity = • Delegated-Proof-of-Stake New Form of Decentralization • ...

59 Categorization of Consensus Alg.

Voting- Chain- DAG- based based based

Ripple, R3 Corda, Stellar, Fabric, Multichain, Vechain Chain Core, Quorum Bitcoin, Etheruem, NEM, Qtum, Zilliqa, NEO IOTA OmiseGo, TRON, EOS, Cardano

60 PAXOS Bitcoin DAGcoin Most Famous Voting-based First Chain-based First DAG-based 1998 2008 2015

V C D PBFT Etheruem Tangle V Famous Byzantine First C D IOTA 1999 2013 2016

Zab Ripple PHANTOM Apache Zookeeper Fast Payment First Proof-of-Stake Academic Paper 2007 2011 2012 2017

V V C D

Year 1999 2000 2001 2002 2003 2004 2005 2006 2007 Year 2009 2010 2011 2012 2013 2014 2015 2016 2017 Year 2019

1998 2008 2018 61 Blockchain Scalability Solutions

• Base Layer Solutions: • Decoupling Blockchain • Bitcoin-NG • Fruitchains • PRISM • DAG-based Consensus Algorithms • Spectre • Phantom GHOST-DAG • Hybrid Chain-based Voting-based Algorithms • Byzcoin • Casper: the friendly finality gadget • Thunderella • Sharding

62 Blockchain Scalability Solutions

• Second Layer Solutions: • Lightening Network • Plasma Network

63 Research Topics

64 Research Topics

• High-throughput, Low-latency, Scalable Consensus Algorithms. • Privacy in Blockchains both in Smart-contracts and Payments. • Multi Party Computations Using Blockchain. • Blockchain Use Cases in of Things.

65 Thank you

66