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
3.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
社内仮想通貨をモバイルDappとしてつくってみた
Hi-Ether Meetup - Block #1
daisuke sato
March 09, 2018
More Decks by daisuke sato
See All by daisuke sato
BlockchainHackathon2019 ワークショップ ~ Twitterとブロックチェーンを使ったアイデンティフィケーションの実現~
daisuke310vvv
0
220
gethoとTruffleを使った DApps開発ワークショップ
daisuke310vvv
0
150
gethoハッカソン -ハンズオン-
daisuke310vvv
1
1.1k
Hi-Con2018 より良いDApp開発をするための話と gethoについて
daisuke310vvv
1
420
getho ~ Ethereum private nodes, tailored for you. ~
daisuke310vvv
0
830
Other Decks in Technology
See All in Technology
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
260
AI ネイティブな組織に Gemini Enterprise Agent Platform がなぜ必要なのか
asei
1
150
[MIRU26] To What Extent Does MLLM-as-a-Judge Exhibit Cross-Model Preference Bias?
keio_smilab
PRO
0
180
Issue設計から始める仕様駆動開発 / 20260731 Mizuki Hirata
shift_evolve
PRO
1
100
エンタープライズデータへ安全につなぐ Production-ready なエージェント設計 ― AI × MCP リファレンスアーキテクチャ ― #AIDevDay
cdataj
1
480
AWS環境のセキュリティ不安を解消した企業事例 ~よくある課題と対策を一挙公開~
asanoharuki
1
280
システム監視を 「システムを監視するだけ」で 終わらせないために
seiud
0
160
システム監視入門
grimoh
5
800
plamo-3-translateの開発
pfn
PRO
0
250
論語・武士道・産業革命から見る かわるもの、かわらないもの
ichimichi
8
2.2k
AIエージェントに財布を渡す日 ― 承認付き"買い物エージェント"を作って実演
yama3133
1
110
ガバメントクラウドでのランサムウェア対策
techniczna
1
610
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
New Earth Scene 8
popppiees
3
2.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
450
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
330
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 ͋Γ͕ͱ͏͍͟͝·ͨ͠ ͍͖ͬͯ