Slide 1

Slide 1 text

Plasma Λཧղ͢ΔͨΊͷ Ethereum Protocol ͷΩϗϯ ˏamachino 2018.04.26 Plasmaษڧձ

Slide 2

Slide 2 text

• ౦ژେֶ෺ཧֶՊଔۀɾಉେֶӃதୀ • ࣗ਎ͰͷىۀɺҎདྷελʔτΞοϓാͰԿͰ΋԰ • Ethereum ʹڵຯΛ΋ͪ҉߸௨՟ʗϒϩοΫνΣʔϯք۾΁ • τʔΫϯΤίϊϛʔ࣮ݱͷͨΊʹࠓͰ͖Δ͜ͱΛ໛ࡧத • ΤϯδχΞίϛϡχςΟͷඞཁੑΛײͯ͡ Hi-Ether Λ։ઃ ܦྺ @amachino Akinori Machino

Slide 3

Slide 3 text

ϓ ϥ ζ Ϛ

Slide 4

Slide 4 text

ϓ ϥ ζ Ϛ Ethereum ͷϨΠϠʔٕ̎ज़ͷ̍ͭͰ͋Δ Plasma Λɺཧղ͢ΔͨΊͷ Ethereum Protocol ͷجຊ ࢲ͕࿩͢͜ͱ Plasma ʹ͍ͭͯ͸ޙͷઌੜํ͔Βฉ͜͏ʂ

Slide 5

Slide 5 text

“Ethereum is a World Computer”

Slide 6

Slide 6 text

“Ethereum is a World Computer” ≠ Super Computer

Slide 7

Slide 7 text

ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER EIP-150 REVISION DR. GAVIN WOOD FOUNDER, ETHEREUM & ETHCORE [email protected] Abstract. The blockchain paradigm when coupled with cryptographically-secured transactions has demonstrated its utility through a number of projects, not least Bitcoin. Each such project can be seen as a simple application on a decentralised, but singleton, compute resource. We can call this paradigm a transactional singleton machine with shared-state. Ethereum implements this paradigm in a generalised manner. Furthermore it provides a plurality of such resources, each with a distinct state and operating code but able to interact through a message-passing framework with others. We discuss its design, implementation issues, the opportunities it provides and the future hurdles we envisage. “Transactional Singleton Machine with Shared-State”

Slide 8

Slide 8 text

World State Account State ͷू߹ͱͯ͠ද͞ΕΔ ੈքͷ”ঢ়ଶ” ʮA͞Μ͸10ETH͍࣋ͬͯΔʯ ʮ͜ͷೣͷࣂ͍ओ͸B͞ΜͰ͋Δʯ ʮ͜ͷυϝΠϯʹ͸1ETHͷ஋ஈ͕͍͍ͭͯΔʯ ộ ‣ Externally Owned Accountʢਓؒʣ ‣ Contract AccountʢϓϩάϥϜʣ

Slide 9

Slide 9 text

ࠁʑͱมΘΔʮੈքͷঢ়ଶʯʹ͍ͭͯ ଟ਺ʹ෼ࢄͨ͠ࢀՃऀؒͰ߹ҙΛऔΓଓ͚Δ άϩʔόϧͳγϯάϧτϯϚγϯ

Slide 10

Slide 10 text

State Database World State ͸ϚʔΫϧύτϦγΞ໦ͱͯ͠ه࿥͞ΕΔ ‣ World State ͸ 20 byte ͷ Ethereum ΞυϨεΛ Key ͯ͠ɺ ͦͷΞυϨεͷ Account State Λ Value ʹ࣋ͭσʔλͷू߹ ‣ Account State ʹ͸ɺNonce, Balance, Code, Storage ͷ ̐छྨͷσʔλؚ͕·ΕΔʢEOA ͸ Nonce, Balance ͷΈʣ ‣ ͜ΕΒΛϚʔΫϧύτϦγΞ໦Ͱදݱ͠ɺRLP ͰγϦΞϥΠζ ͨ͠΋ͷ͕ State Databaseʢgeth Ͱ͸ LevelDB Λ࢖༻ʣ ‣ State Database ͸ϒϩοΫνΣʔϯʹ͸ؚ·Εͣɺϧʔτͷ ϋογϡ஋ͷΈ͕ϒϩοΫνΣʔϯϔομʔʹه࿥͞ΕΔ

Slide 11

Slide 11 text

