2022年9月7日(水)、ブロックチェーンハブ主催のブロックチェーンアカデミーにて使用したスライドです。
1 BBc-1 EthereumCSO /[email protected]— 1 BBc-1 Ethereum — 2022-09-07 – p.1/36
View Slide
https://speakerdeck.com/ks91— 1 BBc-1 Ethereum — 2022-09-07 – p.2/36
( )SFC ( )CSO (Chief Science Officer)1993 ( )2006 ( )SFC21 P2P (Peer-to-Peer)2011 ( )2018 2019VR 2021.7 VR 2021.8 “ALL THESE WORLDS ARE YOURS”VR 2021.9 & VR 2021.12VR 2022.3 VR 2022.8→ ( )— 1 BBc-1 Ethereum — 2022-09-07 – p.3/36
BBc-1 (Beyond Blockchain One)Ethereum— 1 BBc-1 Ethereum — 2022-09-07 – p.4/36
1. Ethereum2. Ethereum3. Ethereum4.5. BBc-1— 1 BBc-1 Ethereum — 2022-09-07 – p.5/36
1. Ethereum— 1 BBc-1 Ethereum — 2022-09-07 – p.6/36
( )(BP : Blockchain Property )BP-1 : ( )BP-2 : ( )( )BP-3 : ( )( )( )— 1 BBc-1 Ethereum — 2022-09-07 – p.7/36
1) ( )2) (= )3)⇒(= )⇒· / 1:1 NFT/ (dependable )— 1 BBc-1 Ethereum — 2022-09-07 – p.8/36
/DLT( )Bitcoin ( )Open Assets Protocol (OAP)( )Ethereum (2.0) (Dapps ( ) ) ( )Polkadot (Web3 Foundation) ( )(DLT) ( )Hyperledger (Linux Foundation)Fabric (IBM/DAH), Sawtooth (Intel), Iroha ( ), Indy, BesuCorda (R3),. . ., BBc-1 ( )— 1 BBc-1 Ethereum — 2022-09-07 – p.9/36
EthereumVitalik Buterin, “Ethereum White Paper: A NEXT GENERATION SMARTCONTRACT & DECENTRALIZED APPLICATION PLATFORM”15Dapps ( / / )— 1 BBc-1 Ethereum — 2022-09-07 – p.10/36
2. EthereummacOS (Big Sur 11.6.4) ( Monterey 12.5.1 ) + HomebrewLinux (Ubuntu 22.04) (x86/AMD64 and ARM)Windows 10 + Windows Subsystem for Linux (Ubuntu )Ethereum solidity brownie— 1 BBc-1 Ethereum — 2022-09-07 – p.11/36
SolidityEthereum ( )http://solidity.readthedocs.io/en/latest/installing-solidity.htmlLinux (on Windows) “sudo apt”, macOS “brew”Linux ARMgit clone dependenciessolc 0.8.16 (9/6 )$ solc --versionbrownie py-solc-xsolc (dependencies) ( solc py-solc-x )— 1 BBc-1 Ethereum — 2022-09-07 – p.12/36
Ganache CLIEthereum RPCnpm ( )macOShttps://qiita.com/kyosuke5_20/items/c5f68fc9d89b84c0df09Linuxhttps://qiita.com/seibe/items/36cef7df85fe2cefa3eanpm Ganache CLI$ sudo npm install -g ganache-cli— 1 BBc-1 Ethereum — 2022-09-07 – p.13/36
Python3macOS$ brew install [email protected]python3 python 3.9 (12/2 )3.9 3.83.9$ 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 )python3python3-dev python3-venv python3-tk— 1 BBc-1 Ethereum — 2022-09-07 – p.14/36
macOS :. . .macOS wget brewdyld: Library not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib$ brew uninstall --force gettext$ brew install gettext— 1 BBc-1 Ethereum — 2022-09-07 – p.15/36
Python (venv)macOS (Linux python3 ) ‘python3.8’ ‘python3’$ python3.8 -m venv bbc1env$ source bbc1env/bin/activate(bbc1env) $ pip install -U pip(bbc1env) $ pip install wheelbbc1env ( BBc-1 )( )(bbc1env) $ deactivate— 1 BBc-1 Ethereum — 2022-09-07 – p.16/36
BrowniePython Ethereumhttps://eth-brownie.readthedocs.ioBrownie$ pip install eth-brownieversion 1.19.1 (9/6 )— 1 BBc-1 Ethereum — 2022-09-07 – p.17/36
$ brownie init( ERC-20 )$ brownie bake token$ cd token— 1 BBc-1 Ethereum — 2022-09-07 – p.18/36
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 BBc-1 Ethereum — 2022-09-07 – p.19/36
Brownie$ brownie consolePython>>> len(accounts)10>>> accounts[0].balance()100000000000000000000>>> quit()— 1 BBc-1 Ethereum — 2022-09-07 – p.20/36
3. Ethereum— 1 BBc-1 Ethereum — 2022-09-07 – p.21/36
— 1 BBc-1 Ethereum — 2022-09-07 – p.22/36
. . .— 1 BBc-1 Ethereum — 2022-09-07 – p.23/36
vs.— 1 BBc-1 Ethereum — 2022-09-07 – p.24/36
= run— 1 BBc-1 Ethereum — 2022-09-07 – p.25/36
EtherEthereumEOA : Externally-Owned Account( )Ether EVMEVM— 1 BBc-1 Ethereum — 2022-09-07 – p.26/36
EVM : Ethereum Virtual Machine(validator)⇒ Gas — 1 BBc-1 Ethereum — 2022-09-07 – p.27/36
EVM:: ←:Solidity — JavaScriptLLL — LispVyper — PythonFe — Vyper Rust ← NEW!SolidityVyper Python— 1 BBc-1 Ethereum — 2022-09-07 – p.28/36
Solidity ( )pragma solidityˆ0.5.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 BBc-1 Ethereum — 2022-09-07 – p.29/36
Ethereum— 1 BBc-1 Ethereum — 2022-09-07 – p.30/36
4.Ethereum ropsten— 1 BBc-1 Ethereum — 2022-09-07 – p.31/36
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 BBc-1 Ethereum — 2022-09-07 – p.32/36
ropsten ETHbrownie console ropsten>>> network.disconnect()>>> network.connect(’ropsten’)>>> len(accounts)0>>> accounts.add()>>> accounts[0].private_key16>>> quit()Ropsten Testnet ETH Faucet 10.0ETHhttps://faucet.egorfine.com( )https://metamask.io/— 1 BBc-1 Ethereum — 2022-09-07 – p.33/36
ropsten ETHbrownie console ropsten ETH>>> network.disconnect()>>> network.connect(’ropsten’)>>> len(accounts)0>>> accounts.add( 16 )>>> accounts[0].balace()ETH>>> quit()ETH>>> accounts[0].transfer(accounts[1], "1 ether")— 1 BBc-1 Ethereum — 2022-09-07 – p.34/36
5. BBc-1https://speakerdeck.com/beyondblockchain/bbc-1-hands-on-installation-and-file-content-proof— 1 BBc-1 Ethereum — 2022-09-07 – p.35/36
2 BBc-1 Ethereum I:— 1 BBc-1 Ethereum — 2022-09-07 – p.36/36