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
340
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
55
The Ethereum design direction.
nakajo2011
0
57
Report of Devcon5 2019.10.17
nakajo2011
0
580
Compare of Libra and Ethereum
nakajo2011
1
440
What is Move language
nakajo2011
1
1k
blockchain-changing-and-issues
nakajo2011
4
550
Thinking Scalability from DEX
nakajo2011
0
91
Truffleの紹介_in_hicon2018.pdf
nakajo2011
3
280
Truffle Test Tips and other
nakajo2011
2
160
Other Decks in Programming
See All in Programming
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
190
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
300
Gleamという選択肢
comamoca
6
760
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
110
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
140
エラーって何種類あるの?
kajitack
5
290
ドメインモデリングにおける抽象の役割、tagless-finalによるDSL構築、そして型安全な最適化
knih
11
2k
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
120
エンジニア向け採用ピッチ資料
inusan
0
160
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
30k
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
230
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
140
Featured
See All Featured
Visualization
eitanlees
146
16k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Scaling GitHub
holman
459
140k
It's Worth the Effort
3n
185
28k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
The Invisible Side of Design
smashingmag
299
51k
Being A Developer After 40
akosma
90
590k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
33
5.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
700
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
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