Hierarchical interac,ons between Ethereum m sma mart contracts across Te Testnets Yao-Chieh Hu, Ting-Ting Lee, Dimitris Chatzopoulos, Pan Hui yhuag@ust.hk, tleeae@ust.hk, dcab@cse.ust.hk, panhui@cse.ust.hk The Hong Kong University of Science and Technology 1
Background Knowledge • What is Ethereum Blockchain? 2
Background Knowledge • What is Smart Contract? 3
Background Knowledge • Ether(ETH) vs. Gas 4
Background Knowledge • What is Test Networks (testnets)? 5
Background Knowledge • What is a dApp (decentralized applicaRon)? Add a pic of DApp 6
The Problem • Smart contracts cannot share common states • Our proposal: 7
Exis,ng Alterna,ves • Smart Contract Inheritance • Share logic, not data 8
Exis,ng Alterna,ves • Libraries • Share logic, not data 9
Comparison with DApp DApps can access everything on the client Custodian contracts can only access the contracts shared state of the client contracts 10
Use Case - eTickets 11
Use Case • Custodian Contract (movie company) creates client contracts as Rckets 12
Use Case • Alice buys Rcket • Client contract ownership transfers from movie seller to Alice 13
Use Case • Alice sells her Rcket to Bob • Client contract transfers Rcket ownership from Alice to Bob 14
Use Case • Movie Rcket expiring Rme changed • Custodian contract changes the shared variable “ expireTime ” in every client contract 15
Technology Used • Ethereum Blockchain and Solidity • Testnets • Ropsten (196 nodes | PoW) • Rinkeby (49 nodes | PoA) • Kovan (145 nodes | PoA) • MetaMask • The Truffle Framework 16
Experiments • Latency • Deployment • Shared state update • Gas Usage • Deployment • Shared state update 17
Deployment latency 18
Deployment latency per contract Client Contract Deployment EffecRve Latency across testnets 19
Deployment gas usage Client Contract Deployment Gas Usage on Ropsten testnet 20
State muta,on sec Shared state mutaRon latency across Ethereum testnets 21
State muta,on gas usage Shared state mutaRon gas usage on Ropsten testnet 22
Max number of clients that can be mutated at once Maximum batch size of shared state mutaRon across testnets 23
Conclusion • Hierarchical structure of Ethereum smart contract can allow shared states between contracts! 24
Any ques;ons? yhuag@ust.hk 25
Back up Slides 26
Experiments (1) sec Custodian Contract Deployment Latency across Testnets 27
Experiments (2) Custodian Contract Deployment Gas Usage across testnets 28
Experiments (3) sec Client Contract Deployment Total Latency across testnets 29
Experiments (6) sec Shared state mutaRon latency across Ethereum testnets 30
Experiments (7) Shared state mutaRon average latency across Ethereum testnets 31
Experiments (8) Shared state mutaRon gas usage on Ropsten testnet 32
State muta,on per contract Shared state mutaRon average latency across Ethereum testnets 33
Solu,on Breakdown - Architecture 34
Architecture • Custodian contract • Supervise, track and manage Client contracts • Client contract • Only be created from its Custodian contract • Only shared states are externally modifiable 35
Recommend
More recommend