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
520
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
CSC305 Lecture 13
javiergs
PRO
0
120
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
3
1.2k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
530
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
0
210
いかにして不足・不整合なくデータ移行したか
tjmtmmnk
1
1k
WEBエンジニア向けAI活用入門
sutetotanuki
0
290
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
3
1k
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
110
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
3
1.1k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
290
Nuxt UI Pro、NuxtHub、Nuxt Scripts、Nuxtエコシステムをふんだんに利用して開発するコーポレートサイト@Vue Fes Japan 2024
shingangan
3
840
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Being A Developer After 40
akosma
86
590k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The World Runs on Bad Software
bkeepers
PRO
65
11k
How GitHub (no longer) Works
holman
311
140k
Designing for Performance
lara
604
68k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
We Have a Design System, Now What?
morganepeng
50
7.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Into the Great Unknown - MozCon
thekraken
31
1.5k
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