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

ブロックチェーン概論 / Introduction to Blockchain

ブロックチェーン概論 / Introduction to Blockchain

2021年10月11日(月)、慶應義塾大学大学院メディアデザイン研究科「サービスデザインプロジェクト B」2021秋 第1回で使用されたスライドです。

Kenji Saito

October 11, 2021
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. B 2021 1 ( ) B 2021 — 1 —

    2021-10-11 – p.1/69
  2. https://speakerdeck.com/ks91 ( ) ( ) Discord Discord ( / /

    ) Zoom URL ( ) B 2021 — 1 — 2021-10-11 – p.2/69
  3. ( ) SFC ( ) CSO (Chief Science Officer) 1993

    ( ) 2006 ( ) SFC 21 P2P (Peer-to-Peer) 2011 2018 2019 VR 2021.7 , VR 2021.8 “ALL THESE WORLDS ARE YOURS”, VR 2021.9 & ( (VR) ) → ( ) B 2021 — 1 — 2021-10-11 – p.3/69
  4. VR 2021.8 “ALL THESE WORLDS ARE YOURS” 2040 2 .

    . . B 2021 — 1 — 2021-10-11 – p.6/69
  5. VR 2021.8 “ALL THESE WORLDS ARE YOURS” 2 . .

    . (VRChat COMMUNITY LABS “Europa” ) B 2021 — 1 — 2021-10-11 – p.7/69
  6. DNA (1) Ԙج σΦΩγ ϦϘʔε 5’ 3’ 5’ 5’ 3’

    4’ 3’ 2’ 1’ Ϧϯࢎ $ $ $ " " " 5 5 5 ( ( ( ຤୺ ຤୺ ຤୺ ຤୺ DNA = ( + ( ) + )* ( ) ( ) ′ ( ) DNA CG https://youtu.be/7Hk9jct2ozY?t=147 DNA/RNA (3′ → 5′ ) 5′ → 3′ ( ) 5′ → 3′ 3′ → 5′ B 2021 — 1 — 2021-10-11 – p.9/69
  7. DNA (2) ` ` ` ` ` ` ` `

    ࠯ͷૹΓํ޲ ઌߦ͢Δ࠯ ஗ΕΔ࠯ ࠯ͷૹΓํ޲ ෳ੡ϑΥʔΫ %/" ϙϦϝϥʔθ సࣸث Ԭ࡚ϑϥάϝϯτ  ೥ʹ༧૝͞Ε  ೥ʹൃݟ ᶃ ᶄ ᶅ %/" ϙϦϝϥʔθ సࣸث ( 100 ) B 2021 — 1 — 2021-10-11 – p.10/69
  8. VR 2021.9 & DNA RNA DNA 3D B 2021 —

    1 — 2021-10-11 – p.11/69
  9. . . . ( ) 2018 1 2 2018 OK

    Google, Google ( ) Python (2020 ) ( ) ∈ Alexa, B 2021 — 1 — 2021-10-11 – p.12/69
  10. Alexa, ত࿨࣌୅ ੈلޙ൒ ࣾձγεςϜ ࣾձ؀ڥ ػց ٕज़ ਓؒ ࣗಈγεςϜ ྩ࿨࣌୅

    ੈلલ൒ ిؾ͚ͭͯ ͸͍ ͸͍ ిؾ͚ͭͯ ͜ͷ৚݅ͷͱ͖ ٕज़Ͱ͋Γࣾձ؀ڥˠࣗવ؀ڥ ਓ ⇒ ( ) B 2021 — 1 — 2021-10-11 – p.13/69
  11. — ( ) ( ) “FinTech — Financial Innovation and

    the Internet” ( ) ( ) ( ) B — (2020 ∼) ( ) → ( ) https://speakerdeck.com/ks91 B 2021 — 1 — 2021-10-11 – p.14/69
  12. (1) 2020 9 60 (2020) : ( ) . .

    . = ( ) B 2021 — 1 — 2021-10-11 – p.15/69
  13. (2) (2020) : ( ) B 2021 — 1 —

    2021-10-11 – p.16/69
  14. (1/2) — World Wide Web SARS-CoV-2 COVID-19 2020 1990 World

    Wide Web End-to-End ( ) ( ) ( ) End-to-End ( ) 2008 B 2021 — 1 — 2021-10-11 – p.19/69
  15. (2/2) — 2020 ( ) B 2021 — 1 —

    2021-10-11 – p.20/69
  16. ← Python Flask (Python ) Ethereum Brownie (Python Ethereum )

    BBc-1 ( ) B 2021 — 1 — 2021-10-11 – p.21/69
  17. ( 2 ) ( ) Discord miro VR Discord miro

    ( ) ( : ) . . . : ( ) : DApp ( ) B 2021 — 1 — 2021-10-11 – p.22/69
  18. ( ) 25% 25% 20% 30% ( ) B 2021

    — 1 — 2021-10-11 – p.23/69
  19. ( ) 1 10 11 • 2 10 18 3

    10 25 1 4 11 1 2 5 11 8 1 6 11 15 2 7 11 22 8 11 29 11/22 ← KMD Discord B 2021 — 1 — 2021-10-11 – p.24/69
  20. ( ) ੪౻ 0DVMVT2VFTU खݩͷΩʔϘʔυ ࣮ߦ )%.* #MVFUPPUI #MVFUPPUI खݩͷτϥοΫϘʔϧ

    .BD1SP ໨ͷલͷσΟεϓϨΠ എޙͷ..BD#PPL"JS "QQMF 3FNPUF%FTLUPQ 0DVMVT 3FNPUF%FTLUPQ )PSJ[PO8PSLSPPNT VT2VFTU MacBook Air B 2021 — 1 — 2021-10-11 – p.27/69
  21. ( ) ( ) ( ) ↓ ( ( ))

    (BP : Blockchain Property ) BP-1 : ( ) BP-2 : ( ( ) ) BP-3 : ( ) ( ) ( ) B 2021 — 1 — 2021-10-11 – p.29/69
  22. ( ) (LIFO : Last In, First Out) ( )

    B 2021 — 1 — 2021-10-11 – p.30/69
  23. ( ) ( ) ( ) ( ) ( 16

    ) SHA (Secure Hash Algorithm) ( ) 1bit B 2021 — 1 — 2021-10-11 – p.31/69
  24. ( ) ( ) < , > ( ) ←

    : < , > : : < , , > : OK ( 1 ) NG ( ) B 2021 — 1 — 2021-10-11 – p.32/69
  25. BP-1 ( ), BP-2 ( ) BBc-1 f : →

    BP-3 ( ) ( ) ( ) ← BP-2 ← BP-3 ( ) (BP-2 ) ( ) ← BP-3 (?) + ← BP-{1,2} B 2021 — 1 — 2021-10-11 – p.33/69
  26. [Lamport 1984][Schneider 1990] (1) (2) (3) (4) ( ) ←

    ↑ B 2021 — 1 — 2021-10-11 – p.34/69
  27. TX : transaction ( 4 TX ) SMRP (State Machine

    Replication Problem) SMRP-1 ( ) SMRP-2 : B 2021 — 1 — 2021-10-11 – p.35/69
  28. ( ) ( ) ϒϩοΫ൪߸O ϒϩοΫ൪߸O  ϒϩοΫ൪߸O  ϒϩοΫ൪߸O

     ϒϩοΫ൪߸O  ϒϩοΫ൪߸O  ϒϩοΫ൪߸O  ϒϩοΫ൪߸O  ͍ͪ͹Μه࿥ɾॻ͖׵͑ͷίετ͕ߴ͍ྺ࢙ ࠷΋վ͟Μ͠ʹ͍͘ྺ࢙ ͕༗ޮ ͻͱͭखલͷϒϩοΫͷ ʮμΠδΣετʯ σδλϧॺ໊͞Εͨ ʮτϥϯβΫγϣϯ औҾ ʯ ϒϩοΫΛ࡞ΔͨΊʹ͸ɺͦͷʮμΠδΣετʯ͕͋Δ਺ҎԼͱ͍͏৚݅Λຬͨͨ͠Γ 1SPPGPG8PSL Ծ૝௨՟ͷ࣋ͪ෼ʹԠͨ͡ݖརΛ࢖ͬͨ౤ථͰউͬͨΓ 1SPPGPG4UBLF ͢Δඞཁ͕͋Δ ίετ͕͔͔Δ ϒϩοΫΛ࡞Δਓ͸ͦͷதʹࣗ෼ʹѼͯͨ Ծ૝௨՟ͰͷใुΛॻ͖ࠐΉ͜ͱ͕Ͱ͖ɺ ͦͷϒϩοΫ͕༗ޮͳྺ࢙ͷதʹ͋Δ৔߹ʹ ݶΓใु΋༗ޮͱͳΔ τϥϯβΫγϣϯͷଘࡏΛ֬ೝ͢Δ ͨΊͷޮ཰తͳํ๏͕ఏڙ͞ΕΔ ਖ਼౰ੑ ଘࡏੑ །Ұੑ Proof of Work ( ) . . . → B 2021 — 1 — 2021-10-11 – p.36/69
  29. (BP-3 ) ( : ) (BP-3 ) ( : )

    ← NFT BP-{1,2,3} BP-{1, 2} ⇒ B 2021 — 1 — 2021-10-11 – p.37/69
  30. 2009 ↑ 12 ( 5 ) B 2021 — 1

    — 2021-10-11 – p.39/69
  31. ( ) ( ) ( ) B 2021 — 1

    — 2021-10-11 – p.41/69
  32. ( ) ( ) ( ) B 2021 — 1

    — 2021-10-11 – p.43/69
  33. / ( ) ( ) ( ) ( ) B

    2021 — 1 — 2021-10-11 – p.45/69
  34. ( ) ( ) ( ) B 2021 — 1

    — 2021-10-11 – p.46/69
  35. ( ) ( ) ( ) : https://doi.org/10.1016/j.icte.2021.08.012 ( )

    ( ) ( ) : https://arxiv.org/abs/2011.05442 B 2021 — 1 — 2021-10-11 – p.53/69
  36. ( ) ( ) : https://arxiv.org/abs/2011.05442 3D HACCP ( )

    B 2021 — 1 — 2021-10-11 – p.54/69
  37. 2. Ethereum macOS (Big Sur 11.6) + Homebrew Linux (Ubuntu

    20.04.3) (x86/AMD64 and ARM) Windows 10 + Windows Subsystem for Linux (Ubuntu ) Ethereum solidity brownie B 2021 — 1 — 2021-10-11 – p.55/69
  38. 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.9 (10/6 ) $ solc --version brownie py-solc-x solc (dependencies) ( solc py-solc-x ) B 2021 — 1 — 2021-10-11 – p.56/69
  39. Ganache CLI Ethereum RPC npm ( ) macOS https://qiita.com/kyosuke5_20/items/c5f68fc9d89b84c0df09 Linux

    https://qiita.com/seibe/items/36cef7df85fe2cefa3ea npm Ganache CLI $ sudo npm install -g ganache-cli B 2021 — 1 — 2021-10-11 – p.57/69
  40. Python3 macOS $ brew install [email protected] python3 python 3.9 (12/2

    ) 3.9 3.8 3.9 $ 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-dev python3-venv python3-tk B 2021 — 1 — 2021-10-11 – p.58/69
  41. macOS : . . . macOS wget brew dyld: Library

    not loaded: /usr/local/opt/gettext/lib/libintl.8.dylib $ brew uninstall --force gettext $ brew install gettext B 2021 — 1 — 2021-10-11 – p.59/69
  42. 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 wheel bbc1env ( BBc-1 ) ( ) (bbc1env) $ deactivate B 2021 — 1 — 2021-10-11 – p.60/69
  43. $ brownie init ( ERC-20 ) $ brownie bake token

    $ cd token B 2021 — 1 — 2021-10-11 – p.62/69
  44. 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 B 2021 — 1 — 2021-10-11 – p.63/69
  45. Brownie $ brownie console Python >>> len(accounts) 10 >>> accounts[0].balance()

    100000000000000000000 >>> quit() B 2021 — 1 — 2021-10-11 – p.64/69
  46. 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 B 2021 — 1 — 2021-10-11 – p.66/69
  47. ropsten ETH brownie console ropsten >>> network.disconnect() >>> network.connect(’ropsten’) >>>

    len(accounts) 0 >>> accounts.add() <LocalAccount object ’ 16 ’> >>> accounts[0].private_key 16 >>> quit() Ropsten Testnet ETH Faucet 5.0ETH https://faucet.dimensions.network/ ( ) https://metamask.io/ B 2021 — 1 — 2021-10-11 – p.67/69
  48. ropsten ETH brownie console ropsten ETH >>> network.disconnect() >>> network.connect(’ropsten’)

    >>> len(accounts) 0 >>> accounts.add( 16 ) <LocalAccount object ’ 16 ’> >>> accounts[0].balace() ETH >>> quit() ETH >>> accounts[0].transfer(accounts[1], "1 ether") B 2021 — 1 — 2021-10-11 – p.68/69