Chainspace: A Sharded Smart Contract Platform Authors Mustafa Al-Bassam * Alberto Sonnino * Shehar Bano * Dave Hrycyszyn † George Danezis * Published in NDSS ‘18 * University College London † constructiveproof.com Binary District Meetup, London
Motivation ▪ Blockchains are cool — but scale badly visa 2000 TPS ▪ Hard to operate on secret inputs Transactions are Smart contracts are recorded on chain public
Introduction ▪ What is Chainspace? contribution I Scalable smart contract platform contribution II Supporting PETs by Design
Contents .3. Scalability .1. System Overview .2. Privacy by Design .4. Security Properties .5. Performances
System Overview ▪ How does Chainspace work? ▪ Everything in Chainspace is an object ▪ For example: a bank account, a hotel room, a train seat ▪ Objects are either active , inactive , or nonexistant ▪ Only active objects can be used in transactions Object 2 Object 1 Balance - 5 Alice’s wallet Alice’s wallet Balance: 10 Balance: 5 Chainspace transaction Object 1: inactive Object 1: active Object 2: nonexistant Object 2: active
System Overview ▪ How does Chainspace work? ▪ Everything in Chainspace is an object ▪ For example: a bank account, a hotel room, a train seat ▪ Objects are either active , inactive , or nonexistant ▪ Only active objects can be used in transactions Object 2 Object 1 Reserve train seat Train seat #33 Train seat #33 Free Taken by Alice Chainspace transaction Object 1: inactive Object 1: active Object 2: nonexistant Object 2: active
System Overview ▪ How does Chainspace work? ▪ Nodes are organised into shards ▪ Shards manage objects ▪ Objects can be used only once
Privacy by Design .3. Scalability .1. System Overview .2. Privacy by Design .4. Security Properties .5. Performance
Privacy by Design ▪ What are Chainspace Smart Contract? user side execution checker node side
Privacy by Design ▪ What are Chainspace Smart Contract? execution user node execution checker checker input input & output objects objects output or objects
Privacy by Design ▪ How are smart contract executed? execution checker ❺ contract inputs outputs & invalidate inputs ❶ user node ❸ transaction inputs proof of execution ❹ ❷ parameters execution checker outputs …
Privacy by Design ▪ Private data never leaves the client! user private data ❶ — secret key — ❷ execution — zk-proof — node ❸ checker — verify zk-proofs —
Privacy by Design ▪ How to map objects to shards? The smart contracts decide! shard 1 shard 2
Scalability .3. Scalability .1. System Overview .2. Privacy by Design .4. Security Properties .5. Performance
Scalability ▪ We split the blockchain to multiple shards.
Scalability ▪ What is the train-and-hotel problem? Travel agent Book hotel Book train room #12 seat #33 in shard 1 in shard 2
Scalability ▪ What is the train-and-hotel problem? Travel agent Book hotel Book train room #12 seat #33 ✘ ✔ in shard 1 in shard 2 Book hotel room #12 in shard 1 ✔
Scalability ▪ How nodes reach consensus? The S-BAC Protocol Byzantine Atomic Agreement Commit lock unlock user Shard 1 (manage o1) Shard 2 (manage o2) Shard 3 (manage o3)
Scalability ▪ The Wisdom behind S-BAC Only shards managing o1 and o2 Shard 1 and shard 2 can work in are working parallel user Shard 1 (manage o1) Shard 2 (manage o2) Shard 3 (manage o3)
Security Properties .3. Scalability .1. System Overview .2. Privacy by Design .4. Security Properties .5. Performance
Security Properties ▪ What does Chainspace guarantee? ▪ Honest Shard (HS): among 3f+1 nodes, at most f are malicious. ▪ Malicious Shard (DS): over f dishonest nodes. ▪ Chainspace properties: Encapsulation (HS & DS) Transparency (HS & DS) Anyone can authenticate the history of A smart contract cannot interfere with transactions and objects that led to the objects created by another contract creation of an object. (except if defined by that contract). Integrity (HS) Non-Repudiation (HS & DS) Misbehaviour is detectable: there are Only valid & non-conflicting transactions evidences of misbehaviour pointing to will be executed. the faulty parties or shards.
Performance .3. Scalability .1. System Overview .2. Privacy by Design .4. Security Properties .5. Performance
Performance ▪ What did we implemented? Deployed and tested on S-BAC protocol Amazon AWS implemented in Java Based on BFT-SMaRt Python contract Everything is released as open source software environment https://github.com/chainspace 1. Helps developers 2. Simulation of the checker 3. No need for full deployment
Performance ▪ How the number of shards influence the TPS? TPS VS Number of Shards (standard setup: 2 shards, 4 nodes/shard, 20 runs/data point)
Performance ▪ How does the size of the shard influence the TPS? TPS VS Nodes per Shard (standard setup: 2 shards, 4 nodes/shard, 20 runs/data point)
Performance ▪ How the number of inputs influence the TPS? TPS VS Number of Inputs (standard setup: 2 shards, 4 nodes/shard, 20 runs/data point)
Performance ▪ How does the latency vary under different system loads? Probability VS Latency (standard setup: 2 shards, 4 nodes/shard, 20 runs/data point)
Conclusions ▪ What else is in the paper? Cross shard transactions Real world applications (smart metering, …) Smart contracts benchmarking And much more… https://arxiv.org/abs/1708.03778
Conclusions ▪ What did we talk about? contribution I Scalable smart contract platform contribution II Supporting PETs by Design
Conclusions ▪ Main take-aways sharding scalability execution privacy / checker by design
Conclusions ▪ Future Works 1. How to recover from malicious shards? 2. How can a smart contract creator avoid dishonest shards?
Conclusions ▪ Future Works 3. How to bootstrap the system? 4. How to incentivise nodes?
Thank you for your attention Questions? Mustafa Al-Bassam m.albassam@cs.ucl.ac.uk
Recommend
More recommend