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
8k
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
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
230
Jakarta EE meets AI
ivargrimstad
0
130
ヤプリ新卒SREの オンボーディング
masaki12
0
130
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Better Code Design in PHP
afilina
PRO
0
130
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
受け取る人から提供する人になるということ
little_rubyist
0
250
役立つログに取り組もう
irof
28
9.6k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
180
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Documentation Writing (for coders)
carmenintech
65
4.4k
How GitHub (no longer) Works
holman
310
140k
Gamification - CAS2011
davidbonilla
80
5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
GitHub's CSS Performance
jonrohan
1030
460k
The Language of Interfaces
destraynor
154
24k
Six Lessons from altMBA
skipperchong
27
3.5k
For a Future-Friendly Web
brad_frost
175
9.4k
A Philosophy of Restraint
colly
203
16k
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