Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web3 技術のリアリティ(デモンストレーション) / The Reality of Web3...

Web3 技術のリアリティ(デモンストレーション) / The Reality of Web3 Technology (Demonstration)

2023年6月16日(金)、幕張メッセで開催された Interop Tokyo 2023 カンファレンスでの講演に使用したスライドです。

Kenji Saito

June 16, 2023
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. Web3 Web 3.0 World Wide Web Web 2.0 “web3.py” Python

    Ethereum NFT( ) Web3 Web3 — 2023-06-16 – p.2/22
  2. Web 1-2-3 ͍ΘΏΔ 8FC 8FC ໰୊ͷۚ༥Խ Ϣʔβࣗ਎͕ʮ؆୯ʹʯσʔλͷੜ࢈ऀʹ ΋͏ͻͱͭ ͷࢭ༲ ࢭ༲

    4FNBOUJD8FC  l8FCzॳग़   8FC ˠ8FC           8FC ૊৫ʹ ؅ཧͤͣ͞ɺ σʔλΛϢʔβͷ खʹऔΓ໭ͦ͏ ͢΂ͯͷ໰୊͸ ͢΂ͯΛ ۚ༥τʔΫϯԽͯ͠ ղܾ͠Α͏ #FSOFST-FF ͷ #FSOFST-FF ͷ 0` 3FJMMZ ͷ 8PPE ͷ #JUDPJO ε ϊ ồ σ ϯ ࣄ ݅ Ϧ ồ Ϛ ϯ ɾ γ ἀ ỽ Ϋ Π ϯ λ ồ ω ỽ τ ঎ ༻ Խ &UIFSFVN 4PMJE ϓϩδΣΫτ΁ Ϣʔβࣗ਎ͱ ެӹͷͨΊʹ σʔλ͸ࣗ༝ʹ ׆༻Ͱ͖͍ͯΔ͔ʁ Web3 — 2023-06-16 – p.4/22
  3. Web 3.0 Web3 Web 1.0 (Berners-Lee) : Read × Write

    → Web 2.0 (O’Reilly) : Read × Write ← (Web 1.0 ) Web 3.0 (Berners-Lee) → Solid (Social linked data) Web 3.0 → Web3 (Wood) Ethereum ← web3.js, web3.py Web3 (Dixon) : Read × Write × Own (Bloomberg) Web3 — 2023-06-16 – p.5/22
  4. python 3.10.7 solc 0.8.19 ( ) (Solidity ( ) )

    node v20.2.0 ganache v7.8.0 (Ethereum RPC + ) eth-brownie 1.19.3 (Python Ethereum ) web3 5.31.3 (Python Ethereum ) py-solc-x 1.1.1 (Solidity Python + ) macOS Monterey 12.6.6 Web3 — 2023-06-16 – p.6/22
  5. Python3 eth-brownie . . . $ python3 -m venv demoenv

    $ source demoenv/bin/activate $ pip install -U pip $ pip install wheel $ pip install eth-brownie web3.py Web3 — 2023-06-16 – p.7/22
  6. : Bitcoin . . . : ( : ) (

    ) : : : ⇒ Web3 — 2023-06-16 – p.9/22
  7. Ethereum        ߹ҙ͞Εͨཤྺ ϩʔΧϧʹෳ੡Λҡ࣋

    ϒϩοΫ εϩοτ  ඵִؒ  εϩοτͰ  ΤϙοΫ ҉߸ֶతμΠδΣετ ϒϩοΫνΣʔϯͷҡ࣋ࢀՃऀ͕ϩʔΧϧʹ؅ཧ͢Δσʔλۭؒ ࣌ؒ ΑΓ৽͍͠ه࿥ ΦϒδΣΫτ τʔΫϯγεςϜ౳ͷεϚʔτίϯτϥΫτ ֤Ϣʔβͷ ࢒ߴ౳ͷঢ়ଶ ঢ়ଶ` ঢ়ଶ`` τϥϯβΫγϣϯ ΦϒδΣΫτͷੜ੒ ·ͨ͸ঢ়ଶભҠͷࢦࣔ ແޮͳཤྺ ω ỽ τ ϫ ồ Ϋ Λ ௨ ͠ ͯ ૹ ड ৴ ͞ Ε Δ ϩ ồ Χ ϧ ʹ ࣋ ͭ ܨ͙ͨΊʹ͸&5) Ͱͷσϙδοτͱ σϙδοτ૯ֹͷ ♤ ૬౰ͷϢʔβʹΑΔ ΤϙοΫ΁ͷূݴ͕ඞཁ શΦϒδΣΫτͷભҠޙͷঢ়ଶ ͕ϋογϡ໦˞ʹू໿͞Ε ͦͷ ϧʔτ஋͕ϒϩοΫʹॻ͔ΕΔ ঢ়ଶભҠ ˞ϋογϡ໦σʔλ܈ͷ҉߸ֶతμΠδΣετ ϋογϡ ɹΛ໦ߏ଄ʹදݱͨ͠΋ͷͰ ෆ੔߹ͷݕग़ʹ༻͍ΒΕΔ . . . ETH ETH Web3 — 2023-06-16 – p.10/22
  8. Ethereum Ethereum $ brownie console # eth-brownie (Python ) #

    ↓ Python >>> network.disconnect() # ( ) >>> network.connect(’mainnet’) # Ethereum >>> web3.eth.block_number # >>> web3.eth.get_block( ) # >>> web3.eth.get_block( ).get(’timestamp’) # >>> import datetime >>> dt = datetime.datetime.fromtimestamp( ) >>> print(dt) # Web3 — 2023-06-16 – p.11/22
  9. &UIFSFVNωοτϫʔΫ  &7. &0" &5) ࢒ߴ &5) (BT εϚʔτ ίϯτϥΫτ

    ϝοηʔδʹΑΔ ݺͼग़͠ τϥϯβ Ϋγϣϯ ॺ໊ͯ͠ ౤ೖ ϒϩοΫʹ ૊ΈࠐΈˠ όϦσʔλ Ϣʔβ ॲ ཧ ˞(BT ͸ܭࢉࢿݯͷྔΛද͢ ˞(BT ࢖༻ྉΛ &5) Ͱࢧ෷͏Ϣʔβ͕τϥϯβΫγϣϯΛ౤ೖ͠ͳ͍ݶΓ ɹεϚʔτίϯτϥΫτ͸ಈ࡞͠ͳ͍ . . . Ethereum (EVM) ETH ↑ DAO Web3 — 2023-06-16 – p.12/22
  10. $ brownie bake nft nft ( ) contracts SimpleCollectible.sol ERC-721

    NFT $ cd nft # nft $ brownie console # eth-brownie (Python ) >>> network.disconnect() # >>> network.connect(’goerli’) # Ethereum >>> accounts.add( ) # >>> collectible = SimpleCollectible.deploy({’from’: accounts[0]}) # NFT 1,834,415 Gas Web3 — 2023-06-16 – p.13/22
  11. NFT (Non-Fungible Token) 1 → ( ) → ( )

    ( ) ( ) NFT NFT Web3 — 2023-06-16 – p.14/22
  12. ERC-721 NFT τʔΫϯ *% ൪߸ 63- ΞυϨε 63- /'5 Ұҙ

    Ұҙʁ Ұҙʁ Ұҙ ࣄ্࣮ Ұҙ ެ։伴ͷ μΠδΣετ ϝλσʔλ ίϯτϥΫτͱ͍͏ఆٛҬ ˞ͦͷίϯτϥΫτͱ͍͏ఆٛҬͷதͰ ࣮ઢ໼ҹͰࣔͨ͠ҰҙੑΛอূ͢Δʹա͗ͳ͍ ˞ഁઢ໼ҹͰࣔͨ͠Ұҙੑ͸ ࣮૷ɾӡ༻ͷ޻෉࣍ୈͰอূͰ͖Δ ɹྫ͑͹ 63- ʹͦΕ͕ࢦ͢Ϧιʔεͷ҉߸ֶతμΠδΣετΛؚΊΔ͜ͱ ྫ *1'4 ͷར༻ ʹΑΓ ɹ ʮ63-ˠσʔλʯͷҰҙੑΛอͯΔ ͦͷ৔߹Ͱ΋ʮσʔλˠ63-ʯͷҰҙੑ͸ແ͍ ର৅σʔλ ը૾౳ ॴ༗ऀ ϝλσʔλ 63- ର৅σʔλ 63- ൿີ伴 Ұҙ Ұҙʁ Ϣʔβ Ұҙʁ Web3 — 2023-06-16 – p.15/22
  13. NFT URL NFT >>> collectible.createCollectible( URL) # NFT URL NFT

    NFT >>> network.disconnect() # >>> network.connect(’mainnet’) # Ethereum >>> collectible = SimpleCollectible.at(’ ’) # >>> collectible.ownerOf(OpenSea NFT ID) # >>> collectible.tokenURI(OpenSea NFT ID) # Web3 — 2023-06-16 – p.16/22
  14. NFT σʔλ " ϒϩοΫνΣʔϯ #⒩ ʜ ʜ ϒϩοΫνΣʔϯ #⒪ ʜ

    ʜ εϚʔτίϯτϥΫτ $⒩ εϚʔτίϯτϥΫτ $⒪ ಛఆͷετϨʔδ ˞Ͳ͜ʹஔ͔ΕΑ͏ͱ΋ ɹ౳͍͠σʔλ͸ಉ͡΋ͷ ϒϩοΫνΣʔϯ͕ಉ͡Ͱ΋ҟͳͬͯ ͍ͯ΋ εϚʔτίϯτϥΫτ͕ҟͳ ΔΠϯελϯεͳΒఆٛҬ͸ผͱͳΔ ଟ͘ͷ৔߹ ې͡ΒΕͳ͍ ېࢭͰ͖ͳ͍ ˞/'5 ͕σʔλΛࢦ͢ํࣜͱσʔλΛ֨ೲ͢Δํࣜ͸ σʔλͷՄ༻ੑ͸ҟͳΔͱͯ͠΋ҰҙੑʹؔΘΔੑ࣭͸มΘΒͳ͍ ಉҰ εϚʔτίϯτϥΫτ $⒫ εϚʔτίϯτϥΫτ $⒬ /'5⒩ /'5⒪ /'5⒫ /'5⒬ /'5⒮ /'5⒭ σʔλ "  ېͣΔΑ͏ͳ ઃܭ͸ίετߴ ېࢭͰ͖ͳ͍ Web3 — 2023-06-16 – p.17/22
  15. NFT NFT NFT >>> collectible.ownerOf( NFT ID) # >>> collectible.ownerOf(

    NFT ID) # NFT Ethereum Ethereum NFT NFT Ethereum Lazy Minting (?) ( ) (Gas ) Web3 — 2023-06-16 – p.18/22
  16. DAO ಺෦ࢿຊˢ͋Δ ɹɹɹɹˣͳ͍ தԝʹࣗಈ ɹɹɹɹɹWT ɹɹɹɹɹɹதԝʹਓؒ ׬શͳ "* σʔϞϯ˞ ϑΥʔϥϜ˞

    XFC αʔϏε ϩϘοτΛ࢖໾ %"0 %"QQ˞ ݹయత૊৫ ɹɹɹɹɹपลʹਓؒ ɹɹɹɹWT पลʹࣗಈ ˞%"QQεϚʔτίϯτϥΫτʹΑΔΞϓϦέʔγϣϯ %FDFOUSBMJ[FE"QQ ˞ϑΥʔϥϜਓʑ͕ಛఆͷ࿩୊ʹ͍ͭͯٞ࿦ͨ͠Γ৘ใΛަ׵ͨ͠Γ͢Δ৔ ˞σʔϞϯόοΫάϥ΢ϯυͰՔಇ͠ ΠϕϯτʹࣗಈతʹରԠ͢ΔϓϩάϥϜ . . . Buterin DAO (2014) Web3 — 2023-06-16 – p.20/22
  17. DAO Bitcoin DAO → DAO Ethereum DAO → . .

    . DAO ( ) ( ) DAO → . . . ( ) ↑ ( ) ← Web3 — 2023-06-16 – p.21/22
  18. ( . . . ) · DAO Web 2.0 .

    . . Web3 — 2023-06-16 – p.22/22