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
410
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
300
AWS上で動く世界No.1ブロックチェーンゲーム / No1 Blockchain Game on AWS
rmanzoku
1
2.9k
Other Decks in Programming
See All in Programming
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
5
630
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
210
Spatial Rendering for Apple Vision Pro
warrenm
0
110
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
情報漏洩させないための設計
kubotak
2
260
ドメインイベント増えすぎ問題
h0r15h0
2
340
テストコード書いてみませんか?
onopon
2
130
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Mobile First: as difficult as doing things right
swwweet
222
9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Why Our Code Smells
bkeepers
PRO
335
57k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
The Cult of Friendly URLs
andyhume
78
6.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Code Review Best Practice
trishagee
65
17k
Building Adaptive Systems
keathley
38
2.3k
Site-Speed That Sticks
csswizardry
2
190
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