Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MCH Hackathon技術情報 / MCH Hackathon API

MCH Hackathon技術情報 / MCH Hackathon API

2019-04-20 開催されたHackthon向けAPI情報です。

3383368c2bd31bbc7cc9c6043e335e09?s=128

Ryo Manzoku

April 20, 2019
Tweet

Transcript

  1. Hackthonٕज़৘ใ 2019–04-20 MCH Hackathon @rmanzoku

  2. ஫ҙ ͜͜Ͱ঺հͨ͠΋ͷΛඞͣ࢖Θͳ͚Ε͹ͳΒͳ͍Θ͚Ͱ͸͋ Γ·ͤΜɻ Ұ෦API͸͜ͷϋοΧιϯͷͨΊʹ࡞੒ͨ͠΋ͷͰ͢ɻ༧ࠂ ͳ͘มߋɺ࡟আ͞ΕΔ৔߹͕͋Γ·͢ɻ GitHubʹ΋ެ։ࡁΈ https://github.com/doublejumptokyo/mch-hackathon ౰ͨΓલͷઆ໌΍஌Βͳ͍୯ޠ͕ͰΔ͔΋͠Ε·ͤΜ͕ɺ͜ ͷ͋ͱϝϯλʔͷํʑʹ࣭໰ͯ͠Έ͍ͯͩ͘͞ɻ

  3. MyCryptoHeroesʹ͍ͭͯ

  4. MyCryptoHeroes͓͞Β͍ ERC721Λ࢖ͬͨHero / Extension / LandSectorͷ Ethereum্ͷAsset Ethereum্Ͱͷॴ༗ݖΛӡӦॴ༗ͷεϚʔτίϯτ ϥΫτʹ༬͚Δ͜ͱͰɺCryptoWorldʢήʔϜ಺ʣͰ ར༻ՄೳʹͳΔʢLandSector͸ྫ֎ʣ

    ήʔϜ಺ͷ৘ใ͸Ұ෦ެ։APIΛ௨ͯ͠ࢀরͰ͖Δ
  5. MyCryptoHeroes͓͞Β͍ Ϣʔβʔ͸ήʔϜ಺ʹUserIDΛ͍࣋ͬͯΔ UserIDͱEthereumΞυϨεΛඥ͚ͮͯ؅ཧ͍ͯ͠Δ EthereumΞυϨεΛެ։͢ΔػೳʹΑΓɺ༗ޮͳ Ϣʔβʔ͸EthereumΞυϨε͔ΒϢʔβʔ৘ใΛऔ ಘͰ͖Δ

  6. ERC 721 / Metadata

  7. ERC 721 Ethereumͷඪ४ن֨ͷҰͭͰNon-Fungible TokenʢNFTʣΛنఆ ͨ͠ΠϯλʔϑΣʔε NFTͱ͸ɺ୅ସෆՄೳͳ΋ͷ CryptoKittiesΛൃ୺ʹEthereum্ͰToken/Assetͷॴ༗ݖͳͲΛنఆ ࢀর࣮૷ͱͯ͠OpenZeppelinOSͷ΋ͷ͕༗໊ CryptoZombies΋ERC721 ERC20ͱൺֱ͞ΕΔ

  8. ERC721 ར༻Πϝʔδ MCHΞηοτ͸OpenZeppelinΛར༻ͨ͠ERC721ʹ ४ڌ͍ͯ͠ΔͷͰɺ޿͘࢖ΘΕΔERC721ͱͯ͠ར༻ Ͱ͖Δ ϨϯσΟϯάͳͲ

  9. ERC 721 Metadata MCHͷHero͕HeroͨΒ͠Ί͍ͯΔϝλ৘ใ Heroͷ໊લ΍ϨϕϧɺύϥϝʔλͳͲ ΦϑνΣʔϯ৘ใΛ఻͑ΔJSON APIͰ͋Δ͜ͱ͕ଟ͍ OpenSea΍bazaaar.ioͳͲ͸͜ͷ৘ใΛऔಘͯ͠දࣔͯ͠ ͍Δ MCH+Ͱ͸ɺ͜ͷMetadataΛ֦ு͢Δ͜ͱʹΑͬͯΞ

    ηοτʹ͍ΖΜͳՁ஋Λ௥Ճ͍͚ͯ͠ΔͷͰ͸ͳ͍͔
  10. 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
  11. MCH৘ใऔಘܥAPI

  12. Ξηοτʹؔ͢Δ৘ใ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

  13. Ϣʔβʔ৘ใAPI UserID΋͘͠͸EthereumΞυϨεͰϢʔβʔΛݕࡧ https://www.mycryptoheroes.net/experimental-api/ proxy/mch/users/10001 https://www.mycryptoheroes.net/experimental-api/ proxy/mch/users/ 0xd868711BD9a2C6F1548F5f4737f71DA67d821090 ޙऀ͸EthreaumΞυϨεΛެ։͍ͯ͠Δ৔߹ͷΈ༗ޮ

  14. MCH৘ใऔಘܥAPIΠϝʔδ ਤؑ΍ότϧγϡϛϨʔλʔͳͲ

  15. MarkingContract

  16. Ethereum্ͰϢʔβʔ৘ใΛ࢖͏ ʮϢʔβʔ৘ใʯ͸͋͘·ͰΦϑνΣʔϯͷ৘ใ Ethereum্Ͱ৘ใΛѻ͏͜ͱ͕Ͱ͖ͳ͍ Ϣʔβʔͷ೚ҙͰEthereum্ͷεϚʔτίϯτϥΫ τ΁৘ใΛॻ͖ࠐΈͰ͖ΔػೳΛ௥Ճ MarkingContractʢԾশʣΛσϓϩΠࡁΈ ։࢝࣌఺Ͱ50ਓҎ্ͷϢʔβʔ͕ެ։͍ͯ͠Δ

  17. MarkingContractʢԾশʣ https://etherscan.io/address/ 0x0085C150c1eb0e084E50a80beA91bc414AA6cbaa ΦϑνΣʔϯͷϢʔβʔ৘ใΛه࿥ͨ͠ίϯτϥΫ τ ͋ΔEthereumΞυϨεͷϢʔβʔ৘ใɺPrime༗ແɺ Landॴଐ৘ใ͕औಘͰ͖Δ ϥϯυॴଐऀͷΞυϨεҰཡऔಘ΋Մೳ

  18. MarkingContractར༻Πϝʔδ ಁ໌ੑͷ͋ΔநબίϯτϥΫτ ϥϯυϝϯόʔઐ༻ϖʔδ MarkingContractʹ৘ใΛ଍͢͜ͱͰʓʓ͕Ͱ͖Δͱ ͍͏Ҋ΋׻ܴ GitHubʹιʔείʔυެ։ࡁΈ

  19. ֦ுMetadata

  20. Ձ஋಺༰͸MetadataͰࢀরͰ͖Δ ΞηοτͷMetadataΛ௥ՃͰ͖Δ͜ͱͰɺMCHӡӦ Ҏ֎͕Ձ஋Λ෇༩Ͱ͖Δ Ձ஋͕Ξηοτʹू·Δ͜ͱͰɺ༷ʑͳαʔϏεͷ HubʹͳΔ Ξηοτ͕ܧଓՄೳͳ΋ͷͱͯ͠Ձ஋Λ࣋ͭΑ͏ʹ

  21. Plus Meta APIʢԾশʣ ʮΞηοτͷՁ஋಺༰͸MetadataͰࢀরͰ͖Δʯͱ ͍͏ߟ͑ʹج͖ͮɺʮՁ஋಺༰ΛMetadataͱͯ͠ొ ࿥Ͱ͖ΔʯAPI ͜͜Ͱ͸MCH΋ҰͭͷMetadataͰ͔͠ͳ͍

  22. 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" } } }
  23. Plus Meta APIऔಘ GET https://www.mycryptoheroes.net/experimental- api/plusmeta/heroes/50010001

  24. Plus Meta APIར༻Πϝʔδ MCHΞηοτΛ࢖ͬͨϛχήʔϜͷ࡞੒ͱͦͷύϥ ϝʔλొ࿥ ΞηοτऔҾॴͳͲʹΑΔ৽ண৘ใͷొ࿥

  25. ࠶౓஫ҙࣄ߲ ͜͜Ͱ঺հͨ͠΋ͷΛඞͣ࢖Θͳ͚Ε͹ͳΒͳ͍Θ͚Ͱ͸͋ Γ·ͤΜɻ Ұ෦API͸͜ͷϋοΧιϯͷͨΊʹ࡞੒ͨ͠΋ͷͰ͢ɻ༧ࠂ ͳ͘มߋɺ࡟আ͞ΕΔ৔߹͕͋Γ·͢ɻ GitHubʹ΋ެ։ࡁΈ https://github.com/doublejumptokyo/mch-hackathon ౰ͨΓલͷઆ໌΍஌Βͳ͍୯ޠ͕ͰΔ͔΋͠Ε·ͤΜ͕ɺ͜ ͷ͋ͱϝϯλʔͷํʑʹ࣭໰ͯ͠Έ͍ͯͩ͘͞ɻ

  26. None