Transaction τϥϯβΫγϣϯʹΑͬͯঢ়ଶ͸มԽ͢Δ State 14c5f8ba:
 - 1024 eth bb75a980:
 - 5202 eth if !contract.storage[tx.data[0]]: contract.storage[tx.data[0]] = tx.data[1] [0, 235235, 0, ALICE … 892bf92f:
 - 0 eth send(tx.value / 3, contract.storage[0]) send(tx.value / 3, contract.storage[1]) send(tx.value / 3, contract.storage[2]) [ALICE, BOB, CHARLIE] 4096ad65:
 - 77 eth State’ 14c5f8ba:
 - 1014 eth bb75a980:
 - 5212 eth if !contract.storage[tx.data[0]]: contract.storage[tx.data[0]] = tx.data[1] [0, 235235, CHARLIE, ALICE … 892bf92f:
 - 0 eth send(tx.value / 3, contract.storage[0]) send(tx.value / 3, contract.storage[1]) send(tx.value / 3, contract.storage[2]) [ALICE, BOB, CHARLIE] 4096ad65:
 - 77 eth Transaction From: 14c5f88a
 To: bb75a980 Value: 10 Data: 2, CHARLIE
 Sig: 30452fdedb3d f7959f2ceb8a1 ộ ộ

Slide 12

Slide 12 text

Transaction-Based State Machine n൪໨ͷϫʔϧυεςʔτ n+1൪໨ͷϫʔϧυεςʔτ ঢ়ଶભҠؔ਺ n൪໨ͷτϥϯβΫγϣϯ S[n+1] = APPLY(S[n], Tx[n]) τϥϯβΫγϣϯϕʔεͷεςʔτϚγϯ S[1] Tx[1] APPLY S[0] Tx[0] APPLY S[2] Tx[n-1] APPLY … S[n] S[n-1]

Slide 13

Slide 13 text

Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻

Slide 14

Slide 14 text

Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx ᶃ5Yͷૹ৴

Slide 15

Slide 15 text

Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx ᶄ5Yͷݕূ

Slide 16

Slide 16 text

Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶅ5Yϓʔϧʹ௥Ճ

Slide 17

Slide 17 text

Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶆ5YΛϐΞʹૹ৴ Tx Tx

Slide 18

Slide 18 text

Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻

Slide 19

Slide 19 text

Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx Tx Tx

Slide 20

Slide 20 text

Tx Tx Tx Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻

Slide 21

Slide 21 text

Tx Tx Tx Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx

Slide 22

Slide 22 text

Tx Tx Tx Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx

Slide 23

Slide 23 text

Tx Tx Tx Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx Tx Tx Tx

Slide 24

Slide 24 text

Tx Tx Tx Tx Tx Tx Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ Tx Tx Tx Tx ֤ϊʔυʹະ࣮ߦτϥϯβΫγϣϯ͕ཷ·͍ͬͯ͘

Slide 25

Slide 25 text

B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ͋Δϊʔυ͕τϥϯβΫγϣϯΛଋͶͯϒϩοΫΛ࡞੒͢Δ ᶃϒϩοΫͷ࡞੒

Slide 26

Slide 26 text

B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶄ5Yͷ࣮ߦ

Slide 27

Slide 27 text

B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶅϒϩοΫΛϐΞʹૹ৴ B B B B

Slide 28

Slide 28 text

B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶆϒϩοΫͷݕূ B B B B

Slide 29

Slide 29 text

B B B B B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ᶇ5Yͷ࣮ߦ τϥϯβΫγϣϯ͕࣮ߦ͞ΕΔ͜ͱͰঢ়ଶ͕มԽ͢Δ

Slide 30

Slide 30 text

B B B B B B B B Propagation of Transactions τϥϯβΫγϣϯͷωοτϫʔΫ΁ͷ఻೻ ϒϩοΫ͕ਁಁ͠৽ͨͳʮੈքͷঢ়ଶʯ͕߹ҙ͞ΕΔ

Slide 31

Slide 31 text

“Ethereum is a World Computer” ≠ Super Computer

Slide 32

Slide 32 text

“Ethereum is a World Computer” ≠ Super Computer ̍ඵ͋ͨΓʹॲཧՄೳͳτϥϯβΫγϣϯ͸ߴʑ15ఔ౓

Slide 33

Slide 33 text

“Ethereum is a World Computer” ≠ Super Computer ̍ඵ͋ͨΓʹॲཧՄೳͳτϥϯβΫγϣϯ͸ߴʑ15ఔ౓

Slide 34

Slide 34 text

Scalability Problem ͳͥϒϩοΫνΣʔϯ͸ॲཧੑೳ͕௿͍ͷ͔ Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx Tx શͯͷϊʔυ͕શͯͷτϥϯβΫγϣϯΛॲཧ͍ͯ͠Δ

Slide 35

Slide 35 text

Blockchain’s Trilemma ϒϩοΫνΣʔϯͷτϦϨϯϚ Decentralization Scalability Security εέʔϧ͢ΔͨΊʹ͸τϨʔυΦϑ͕ൃੜ͢Δ

Slide 36

Slide 36 text

Scalability Solutions ͲΜͳղܾࡦ͕ߟ͑ΒΕ͍ͯΔ͔