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
210
gethoとTruffleを使った DApps開発ワークショップ
daisuke310vvv
0
140
gethoハッカソン -ハンズオン-
daisuke310vvv
1
1k
Hi-Con2018 より良いDApp開発をするための話と gethoについて
daisuke310vvv
1
360
getho ~ Ethereum private nodes, tailored for you. ~
daisuke310vvv
0
740
Other Decks in Technology
See All in Technology
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
Lexical Analysis
shigashiyama
1
150
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
310
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
590
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
150
Application Development WG Intro at AppDeveloperCon
salaboy
0
190
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
130
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
A Tale of Four Properties
chriscoyier
156
23k
Why Our Code Smells
bkeepers
PRO
334
57k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Documentation Writing (for coders)
carmenintech
65
4.4k
The Invisible Side of Design
smashingmag
298
50k
Being A Developer After 40
akosma
86
590k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
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 ͋Γ͕ͱ͏͍͟͝·ͨ͠ ͍͖ͬͯ