Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
What is Ethereum about tech layer
Search
nakajo2011
January 29, 2020
Programming
0
360
What is Ethereum about tech layer
The slide that I talked in BPStudy #149.
https://bpstudy.connpass.com/event/152353/
nakajo2011
January 29, 2020
Tweet
Share
More Decks by nakajo2011
See All by nakajo2011
Plasma_Overview_gbec20180928.pdf
nakajo2011
0
65
The Ethereum design direction.
nakajo2011
0
68
Report of Devcon5 2019.10.17
nakajo2011
0
600
Compare of Libra and Ethereum
nakajo2011
1
440
What is Move language
nakajo2011
1
1.1k
blockchain-changing-and-issues
nakajo2011
4
560
Thinking Scalability from DEX
nakajo2011
0
98
Truffleの紹介_in_hicon2018.pdf
nakajo2011
3
300
Truffle Test Tips and other
nakajo2011
2
170
Other Decks in Programming
See All in Programming
Developer Joy - The New Paradigm
hollycummins
1
390
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
330
CSC509 Lecture 08
javiergs
PRO
0
270
data-viz-talk-cz-2025
lcolladotor
0
100
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
110
contribution to astral-sh/uv
shunsock
0
570
オープンソースソフトウェアへの解像度🔬
utam0k
18
3.2k
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
1k
外接に惑わされない自システムの処理時間SLIをOpenTelemetryで実現した話
kotaro7750
0
130
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
430
CSC305 Lecture 11
javiergs
PRO
0
320
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
1
150
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Code Review Best Practice
trishagee
72
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Why Our Code Smells
bkeepers
PRO
340
57k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Building an army of robots
kneath
306
46k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Unsuck your backbone
ammeep
671
58k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Transcript
What_is_Ethereum_tech編 2020.01.28
Copyright © 2019 chaintope Inc. All rights reserved. 自己紹介 2
• Yukishige Nakajo • 株式会社chaintope Chief Ethereum Researcher • 福岡県の飯塚市でEthereumの研究中 • Rust, EVM, 主にEth1.0 • https://twitter.com/nakajo https://y-nakajo.hatenablog.com/ • マスタリング・イーサリアム技術監修
Copyright © 2019 chaintope Inc. All rights reserved. What_is_Ethereum_tech編 3
1. マスタリング・イーサリアムの紹介 2. ブロックチェーンとは 3. Ethereumとは 4. ブロックチェーンの利点
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumを取り巻く環境 4
Platformとしての性質をも つブロックチェーンである ため、非常に多岐にわた る分野で使われている。
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumを簡単に説明すると。。。 5
• 任意のプログラム実行環境であり • プログラムの状態を保存するDBでもある。 • 誰でもプログラムを登録でき、誰でも実行できる。(手数料さえ払えば)
Copyright © 2019 chaintope Inc. All rights reserved. Dappsとは? 6
スマートコントラクトでデータの正当 性を検証・登録 データを誰にも改ざんできない 安全なDB WebAppでリッチなUXを提供 Walletを介してアクセス
Copyright © 2019 chaintope Inc. All rights reserved. より詳しい話はマスタリング・イーサリアムで! 7
• 2章 イーサリアムの基礎 • 6章 トランザクション • 12章 非中央集権型アプリケーショ ン(DApp) etc….
Copyright © 2019 chaintope Inc. All rights reserved. What_is_Ethereum_tech編 8
1. マスタリング・イーサリアムの紹介 2. ブロックチェーンとは 3. Ethereumとは 4. ブロックチェーンの利点
Copyright © 2019 chaintope Inc. All rights reserved. ブロックチェーンとは? 9
p2p network • p2p network上に構築されたシステム。 • 誰でも参加可能で、全員が同じデータを保持する。 node: ブロックチェーンのデータを検証・転送 するプログラム。
Copyright © 2019 chaintope Inc. All rights reserved. BlockとTransaction 10
• Transactionはブロックチェーンの状態を新しい状態に変更するトリガー ex) Bitcoinではtxの支払い状態 ex) Ethereumではスマートコントラクト実行結果 • Blockは各node間でコンセンサスを取るため のデータの塊。 • Blockごとに、データを改変されないようにtx の集合に対するproof(Merkle Root Hash) が付与される。
Copyright © 2019 chaintope Inc. All rights reserved. Blockについてその2 11
• Blockはシーケンシャルな順番を持 つ。 • LinkedListなデータ構造(ただし、変 更はO(2^n) ) • Blockの繋がりは状態変化の歴史で もある。
Copyright © 2019 chaintope Inc. All rights reserved. Mining (Proof
of Work)とは 12 • Block Headerからある条件を満たすHash値を見つけるゲーム。 • Difficulty調整でブロック生成時間を調整。 • nonceの値を変えながらなんどもHash値を作成。
Copyright © 2019 chaintope Inc. All rights reserved. Fork choice
rule 13 • ブロックがいくつ積み上がったか?で正統な歴史が決まる。 • 一般的に6ブロック積み上がると状態が99%以上の確率で確定した (書き換え不可能)とみなされる。(確率的フィナリティー) • ある時のブロックの内容を書き換えるにはそのブロックの上に積み上 がっているブロックのhash値を計算し直す必要がある。
Copyright © 2019 chaintope Inc. All rights reserved. コンセンサスアルゴリズム 14
• Bitcoinなどで使われているのは正式にはサトシ・ナカモトコンセンサス と呼ばれる。 • Byzantine Fault Toleranceと混じって説明されるが、そもそも母数が 未定なネットワークではBFTは使えない(悪意のあるノードが1/3なのか がわからないので。。。) • PoWはあくまでブロック生成条件であり、コンセンサスではない。 • この2つの他に、txが2重支払いしていないか?などもコンセンサスの ルールとして含まれる。
Copyright © 2019 chaintope Inc. All rights reserved. What_is_Ethereum_tech編 15
1. マスタリング・イーサリアムの紹介 2. ブロックチェーンとは 3. Ethereumとは 4. ブロックチェーンの利点
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumのとは? 16
• 最終的な各Accountの状態を共有するためのブロックチェーン。 • Accountは残高(ETH)やプログラムコードや、プログラムの実行結果など様々な 状態を持つ。
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumのアカウント構造 17
• Code Hash: Contractの本体コードの Hash値。 • Storage Root Hash: Contractに保存さ れたデータのMerkle Root Hash値。 • Nonce: このアカウントが発行したTransaction数。 • Balance: このアカウントが保有しているETHの量。
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumのアカウントの種類 18
• External Owned Account ◦ 秘密鍵を持つAccount。Transactionの発行は必ずEOAから行われる。 • Contract Account ◦ CodeとStorageも持つ。 ◦ Contractを作成した時に生成されるAccount。 ◦ NonceはこのAccountから新しいContractを生成した時にインクリメントされる。
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumのトランザクション 19
• TransactionはState情報を書き換えるトリガー。 • Ethereumが保有しているAccount情報が書き換わる。 • EthereumのStateはAccount情報の集合。つまり、Transactionを発行すると Ethreumが新しいStateへと変化する。
Copyright © 2019 chaintope Inc. All rights reserved. 送金Transaction 20
• 送信元(from)のAccountと送信先(to)のアカウントのbalanceが変わ る。 • 送信元のAccount addressは署名から復元できる。 • 送信先(to)が初めてアクセスするaddressの場合そのタイミングで Account領域が確保される。
Copyright © 2019 chaintope Inc. All rights reserved. スマートコントラクト生成Transaction 21
• to: 0x00000...00 の全て0のaddress宛に送ると、新しいスマートコントラクト が生成される。 • transactionに生成するスマートコントラクトの本体コードを載せる。 • このコードが新しいAccountとして生成された領域に保存される。 • Account addressはHash(from address + nonce)となる。 • 同じコードでも違うAccountとして生成される。 ◦ つまり、一度生成されたスマートコントラクトはImmutable codeはコピーされ保存される
Copyright © 2019 chaintope Inc. All rights reserved. スマートコントラクト実行Transaction 22
実行結果を反映 • Toが呼び出したいスマートコントラクトのaddress • Data部に呼び出す関数の識別IDと関数に渡す引数を指定 • 実行結果はAccountのStorageに保存される。 • スマートコントラクトから他のスマートコントラクトを呼ぶことも可能。その場合 は複数のAccountの情報が書き換わる。
Copyright © 2019 chaintope Inc. All rights reserved. Ethereumのブロック構造 23
Merkle Patricia Trie • Account情報の集合がEthereumのStateである。 • EthereumはStateのcommitmentを持つ。 • そのため、Block検証には今まで保存された全ての State情報が必要となる。 • Block生成は約15秒間隔。
Copyright © 2019 chaintope Inc. All rights reserved. マークルパトリシアトライ(Merkle Patricia
Trie) 24 https://blog.ethereum.org/2019/12/30/eth1x-files-state-of-stateless-ethereum/ より • Stateデータの増加=パトリシアトライの成長= Key-Valueストアの増加。 • アカウント情報を取得する時はパトリシアトライの探索と、 Key-Valueストアに対する フェッチが発生。 => Stateの増加が処理速度低下につながる。 • Merkle Root Hashの算出が高速。O(log_16 n)
Copyright © 2019 chaintope Inc. All rights reserved. What_is_Ethereum_tech編 25
1. マスタリング・イーサリアムの紹介 2. ブロックチェーンとは 3. Ethereumとは 4. ブロックチェーンの利点
Copyright © 2019 chaintope Inc. All rights reserved. ブロックチェーンの特性 26
p2p network • 高可用性(書き換えは遅いけど、参照は無限のスケール) • データ変更の履歴が書き換え不可能な形で保存 • 署名検証によるデータ完全性の担保 ◦ 履歴を追える どこに問い合わせても 同じDataを返す。
Copyright © 2019 chaintope Inc. All rights reserved. ブロックチェーンを活用する利点 27
p2p network • Proofデータが広く残る。 • 透明な取引情報を記録可能 ◦ サービス管理者がデータ書き換えを行ったかどうかを検知可能。 • データの出どころを保証する場合に有効。 どこに問い合わせても 同じDataを返す。
株式会社chaintope 代表取締役社長 正田英樹 福岡県飯塚市幸袋560-8
[email protected]
28