Hierarchical interac,ons between Ethereum m sma mart contracts - - PowerPoint PPT Presentation

hierarchical interac ons between ethereum m sma mart
SMART_READER_LITE
LIVE PREVIEW

Hierarchical interac,ons between Ethereum m sma mart contracts - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

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

slide-2
SLIDE 2

Background Knowledge

  • What is Ethereum Blockchain?

2

slide-3
SLIDE 3

Background Knowledge

  • What is Smart Contract?

3

slide-4
SLIDE 4

Background Knowledge

  • Ether(ETH) vs. Gas

4

slide-5
SLIDE 5

Background Knowledge

  • What is Test Networks (testnets)?

5

slide-6
SLIDE 6

Background Knowledge

  • What is a dApp (decentralized applicaRon)?

6

Add a pic of DApp

slide-7
SLIDE 7

The Problem

  • Smart contracts cannot share common states
  • Our proposal:

7

slide-8
SLIDE 8

Exis,ng Alterna,ves

  • Smart Contract Inheritance
  • Share logic, not data

8

slide-9
SLIDE 9

Exis,ng Alterna,ves

  • Libraries
  • Share logic, not data

9

slide-10
SLIDE 10

Comparison with DApp

10

DApps can access everything on the client contracts Custodian contracts can only access the shared state of the client contracts

slide-11
SLIDE 11

Use Case - eTickets

11

slide-12
SLIDE 12

Use Case

12

  • Custodian Contract (movie company) creates client

contracts as Rckets

slide-13
SLIDE 13

Use Case

13

  • Alice buys Rcket
  • Client contract ownership transfers from movie seller to

Alice

slide-14
SLIDE 14

Use Case

14

  • Alice sells her Rcket to Bob
  • Client contract transfers Rcket ownership from Alice to

Bob

slide-15
SLIDE 15

Use Case

15

  • Movie Rcket expiring Rme changed
  • Custodian contract changes the shared variable

“expireTime” in every client contract

slide-16
SLIDE 16

Technology Used

  • Ethereum Blockchain and Solidity
  • Testnets
  • Ropsten (196 nodes | PoW)
  • Rinkeby (49 nodes | PoA)
  • Kovan (145 nodes | PoA)
  • MetaMask
  • The Truffle Framework

16

slide-17
SLIDE 17

Experiments

  • Latency
  • Deployment
  • Shared state update
  • Gas Usage
  • Deployment
  • Shared state update

17

slide-18
SLIDE 18

Deployment latency

18

slide-19
SLIDE 19

Deployment latency per contract

Client Contract Deployment EffecRve Latency across testnets

19

slide-20
SLIDE 20

Deployment gas usage

Client Contract Deployment Gas Usage on Ropsten testnet

20

slide-21
SLIDE 21

State muta,on

Shared state mutaRon latency across Ethereum testnets

21

sec

slide-22
SLIDE 22

State muta,on gas usage

Shared state mutaRon gas usage on Ropsten testnet

22

slide-23
SLIDE 23

Max number of clients that can be mutated at once

Maximum batch size of shared state mutaRon across testnets

23

slide-24
SLIDE 24

Conclusion

  • Hierarchical structure of Ethereum smart contract

can allow shared states between contracts!

24

slide-25
SLIDE 25

Any ques;ons? yhuag@ust.hk

25

slide-26
SLIDE 26

Back up Slides

26

slide-27
SLIDE 27

Experiments (1)

Custodian Contract Deployment Latency across Testnets

27

sec

slide-28
SLIDE 28

Experiments (2)

Custodian Contract Deployment Gas Usage across testnets

28

slide-29
SLIDE 29

Experiments (3)

Client Contract Deployment Total Latency across testnets

29

sec

slide-30
SLIDE 30

Experiments (6)

Shared state mutaRon latency across Ethereum testnets

30

sec

slide-31
SLIDE 31

Experiments (7)

Shared state mutaRon average latency across Ethereum testnets

31

slide-32
SLIDE 32

Experiments (8)

Shared state mutaRon gas usage on Ropsten testnet

32

slide-33
SLIDE 33

State muta,on per contract

Shared state mutaRon average latency across Ethereum testnets

33

slide-34
SLIDE 34

Solu,on Breakdown - Architecture

34

slide-35
SLIDE 35

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