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
社内仮想通貨をモバイルDappとしてつくってみた
Search
daisuke sato
March 09, 2018
Technology
1
3k
社内仮想通貨をモバイルDappとしてつくってみた
Hi-Ether Meetup - Block #1
daisuke sato
March 09, 2018
Tweet
Share
More Decks by daisuke sato
See All by daisuke sato
BlockchainHackathon2019 ワークショップ ~ Twitterとブロックチェーンを使ったアイデンティフィケーションの実現~
daisuke310vvv
0
220
gethoとTruffleを使った DApps開発ワークショップ
daisuke310vvv
0
140
gethoハッカソン -ハンズオン-
daisuke310vvv
1
1.1k
Hi-Con2018 より良いDApp開発をするための話と gethoについて
daisuke310vvv
1
400
getho ~ Ethereum private nodes, tailored for you. ~
daisuke310vvv
0
800
Other Decks in Technology
See All in Technology
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
5年目から始める Vue3 サイト改善 #frontendo
tacck
PRO
3
220
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
4
570
LLMを搭載したプロダクトの品質保証の模索と学び
qa
0
1k
CDK CLIで使ってたあの機能、CDK Toolkit Libraryではどうやるの?
smt7174
4
170
人工衛星のファームウェアをRustで書く理由
koba789
15
7.8k
Django's GeneratedField by example - DjangoCon US 2025
pauloxnet
0
150
BPaaSにおける人と協働する前提のAIエージェント-AWS登壇資料
kentarofujii
0
140
大「個人開発サービス」時代に僕たちはどう生きるか
sotarok
20
9.9k
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
460
「Linux」という言葉が指すもの
sat
PRO
4
130
現場で効くClaude Code ─ 最新動向と企業導入
takaakikakei
1
240
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Rails Girls Zürich Keynote
gr2m
95
14k
Six Lessons from altMBA
skipperchong
28
4k
How GitHub (no longer) Works
holman
315
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
Building Applications with DynamoDB
mza
96
6.6k
Transcript
ࣾԾ௨՟Λ ϞόΠϧDappͱͯ͠ ͭͬͯ͘Έͨ Hi-Ether Meetup - Block #1 @st_dsk 0x00
ࣗݾհ ࠤ౻ େี(@st_dsk) Co-Founder & CTO at Popshoot, Inc #go
#swift #☕ medium.com/@st_dsk 0x01 Works + Dapp?
ΞδΣϯμ 0x03 • ࣾԾ௨՟Λ࡞ͬͯΈͨ • ϞόΠϧDapp։ൃʹඞཁͳ͜ͱ • ϥΠϒϥϦͷհ • ϞόΠϧDapp͕ීٴͨ͠ੈք
Ethereum 0x04 • EthereumΛษڧ࢝͠Ίͯ̍ϲ݄ • ʮϒϩοΫνΣʔϯΞϓϦέʔγϣϯ։ൃͷڭՊॻʯ
0x05 ໘ന͍
Go build something 0x06 ʮͱΓ͋͑ͣࣾԾ௨՟Ͱͭͬͯ͘ΈΔ͔ʯ
ΞδΣϯμ 0x07 • ࣾԾ௨՟Λ࡞ͬͯΈͨ • ϞόΠϧDapp։ൃʹඞཁͳ͜ͱ • ϥΠϒϥϦͷհ • ϞόΠϧDapp͕ීٴͨ͠ੈք
ࣾԾ௨՟Λ࡞ͬͯΈͨᶃ 0x08 ࣮ • ERC20ʹ४ڌͨ͠ಠࣗτʔΫϯͷൃߦ • ϓϥΠϕʔτϒϩοΫνΣʔϯ • JSONRPCܦ༝Ͱࢀর&τϥϯβΫ γϣϯͷൃߦ
ࣾԾ௨՟Λ࡞ͬͯΈͨᶄ 0x09 ͍ํ • ࣾһಉ࢜ͷૹۚ • ίʔώʔࣗ࡞ΦϑΟεάϦίͷ ࢧ͍ • ग़ࣾ࣌ؒͷه
• ࡿͷି͠ग़͠(IoTͱͷΈ߹Θͤ)
ࣾԾ௨՟Λ࡞ͬͯΈͨᶅ 0x0a ॴײ • ʮίʔώʔ1ഋ200ϝϧͰʯΈ͍ͨͳڞ௨୯Ґ͕Ͱָ͖͍ͯ͠ • ͍Ζ͍ΖαʔϏεΛ࡞ͬͯͷͤΔʹྑ͍࣮ݧ • ͔ࣾΒΞΠσΞ͕ͨ͘͞Μग़͖ͯͯՄೳੑΛײ͡Δ •
͍Ζ͍Ζ࡞͍͖͍ͬͯͨ
ΞδΣϯμ 0x0b • ࣾԾ௨՟Λ࡞ͬͯΈͨ • ϞόΠϧDapp։ൃʹඞཁͳ͜ͱ • ϥΠϒϥϦͷհ • ϞόΠϧDapp͕ීٴͨ͠ੈք
ϞόΠϧDappͱ 0x0c • ϒϩοΫνΣʔϯ্ʹߏஙͨ͠εϚʔτίϯτϥΫτΞϓ ϦέʔγϣϯΛ࣮ߦ͢ΔͨΊͷΫϥΠΞϯτΞϓϦ ϞόΠϧDapp ᶄεϚʔτίϯτϥΫτ ࣮ߦ ϒϩοΫνΣʔϯ ᶃ
τϥϯβΫγϣϯͷൃߦ (εϚʔτϑΥϯΞϓϦ)
ϒϥβDapp 0x0d • Webϒϥβ্Ͱಈ͘ • CryptoKittiesͷήʔϜ͕ྲྀߦத • MetaMaskΛ͏ͱγʔϜϨεʹૹۚͰ͖ΔͷͰ։ൃଆϢʔβʔଆ ศརʹ͑Δ
ϞόΠϧDapp 0x0d • Ͳ͏ͬͯ࡞Δʁ
࣮ύλʔϯ(JSONRPCܦ༝) 0x0f Ethereum Client Server (Wallet&Txॺ໊) ϞόΠϧDapp API Tx params
JSONRPC Signed Tx Ethereum Client Wallet App (Wallet&Txॺ໊) ϞόΠϧDapp URL Scheme? JSONRPC Signed Tx Ethereum Client ϞόΠϧDapp (Wallet&Txॺ໊) Tx params JSONRPC Signed Tx ᶃ αʔόʔͰΥϨοτཧ&Txൃߦ ᶄ ֎෦ΥϨοτΞϓϦ͔ΒTxൃߦ ᶅ ΞϓϦͰΥϨοτཧ&Txൃߦ
࣮ύλʔϯ(JSONRPCܦ༝) 0x10 Ethereum Client Server (Wallet&Txॺ໊) ϞόΠϧDapp API Tx params
JSONRPC Signed Tx Ethereum Client Wallet App (Wallet&Txॺ໊) ϞόΠϧDapp URL Scheme? JSONRPC Signed Tx Ethereum Client ϞόΠϧDapp (Wallet&Txॺ໊) Tx params JSONRPC Signed Tx ᶃ αʔόʔͰΥϨοτཧ&Txൃߦ ᶄ ֎෦ΥϨοτΞϓϦ͔ΒTxൃߦ ᶅ ΞϓϦͰΥϨοτཧ&Txൃߦ
ϞόΠϧDappʹඞཁͳཁૉ 0x0e • ΥϨοτ • ൿີ伴ΞυϨεͷੜ&ӬଓԽ • ABIύʔαʔ(✳ͨͩ͠ඞਢͰͳ͍) • ABI͔ΒίϯτϥΫτͷؔใΛऔಘ
• ؔγάωνϟͷϋογϡͱҾύϥϝʔλΛ࿈݁ͨ͠จࣈྻͷग़ྗ • Txੜͱॺ໊ • ൿີ伴Λ༻ͯ͠Txʹର͢Δॺ໊(ίϯτϥΫτʹରͯ͠มߋΛՃ͑Δ߹) • JSONRPCΫϥΠΞϯτ • EthereumΫϥΠΞϯτͱͷ௨৴(ϒϩοΫνΣʔϯͷࢀরTxൃߦͳͲ)
۩ମతͳϑϩʔ 0x11 • ERC20τʔΫϯͷtransferؔΛJSONRPCܦ༝ͰCall͢Δ 1. ΥϨοτ͔ΒΞυϨεͷੜ 2. ίϯτϥΫτͷؔγάωνϟͷsha3ϋογϡͱҾύϥϝʔλͷ256bitͷ16ਐจࣈྻ ͷ࿈݁ •
"0x" + "sha3(`transfer(address,uint256)`)" + "<ૹۚઌΞυϨε>" + "<ૹֹۚ>" • => τϥϯβΫγϣϯͷdataύϥϝʔλ 3. τϥϯβΫγϣϯੜ͠ɺൿີ伴Ͱॺ໊ 4. ॺ໊ͨ͠τϥϯβΫγϣϯΛRLPΤϯίʔσΟϯά => "0xf8aa0684ee6b280082d8...b50504ccf8721dafc7b47" 5. EthereumΫϥΠΞϯτʹରͯ͠JSONRPCͰeth_sendRawTransactionΛCall͢Δ > curl -X POST http://127.0.0.1:8545 --data `{ "jsonrpc": "2.0", "id": 1, "method": "eth_sendRawTransaction", "params": ["0xf8aa0684ee6b280082d8...b50504ccf8721dafc7b47"] }'
ΞδΣϯμ 0x12 • ࣾԾ௨՟Λ࡞ͬͯΈͨ • ϞόΠϧDapp։ൃʹඞཁͳ͜ͱ • ϥΠϒϥϦͷհ • ϞόΠϧDapp͕ීٴͨ͠ੈք
ϥΠϒϥϦ(iOS) 0x13 ΥϨοτ ABIύʔαʔ Txੜͱॺ໊ JSONRPC ΫϥΠΞϯτ web3swift (BANKEX/web3swift) ◦
passphrase/ BIP32,39,44 ◦ ◦ ◦ Geth Mobile (ethereum/go-ethereum) ◦ passphrase × ◦ × EthereumKit (yuzushiof/EthereumKit) ◦ BIP32,39,44 × ◦ ◦ ୯ҰػೳΛఏڙ͢ΔϥΠϒϥϦ: JSONRPCKit, RLP.swift, BigInt, CryptoSwift, etc... શ෦ͷͤܥϥΠϒϥϦ:
ΞδΣϯμ 0x14 • ࣾԾ௨՟Λ࡞ͬͯΈͨ • ϞόΠϧDapp։ൃʹඞཁͳ͜ͱ • ϥΠϒϥϦͷհ • ϞόΠϧDapp͕ීٴͨ͠ੈք
ϞόΠϧDapp͕ීٴͨ͠ੈքʁ 0x15 • ̍ਓ̍ΥϨοτ(ϝοηϯδϟʔΞϓϦͷΑ͏ʹʁ) • ͋ΒΏΔDapp͕εϚϗΛ௨ͯ͠ϒϩοΫνΣʔϯʹ • DecentralizedͳαʔϏεΛεϚϗ͔ΒڗडͰ͖Δੈք
ݱঢ়ͷ՝(ϞόΠϧDapp) 0x16 • πʔϧϥΠϒϥϦෆ • ࣗલͰ࣮ or Έ߹ΘͤΔඞཁ͕͋Δ • MetaMaskͷΑ͏ͳγʔϜϨεͳΥϨοτ͕ͳ͍
• ։ൃ͕ͮ͠Β͘ɺෆศͳ͜ͱ͕ଟ͍ • Ϣʔβʔ͕ѻ͍ʹ͍͘ • దͳUI/UX͕ଘࡏ͠ͳ͍ͷͰࡧ͕ඞཁ • ϞόΠϧͳΒͰͷ੍ͷதͰͷ࣮
·ͱΊ 0x17 • ϞόΠϧDapp͜Ε͔Β࢝·͍ͬͯ͘ • ΕΔ͜ͱͨ͘͞Μ͋Δ • ʮGo build somethingʯ͍ͯ͘͜͠ͱ͕ඞཁ
0x18 ͋Γ͕ͱ͏͍͟͝·ͨ͠ ͍͖ͬͯ