Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
What is Ethereum about tech layer
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
nakajo2011
January 29, 2020
Programming
430
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What is Ethereum about tech layer
The slide that I talked in BPStudy #149.
https://bpstudy.connpass.com/event/152353/
nakajo2011
January 29, 2020
More Decks by nakajo2011
See All by nakajo2011
Plasma_Overview_gbec20180928.pdf
nakajo2011
0
110
The Ethereum design direction.
nakajo2011
0
100
Report of Devcon5 2019.10.17
nakajo2011
0
670
Compare of Libra and Ethereum
nakajo2011
1
480
What is Move language
nakajo2011
1
1.3k
blockchain-changing-and-issues
nakajo2011
4
590
Thinking Scalability from DEX
nakajo2011
0
130
Truffleの紹介_in_hicon2018.pdf
nakajo2011
3
340
Truffle Test Tips and other
nakajo2011
2
210
Other Decks in Programming
See All in Programming
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
高専キャリア LT 発表内容
crysta1221
6
5.6k
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
280
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
860
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
500
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
3.9k
ソフトウェアラスタライザ
fadis
1
800
業務時間外もAIに働いてもらう話
colorful12
3
10k
ALB ログから Trace を気合で繋げる技術
fohte
7
880
Featured
See All Featured
A better future with KSS
kneath
240
18k
Mobile First: as difficult as doing things right
swwweet
225
10k
Building the Perfect Custom Keyboard
takai
2
870
The Language of Interfaces
destraynor
162
27k
We Have a Design System, Now What?
morganepeng
55
8.3k
Typedesign – Prime Four
hannesfritz
42
3.2k
Building an army of robots
kneath
306
46k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
510
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
The agentic SEO stack - context over prompts
schlessera
0
920
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