2023年8月23日(水)、ブロックチェーンハブ主催のブロックチェーンアカデミーにて使用したスライドです。
1 EthereumCSO /[email protected]— 1 Ethereum — 2023-08-23 – p.1/33
View Slide
https://speakerdeck.com/ks91— 1 Ethereum — 2023-08-23 – p.2/33
( )SFC ( )CSO (Chief Science Officer)1993 ( )2006 ( )SFC22 P2P (Peer-to-Peer)2011 ( )2018 2019VR 2021.9 & VR 2022.32023 AI VR&RPG 2023.5 “Don’t Be So Serious”VOXEL 2023.7 DAZE 2023→ ( )— 1 Ethereum — 2023-08-23 – p.3/33
1EthereumBBc (Beyond Blockchain)— 1 Ethereum — 2023-08-23 – p.4/33
1. Ethereum2. Ethereum3. Ethereum4.— 1 Ethereum — 2023-08-23 – p.5/33
1. Ethereum— 1 Ethereum — 2023-08-23 – p.6/33
EthereumVitalik Buterin, “Ethereum White Paper: A NEXT GENERATION SMARTCONTRACT & DECENTRALIZED APPLICATION PLATFORM”12 ( 12 )(= )=⇒→Dapps ( / / )— 1 Ethereum — 2023-08-23 – p.7/33
2. EthereummacOS (Big Sur 11.6.4, Monterey 12.6.7) + HomebrewLinux (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
SolidityEthereum ( )http://solidity.readthedocs.io/en/latest/installing-solidity.htmlLinux (on Windows) “sudo apt”, macOS “brew”Linux ARMgit clone dependenciessolc 0.8.21 (8/23 )$ solc --versionbrownie py-solc-xsolc (dependencies) ( solc py-solc-x )— 1 Ethereum — 2023-08-23 – p.9/33
GanacheEthereum RPCnpm ( )macOShttps://qiita.com/kyosuke5_20/items/c5f68fc9d89b84c0df09Linuxhttps://qiita.com/seibe/items/36cef7df85fe2cefa3eanpm Ganache$ sudo npm install -g ganache— 1 Ethereum — 2023-08-23 – p.10/33
Python3macOS$ brew install python3Python3.8Homebrew$ brew uninstall --ignore-dependencies [email protected]$ brew install [email protected]/usr/local/opt/[email protected]/bin/python3Linux$ sudo apt update$ sudo apt install python3.8 python3.8-dev python3.8-venv python3.8-tk16.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 brewdyld: 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 pipbbc2env ( BBc-2 )( )(bbc2env) $ deactivate— 1 Ethereum — 2023-08-23 – p.13/33
BrowniePython Ethereumhttps://eth-brownie.readthedocs.ioBrownie$ pip install eth-brownieversion 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 compileLinux (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 consolePython>>> 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
EtherEthereumEOA : Externally-Owned Account( )Ether EVMEVM— 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 — JavaScriptLLL — LispVyper — PythonFe — Vyper Rust ← NEW!SolidityVyper 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) =( )( )ETHTrusted 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 Browniehttps://infura.io SIGN UP PROJECT IDinfura Ethereum APIinfura . . .infura.ioPROJECT IDWEB3_INFURA_PROJECT_IDPROJECT ID (∼/.bash_profile )$ export WEB3_INFURA_PROJECT_ID= PROJECT ID— 1 Ethereum — 2023-08-23 – p.30/33
G¨orli ETHbrownie console Görli>>> network.disconnect()>>> network.connect(’goerli’)>>> len(accounts)0>>> accounts.add()>>> accounts[0].private_key16>>> quit()Görli Testnet ETH Faucet ETHhttps://goerlifaucet.com ( )( )https://metamask.io/— 1 Ethereum — 2023-08-23 – p.31/33
G¨orli ETHbrownie console Görli ETH>>> network.disconnect()>>> network.connect(’goerli’)>>> len(accounts)0>>> accounts.add( 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