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
Ethereum 入門 / Introduction to Ethereum
Search
Kenji Saito
PRO
August 23, 2023
Technology
0
110
Ethereum 入門 / Introduction to Ethereum
2023年8月23日(水)、ブロックチェーンハブ主催のブロックチェーンアカデミーにて使用したスライドです。
Kenji Saito
PRO
August 23, 2023
Tweet
Share
More Decks by Kenji Saito
See All by Kenji Saito
コバヤシマルテスト ─ 勝ち目のないゲームに抗いながら旅する心の旅路 / Kobayashi Maru Test - a mental journey of defiance against a game that cannot be won
ks91
PRO
0
3
セキュリティ戦略・発表と総括 / Security Strategies, Presentation and Conclusions
ks91
PRO
1
31
暗号資産の経済学・イントロダクション / Economics of Cryptocurrencies (Introduction)
ks91
PRO
0
20
AI とデジタルトランスフォーメーション / AI and Digital Transformation
ks91
PRO
0
10
インシデントレスポンス演習 II / Incident Response Exercise II
ks91
PRO
0
36
A思考の自動化とX 思考の行方 / Automation of A Thinking and the Future of X Thinking
ks91
PRO
0
23
サイバー戦の現在と未来 / Present and Future of Cyber Warfare
ks91
PRO
0
69
サイバー攻撃・防御とサイバー法 / Cyber Attacks, Defenses and Cyber Law
ks91
PRO
0
50
インシデントレスポンス演習I / Incident Response Exercise I
ks91
PRO
0
65
Other Decks in Technology
See All in Technology
AutomatedLabを使って内部ペンテストを勉強しよう! -やられ社内ネットワークの自動構築-
n_etupirka
1
610
GoとアクターモデルでES+CQRSを実践! / proto_actor_es_cqrs
ytake
1
160
コンテナ・K8s研修 - 前半 コンテナ基礎・ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
170
「単なる OAuth 2.0 を認証に使うと、車が通れるほどのどでかいセキュリティー・ホールができる」のか検証してみた
terara
0
380
サービス開発を前に進めるために 新米リードエンジニアが 取り組んだこと / Steps Taken by a Novice Lead Engineer to Advance Service Development
nologyance
0
180
AOAI Dev Day LLMシステム開発 Tips集
hirosatogamo
15
3.8k
サーバーレスAPI(API Gateway+Lambda)とNext.jsで 個人ブログを作ろう!
shuntaka
PRO
0
560
Flutter研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
160
Luupの開発組織におけるインシデントマネジメントの変遷 ver.RoadtoSRENEXT2024
grimoh
1
270
ペパボのオブザーバビリティ研修2024 説明資料
kesompochy
0
1.1k
DDDにおける認可の扱いとKotlinにおける実装パターン / authorization-for-ddd-and-kotlin-implement-pattern
urmot
4
390
AWSで”最小権限の原則”を実現するための考え方 /20240722-ssmjp-aws-least-privilege
opelab
10
4.4k
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
46
7k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
18
1.2k
In The Pink: A Labor of Love
frogandcode
139
22k
Making Projects Easy
brettharned
111
5.7k
The Mythical Team-Month
searls
217
43k
The MySQL Ecosystem @ GitHub 2015
samlambert
248
12k
How GitHub Uses GitHub to Build GitHub
holman
471
290k
GitHub's CSS Performance
jonrohan
1026
450k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Transcript
1 Ethereum CSO /
[email protected]
— 1 Ethereum — 2023-08-23
– p.1/33
https://speakerdeck.com/ks91 — 1 Ethereum — 2023-08-23 – p.2/33
( ) SFC ( ) CSO (Chief Science Officer) 1993
( ) 2006 ( ) SFC 22 P2P (Peer-to-Peer) 2011 ( ) 2018 2019 VR 2021.9 & VR 2022.3 2023 AI VR&RPG 2023.5 “Don’t Be So Serious” VOXEL 2023.7 DAZE 2023 → ( ) — 1 Ethereum — 2023-08-23 – p.3/33
1 Ethereum BBc (Beyond Blockchain) — 1 Ethereum — 2023-08-23
– p.4/33
1. Ethereum 2. Ethereum 3. Ethereum 4. — 1 Ethereum
— 2023-08-23 – p.5/33
1. Ethereum — 1 Ethereum — 2023-08-23 – p.6/33
Ethereum Vitalik Buterin, “Ethereum White Paper: A NEXT GENERATION SMART
CONTRACT & DECENTRALIZED APPLICATION PLATFORM” 12 ( 12 ) (= ) = ⇒ → Dapps ( / / ) — 1 Ethereum — 2023-08-23 – p.7/33
2. Ethereum macOS (Big Sur 11.6.4, Monterey 12.6.7) + Homebrew
Linux (Ubuntu 22.04) (x86/AMD64 (and ARM)) Windows 10 + Windows Subsystem for Linux (Ubuntu ) Ethereum solidity brownie — 1 Ethereum — 2023-08-23 – p.8/33
Solidity Ethereum ( ) http://solidity.readthedocs.io/en/latest/installing-solidity.html Linux (on Windows) “sudo apt”,
macOS “brew” Linux ARM git clone dependencies solc 0.8.21 (8/23 ) $ solc --version brownie py-solc-x solc (dependencies) ( solc py-solc-x ) — 1 Ethereum — 2023-08-23 – p.9/33
Ganache Ethereum RPC npm ( ) macOS https://qiita.com/kyosuke5_20/items/c5f68fc9d89b84c0df09 Linux https://qiita.com/seibe/items/36cef7df85fe2cefa3ea
npm Ganache $ sudo npm install -g ganache — 1 Ethereum — 2023-08-23 – p.10/33
Python3 macOS $ brew install python3 Python 3.8 Homebrew $
brew uninstall --ignore-dependencies
[email protected]
$ brew install
[email protected]
/usr/local/opt/
[email protected]
/bin/python3 Linux $ sudo apt update $ sudo apt install python3.8 python3.8-dev python3.8-venv python3.8-tk 16.10 python3(.8) apt (PPA ) python3 ( python3.9 ) python3-dev python3-venv python3-tk — 1 Ethereum — 2023-08-23 – p.11/33
macOS : . . . macOS wget brew dyld: Library
not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib $ brew uninstall --force gettext $ brew install gettext — 1 Ethereum — 2023-08-23 – p.12/33
Python (venv) macOS (Linux python3 ) ‘python3.8’ ‘python3’ $ python3.8
-m venv bbc2env $ source bbc2env/bin/activate (bbc2env) $ pip install -U pip bbc2env ( BBc-2 ) ( ) (bbc2env) $ deactivate — 1 Ethereum — 2023-08-23 – p.13/33
Brownie Python Ethereum https://eth-brownie.readthedocs.io Brownie $ pip install eth-brownie version
1.19.3 (8/23 ) — 1 Ethereum — 2023-08-23 – p.14/33
$ brownie init ( ERC-20 ) $ brownie bake token
$ cd token — 1 Ethereum — 2023-08-23 – p.15/33
contracts (macOS Linux (x86/AMD64) ) $ brownie compile Linux (ARM)
(AMD64 ) $ python # >>> import solcx >>> solcx.compile_solc(’0.6.12’) # >>> quit() /tmp ∼/.solcx/solc-v0.6.12 ( ) $ pytest tests — 1 Ethereum — 2023-08-23 – p.16/33
Brownie $ brownie console Python >>> len(accounts) 10 >>> accounts[0].balance()
100000000000000000000 >>> quit() — 1 Ethereum — 2023-08-23 – p.17/33
3. Ethereum — 1 Ethereum — 2023-08-23 – p.18/33
( ) — 1 Ethereum — 2023-08-23 – p.19/33
. . . — 1 Ethereum — 2023-08-23 – p.20/33
vs. — 1 Ethereum — 2023-08-23 – p.21/33
= ( ) run ( ) — 1 Ethereum —
2023-08-23 – p.22/33
Ether Ethereum EOA : Externally-Owned Account ( ) Ether EVM
EVM — 1 Ethereum — 2023-08-23 – p.23/33
EVM : Ethereum Virtual Machine ঢ়ଶ ֎෦ΞΫλʔ ΞΧϯτ &7. ίʔυ
&UIFSˠ(BT ىಈ ίϯτϥΫτ ϝοηʔδ͔ɺ৽͍ࣗ͠ಈΦϒδΣΫτ ΞΧϯτؒͰΓऔΓ͞ΕΔσʔλ&UIFS ετϨʔδ ঢ়ଶ` τϥϯβΫγϣϯ ηοτ σδλϧॺ໊ &7. ਓؒͱ͔ ࣗಈ ΦϒδΣΫτ Gas Gas ETH (Gas ) (burn ) ETH ( . . .) — 1 Ethereum — 2023-08-23 – p.24/33
EVM : : ← : Solidity — JavaScript LLL —
Lisp Vyper — Python Fe — Vyper Rust ← NEW! Solidity Vyper Python — 1 Ethereum — 2023-08-23 – p.25/33
Solidity ( ) pragma solidityˆ0.7.0; contract IndivisibleAsset { /* */
string public _name; string public _symbol; uint256 public _quantity; address public _owner; constructor(string memory name, string memory symbol, uint256 quantity) public { _name = name; _symbol = symbol; _quantity = quantity; _owner = msg.sender; } function transfer(address to) public returns (bool) { require (_owner == msg.sender); _owner = to; return true; } } — 1 Ethereum — 2023-08-23 – p.26/33
( , ) (constructor) (deploy) = ( ) ( )
ETH Trusted Actor Model — 1 Ethereum — 2023-08-23 – p.27/33
Ethereum — 1 Ethereum — 2023-08-23 – p.28/33
4. Ethereum Görli — 1 Ethereum — 2023-08-23 – p.29/33
infura.io Brownie https://infura.io SIGN UP PROJECT ID infura Ethereum API
infura . . . infura.io PROJECT ID WEB3_INFURA_PROJECT_ID PROJECT ID (∼/.bash_profile ) $ export WEB3_INFURA_PROJECT_ID= PROJECT ID — 1 Ethereum — 2023-08-23 – p.30/33
G¨ orli ETH brownie console Görli >>> network.disconnect() >>> network.connect(’goerli’)
>>> len(accounts) 0 >>> accounts.add() <LocalAccount object ’ 16 ’> >>> accounts[0].private_key 16 >>> quit() Görli Testnet ETH Faucet ETH https://goerlifaucet.com ( ) ( ) https://metamask.io/ — 1 Ethereum — 2023-08-23 – p.31/33
G¨ orli ETH brownie console Görli ETH >>> network.disconnect() >>>
network.connect(’goerli’) >>> len(accounts) 0 >>> accounts.add( 16 ) <LocalAccount object ’ 16 ’> >>> accounts[0].balace() ETH >>> quit() ETH >>> accounts[0].transfer(accounts[1], "0.01 ether") — 1 Ethereum — 2023-08-23 – p.32/33
2 Ethereum I : ERC-20 — 1 Ethereum — 2023-08-23
– p.33/33