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
MCH Hackathon技術情報 / MCH Hackathon API
Search
Ryo Manzoku
April 20, 2019
Programming
0
470
MCH Hackathon技術情報 / MCH Hackathon API
2019-04-20 開催されたHackthon向けAPI情報です。
Ryo Manzoku
April 20, 2019
Tweet
Share
More Decks by Ryo Manzoku
See All by Ryo Manzoku
ブロックチェーンゲーム開発におけるチェーンの選び方 / How to select a blockchain for BCG
rmanzoku
0
530
NFTを取り巻く技術要素とAWS利活用 / Technology and AWS of NFT
rmanzoku
0
900
NFTを中心とした新しいゲームの形 / The new approach of gaming with NFT
rmanzoku
0
400
NFTへの招待 / Invitation to NFT
rmanzoku
0
1.5k
Stringをどうにかする / Managing Solidity String
rmanzoku
0
1.2k
ブロックチェーン時代の認証 / Authentication in the Blockchain Era
rmanzoku
8
3k
ERC-721をかぞえて / Enumerate ERC-721
rmanzoku
3
7.9k
MCH+ Hackathon #1
rmanzoku
0
290
AWS上で動く世界No.1ブロックチェーンゲーム / No1 Blockchain Game on AWS
rmanzoku
1
2.9k
Other Decks in Programming
See All in Programming
役立つログに取り組もう
irof
28
9.3k
EventSourcingの理想と現実
wenas
6
2.2k
Macとオーディオ再生 2024/11/02
yusukeito
0
320
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
4
1.9k
Outline View in SwiftUI
1024jp
1
280
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
160
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
8
5k
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.7k
僕がつくった48個のWebサービス達
yusukebe
20
17k
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
5
2k
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.9k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
160
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Six Lessons from altMBA
skipperchong
26
3.5k
Into the Great Unknown - MozCon
thekraken
32
1.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
560
The Art of Programming - Codeland 2020
erikaheidi
52
13k
A designer walks into a library…
pauljervisheath
202
24k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Faster Mobile Websites
deanohume
305
30k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
4 Signs Your Business is Dying
shpigford
180
21k
Transcript
Hackthonٕज़ใ 2019–04-20 MCH Hackathon @rmanzoku
ҙ ͜͜Ͱհͨ͠ͷΛඞͣΘͳ͚ΕͳΒͳ͍Θ͚Ͱ͋ Γ·ͤΜɻ Ұ෦API͜ͷϋοΧιϯͷͨΊʹ࡞ͨ͠ͷͰ͢ɻ༧ࠂ ͳ͘มߋɺআ͞ΕΔ߹͕͋Γ·͢ɻ GitHubʹެ։ࡁΈ https://github.com/doublejumptokyo/mch-hackathon ͨΓલͷઆ໌Βͳ͍୯ޠ͕ͰΔ͔͠Ε·ͤΜ͕ɺ͜ ͷ͋ͱϝϯλʔͷํʑʹ࣭ͯ͠Έ͍ͯͩ͘͞ɻ
MyCryptoHeroesʹ͍ͭͯ
MyCryptoHeroes͓͞Β͍ ERC721ΛͬͨHero / Extension / LandSectorͷ Ethereum্ͷAsset Ethereum্Ͱͷॴ༗ݖΛӡӦॴ༗ͷεϚʔτίϯτ ϥΫτʹ༬͚Δ͜ͱͰɺCryptoWorldʢήʔϜʣͰ ར༻ՄೳʹͳΔʢLandSectorྫ֎ʣ
ήʔϜͷใҰ෦ެ։APIΛ௨ͯ͠ࢀরͰ͖Δ
MyCryptoHeroes͓͞Β͍ ϢʔβʔήʔϜʹUserIDΛ͍࣋ͬͯΔ UserIDͱEthereumΞυϨεΛඥ͚ͮͯཧ͍ͯ͠Δ EthereumΞυϨεΛެ։͢ΔػೳʹΑΓɺ༗ޮͳ ϢʔβʔEthereumΞυϨε͔ΒϢʔβʔใΛऔ ಘͰ͖Δ
ERC 721 / Metadata
ERC 721 Ethereumͷඪ४ن֨ͷҰͭͰNon-Fungible TokenʢNFTʣΛنఆ ͨ͠ΠϯλʔϑΣʔε NFTͱɺସෆՄೳͳͷ CryptoKittiesΛൃʹEthereum্ͰToken/Assetͷॴ༗ݖͳͲΛنఆ ࢀর࣮ͱͯ͠OpenZeppelinOSͷͷ͕༗໊ CryptoZombiesERC721 ERC20ͱൺֱ͞ΕΔ
ERC721 ར༻Πϝʔδ MCHΞηοτOpenZeppelinΛར༻ͨ͠ERC721ʹ ४ڌ͍ͯ͠ΔͷͰɺ͘ΘΕΔERC721ͱͯ͠ར༻ Ͱ͖Δ ϨϯσΟϯάͳͲ
ERC 721 Metadata MCHͷHero͕HeroͨΒ͠Ί͍ͯΔϝλใ Heroͷ໊લϨϕϧɺύϥϝʔλͳͲ ΦϑνΣʔϯใΛ͑ΔJSON APIͰ͋Δ͜ͱ͕ଟ͍ OpenSeabazaaar.ioͳͲ͜ͷใΛऔಘͯ͠දࣔͯ͠ ͍Δ MCH+Ͱɺ͜ͷMetadataΛ֦ு͢Δ͜ͱʹΑͬͯΞ
ηοτʹ͍ΖΜͳՁΛՃ͍͚ͯ͠ΔͷͰͳ͍͔
ERC 721 Metadata Hero https://www.mycryptoheroes.net/metadata/heroes/ 50010001 Extension https://www.mycryptoheroes.net/metadata/extensions/ 50010001 LandSector
https://www.mycryptoheroes.net/metadata/ landSectors/50010001
MCHใऔಘܥAPI
Ξηοτʹؔ͢ΔใAPI Skillઆ໌จͳͲͷऔಘ https://www.mycryptoheroes.net/experimental-api/skill/ 1001 HeroTypeͷऔಘ https://www.mycryptoheroes.net/experimental-api/ heroType/5001 ExtensionTypeͷऔಘ https://www.mycryptoheroes.net/experimental-api/ extensionType/5001
ϢʔβʔใAPI UserID͘͠EthereumΞυϨεͰϢʔβʔΛݕࡧ https://www.mycryptoheroes.net/experimental-api/ proxy/mch/users/10001 https://www.mycryptoheroes.net/experimental-api/ proxy/mch/users/ 0xd868711BD9a2C6F1548F5f4737f71DA67d821090 ޙऀEthreaumΞυϨεΛެ։͍ͯ͠Δ߹ͷΈ༗ޮ
MCHใऔಘܥAPIΠϝʔδ ਤؑότϧγϡϛϨʔλʔͳͲ
MarkingContract
Ethereum্ͰϢʔβʔใΛ͏ ʮϢʔβʔใʯ͋͘·ͰΦϑνΣʔϯͷใ Ethereum্ͰใΛѻ͏͜ͱ͕Ͱ͖ͳ͍ ϢʔβʔͷҙͰEthereum্ͷεϚʔτίϯτϥΫ τใΛॻ͖ࠐΈͰ͖ΔػೳΛՃ MarkingContractʢԾশʣΛσϓϩΠࡁΈ ։࢝࣌Ͱ50ਓҎ্ͷϢʔβʔ͕ެ։͍ͯ͠Δ
MarkingContractʢԾশʣ https://etherscan.io/address/ 0x0085C150c1eb0e084E50a80beA91bc414AA6cbaa ΦϑνΣʔϯͷϢʔβʔใΛهͨ͠ίϯτϥΫ τ ͋ΔEthereumΞυϨεͷϢʔβʔใɺPrime༗ແɺ Landॴଐใ͕औಘͰ͖Δ ϥϯυॴଐऀͷΞυϨεҰཡऔಘՄೳ
MarkingContractར༻Πϝʔδ ಁ໌ੑͷ͋ΔநબίϯτϥΫτ ϥϯυϝϯόʔઐ༻ϖʔδ MarkingContractʹใΛ͢͜ͱͰʓʓ͕Ͱ͖Δͱ ͍͏Ҋܴ GitHubʹιʔείʔυެ։ࡁΈ
֦ுMetadata
Ձ༰MetadataͰࢀরͰ͖Δ ΞηοτͷMetadataΛՃͰ͖Δ͜ͱͰɺMCHӡӦ Ҏ֎͕ՁΛ༩Ͱ͖Δ Ձ͕Ξηοτʹू·Δ͜ͱͰɺ༷ʑͳαʔϏεͷ HubʹͳΔ Ξηοτ͕ܧଓՄೳͳͷͱͯ͠ՁΛ࣋ͭΑ͏ʹ
Plus Meta APIʢԾশʣ ʮΞηοτͷՁ༰MetadataͰࢀরͰ͖Δʯͱ ͍͏ߟ͑ʹج͖ͮɺʮՁ༰ΛMetadataͱͯ͠ొ Ͱ͖ΔʯAPI ͜͜ͰMCHҰͭͷMetadataͰ͔͠ͳ͍
Plus Meta APIొ POST https://www.mycryptoheroes.net/experimental- api/plusmeta/heroes/50010001 { "iss": "0xd868711BD9a2C6F1548F5f4737f71DA67d821090", "metadata":
{ "sub": "my crypto derbies", "aud": [ "https://example.com/" ], "name": "deeeeep blue", "description": "͍͢͝", "attributes": { "hp": 100, "speed": 100, "skill": [ "dart", "sunny" ], "kind": "Mare" } } }
Plus Meta APIऔಘ GET https://www.mycryptoheroes.net/experimental- api/plusmeta/heroes/50010001
Plus Meta APIར༻Πϝʔδ MCHΞηοτΛͬͨϛχήʔϜͷ࡞ͱͦͷύϥ ϝʔλొ ΞηοτऔҾॴͳͲʹΑΔ৽ணใͷొ
࠶ҙࣄ߲ ͜͜Ͱհͨ͠ͷΛඞͣΘͳ͚ΕͳΒͳ͍Θ͚Ͱ͋ Γ·ͤΜɻ Ұ෦API͜ͷϋοΧιϯͷͨΊʹ࡞ͨ͠ͷͰ͢ɻ༧ࠂ ͳ͘มߋɺআ͞ΕΔ߹͕͋Γ·͢ɻ GitHubʹެ։ࡁΈ https://github.com/doublejumptokyo/mch-hackathon ͨΓલͷઆ໌Βͳ͍୯ޠ͕ͰΔ͔͠Ε·ͤΜ͕ɺ͜ ͷ͋ͱϝϯλʔͷํʑʹ࣭ͯ͠Έ͍ͯͩ͘͞ɻ
None