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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
nakajo2011
January 29, 2020
Programming
0
390
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
75
The Ethereum design direction.
nakajo2011
0
78
Report of Devcon5 2019.10.17
nakajo2011
0
620
Compare of Libra and Ethereum
nakajo2011
1
460
What is Move language
nakajo2011
1
1.1k
blockchain-changing-and-issues
nakajo2011
4
570
Thinking Scalability from DEX
nakajo2011
0
110
Truffleの紹介_in_hicon2018.pdf
nakajo2011
3
310
Truffle Test Tips and other
nakajo2011
2
180
Other Decks in Programming
See All in Programming
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
6.1k
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
190
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
180
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
120
AtCoder Conference 2025
shindannin
0
1k
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
370
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
530
Python札幌 LT資料
t3tra
7
1.1k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
620
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Patterns of Patterns
denyspoltorak
0
1.3k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
720
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
90
The Cost Of JavaScript in 2023
addyosmani
55
9.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
260
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Designing Powerful Visuals for Engaging Learning
tmiket
0
210
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
Paper Plane
katiecoart
PRO
0
46k
A better future with KSS
kneath
240
18k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
150
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