rapidchain scaling blockchain via full sharding
play

RapidChain: Scaling Blockchain via Full Sharding Mahdi Zamani Visa - PowerPoint PPT Presentation

RapidChain: Scaling Blockchain via Full Sharding Mahdi Zamani Visa Research Join work with Mahnush Movahedi , Dfinity Mariana Raykova , Yale University Stanford Blockchain Seminar Modified by Xinyuan Sun (sxysun@ucdavis.edu) August 2018


  1. RapidChain: Scaling Blockchain via Full Sharding Mahdi Zamani Visa Research Join work with Mahnush Movahedi , Dfinity Mariana Raykova , Yale University Stanford Blockchain Seminar Modified by Xinyuan Sun (sxysun@ucdavis.edu) August 2018

  2. Agenda � Part I: Consensus Protocols � Traditional mechanisms � Blockchain consensus � Part II: RapidChain [ CCS 2018] � Sharding-based consensus � Protocol overview � Results

  3. Part I: Consensus Protocols

  4. Blockchain Consensus (since 2008) � Atomic broadcast [HT93] � Total Order � An honest node receives � � before � � iff sender sends � � before � � � Open membership Transaction 1 Transaction 2 �

  5. Open Membership Setting � Sparsely-connected network ( e.g. , peer-to-peer) � New nodes can join/leave (churn) � Sybil rate limited via PoW

  6. Bitcoin: Too Much of a Good Thing � Sacrifices scalability for decentralization � Permissioned blockchain? � A closed group of servers run the consensus protocol � Membership isn’t the bottleneck � Full replication scales out in a cluster but not between datacenters/Internet nodes � High round-trip time (~200ms vs <1ms)

  7. Full Replication Doesn’t Scale � Inherently inefficient and unscalable � � � � communication and computation needed � More nodes, higher message latency � Gossiping a 2 MB message to 90% of 4,000 nodes takes ~50 sec # bits exchanged # participants ( � )

  8. How much redundancy is really needed ? � To tolerate faults and attacks? � Bitcoin and Ethereum create 4,000+ replicas

  9. Part II: RapidChain

  10. Sharding-Based Consensus � Elect a set of random committee of nodes � Each committee runs consensus on behalf of all � And, maintains a disjoint ledger � Throughput increases linearly with # nodes

  11. Full Sharding Computation Storage Communication

  12. Sharding Challenges � Electing small committees via probabilistic sampling process � Reconfiguration to avoid Sybil attack � Cross-shard transactions � Verify transactions located in other committees � Decentralized bootstrapping* � Establish PKI without initial randomness, CRS, etc.

  13. Our Goals/Achievements � Higher throughput (7300 tx/sec) � Sublinear communication per tx � 6-10x faster fast committee consensus � Higher resiliency � RapidChain : � � ��� , previous work [LNZ+16, KJG+18] : � � ��� � Provable reconfiguration � Based on Cuckoo rule [AS06] � Decentralized bootstrapping RapidChain: � � � , previous work: � � �

  14. Network Model � � nodes each with a key pair �� � � �� � � � committees ( a.k.a., shards) � P2P network with gossiping � Bounded message delay � Known fixed delay, � � Similar to Bitcoin

  15. Threat Model � � � ��� Byzantine nodes at any moment � Slowly-adaptive adversary [PS16, KJG+18] 5% churn rate

  16. Epochs and Iterations … Reconfiguration Reconfiguration Bootstrap Consensus Consensus Epoch Iteration

  17. RapidChain Overview � Proceed in epochs � First epoch: Bootstrap a reference committee � Creates epoch randomness � Creates a reconfiguration block in every epoch � Epoch randomness � Samples sharding committees � New nodes join the system � Re-organize existing committees

  18. RapidChain Overview (cont’d) � Each users sends its tx to some arbitrary node � tx is routed to the output committee, � ��� � Members of � ��� create a block � Cross-shard verification � Verify input transactions of tx � Batch requests based on input committees � Forward them via an inter-committee routing protocol

  19. Sharded Consensus … Bootstrap Consensus Reconfiguration Consensus Reconfiguration \ Epoch Iteration … … …

  20. Sharded Consensus … Bootstrap Consensus Reconfiguration Consensus Reconfiguration Epoch Iteration … … …

  21. Committee Size � How large should the committees be? � Depends on the intra-committee consensus protocol � Higher committee resiliency � Smaller committee � 4,000 nodes � 16 committees of size 250 � 100 committees of size 40

  22. Sampling Error � Using hypergeometric distribution 1E+00 1E-01 1E-02 Failure Probability 1E-03 1E-04 1E-05 1E-06 1/3 to 1/2 (RapidChain) 1/4 to 1/3 (Previous work) 1E-07 1/5 to 1/3 1E-08 0 20 40 60 80 100 120 140 160 180 200 220 240 Committee Size

  23. Consensus in Committees � Gossiping a 2-MB block in a 250-node committee takes � �� sec � Idea: Gossip the block, then agree on the hash of the block …

  24. Gossiping Large Blocks � Information dispersal algorithm (IDA) [R89] � Encode � into � chunks � � � � � � � using an erasure coding mechanism � Give each neighbor ��� chunks ( � is the node degree) � � can be reconstructed from any set of � � � � chunks � ECC blowup � 2.7x � New gossip time: 2.6 sec � Gossip latency reduction � 5.3x

  25. Gossiping Merkle Hash � Compute a Merkle tree over chunks � � � � � � � � Send chunks along with Merkle proofs ���� � � ���� � � ���� � � ���� � � � � � � � � � �

  26. Gossiping Merkle Hash � Compute a Merkle tree over chunks � � � � � � � � Send chunks along with Merkle proofs ���� � � ���� � � ���� � � ���� � � � � � � � � � �

  27. ' enter y Consensus in Committees Cross Shard Transactions � Gossiping a 2-MB block in a 250-node committee takes � �� sec - UTXO and transaction splitting is hard , ↳ shards ) � Idea: Gossip the block, then agree on the hash of the block ( shard at shard , TX z tix , in a e t a tx tr tix 3 … Ctx )

  28. Consensus in Committees Inter-committee Routing � Gossiping a 2-MB block in a 250-node committee takes � �� sec Log n committee � Idea: Gossip the block, then agree on the hash of the block Gossiping Merkle Hash Log log n nodes …

  29. Handling Join-Leave Attacks � Cuckoo rule [AS06] � Assign the new node to a random shard � Evict � nodes from the shard � Bounded Cuckoo rule

  30. Handling Join-Leave Attacks � Cuckoo rule [AS06] � Assign the new node to a random shard � Evict � nodes from the shard � Bounded Cuckoo rule

  31. Handling Join-Leave Attacks � Cuckoo rule [AS06] � Assign the new node to a random shard � Evict � nodes from the shard � Bounded Cuckoo rule

  32. Handling Join-Leave Attacks � Cuckoo rule [AS06] � Assign the new node to a random shard � Evict � nodes from the shard � Bounded Cuckoo rule

  33. Experimental Setup � Prototype implemented in Go � Link latency of 100 ms � Node bandwidth of 20 Mbps � 2 MB blocks ( 4096 tx/block , 512 B/tx ) � Corruption model � 49% of leaders equivocate in the same iteration � 49% of nodes do not participate in gossips ( i.e. , remain silent)

  34. Synchronous Round Time-Out � � � ��� ms � Latency of gossiping an 80-byte message in a committee of size 250 525 Maximum Average 475 Median Latency (ms) 425 375 325 275 100 125 150 175 200 225 250 Committee Size

  35. Throughput vs n 7384 8000 7031 Transactions per Second 7000 6180 6000 5177 4676 5000 3726 4000 2744 3000 1750 2000 1000 0 500 1000 1500 2000 2500 3000 3500 4000 [145] [175] [190] [200] [225] [225] [230] [250] Number of Nodes [Committee Size]

  36. Latency vs n 80 9.9 70.4 70.6 70.7 70.0 69.8 69.1 67.9 70 User-Perceived Latency (sec) Confirmation Latency (sec) 9.6 60 9.3 50 9.0 8.84 8.83 8.80 40 8.75 8.72 32.2 8.64 8.7 8.49 30 User-Perceived Latency 8.4 20 8.04 Confirmation Latency 8.1 10 0 7.8 500 1000 1500 2000 2500 3000 3500 4000 Number of Nodes

  37. Impact of Block Size 9000 35.00 Throughput 7384 8000 30.00 Latency Transactions per Second 7000 25.00 6000 Latency (sec) 20.00 5000 4000 15.00 3000 10.00 8.84 2000 5.00 1000 0 0.00 128 256 512 1024 2048 4096 8192 Block Size (KB)

  38. Where do we stand? Shard Time to Protocol #Nodes Resiliency TPS Latency Storage Size Failure ��� Elastico 1,600 40 800 sec 1x 100 1 hour ��� OmniLedger 1,800 500 14 sec 1/3x 600 230 years ��� OmniLedger 1,800 3,500 63 sec 1/3x 600 230 years ��� RapidChain 1,800 4,220 8.5 sec 1/9x 200 1,950 years ��� RapidChain 4,000 7,380 8.7 sec 1/16x 250 4,580 years

Recommend


More recommend