CryptoKittiesで使われているNFT(Non-Fungible Token)なERC721 Tokenとは?




CryptoKittiesとは?

CryptoKittiesとはEthereumのブロックチェーン上で猫の交配、売買ができるゲームです。猫1匹がそれぞれ固有のトークンとしてブロックチェーン上に記録されており、それぞれ異なるパラーメータ(遺伝情報)を持ちます。

猫2匹分のトークンを持つと交配することができ、新しく猫(トークン)を生成することができます。

CryptoKittiesは2017年11月28日にリリースされ、1週間で5万匹の猫が取引され、660万ドルもの金額が取引される大ヒットサービスとなりました。そのため、Ethereumの全トランザクションの15%までに達し、ネットワークを圧迫するという問題を起こすほどの人気となりました。

ERC721とは?

CryptoKittiesの猫一匹それぞれがトークンなのですが、このトークンがERC721という規格に沿って実装されています。

ERC721の特徴としてNFT(Non-Fungible Token)という性質があります。Fungibilityとは代替性または代替可能性という意味で、ERC721ではこの代替性がないトークンということになります。

Fungibility 代替性とは?

代替性とは、日本円を例にするとある千円札は誰かが持っている千円札と価値が同じであるということです。千円札ごとに価値が違う場合、Fungibilityがあるとは言いません。

法定通貨は代替性があることでどこでも支払いができると言えます。

ERC721ではトークンごとに価値が異なる仕組みを導入することでNFTを実現しています。

どうやってトークンごとに価値を変えるのか

CryptoKittiesのトークンの中身は下記です。

このようにトークン自体に固有の値を持たせ、ある値に稀少性が出るように調整しているみたいです。そしてこの稀少性のあるパラメータを持って生成されたトークン(猫)は価値が高くなり、高値で売買されるようになります。

パラメータには下記があり、これによっていろんな種類の猫を生成しているみたいです。

  • 世代
  • 誕生日
  • クールダウンタイム
  • etc
struct Kitty {
    // The Kitty's genetic code is packed into these 256-bits, the format is
    // sooper-sekret! A cat's genes never change.
    uint256 genes;

    // The timestamp from the block when this cat came into existence.
    uint64 birthTime;

    // The minimum timestamp after which this cat can engage in breeding
    // activities again. This same timestamp is used for the pregnancy
    // timer (for matrons) as well as the siring cooldown.
    uint64 cooldownEndTime;

    // The ID of the parents of this kitty, set to 0 for gen0 cats.
    // Note that using 32-bit unsigned integers limits us to a "mere"
    // 4 billion cats. This number might seem small until you realize
    // that Ethereum currently has a limit of about 500 million
    // transactions per year! So, this definitely won't be a problem
    // for several years (even as Ethereum learns to scale).
    uint32 matronId;
    uint32 sireId;

    // Set to the ID of the sire cat for matrons that are pregnant,
    // zero otherwise. A non-zero value here is how we know a cat
    // is pregnant. Used to retrieve the genetic material for the new
    // kitten when the birth transpires.
    uint32 siringWithId;

    // Set to the index in the cooldown array (see below) that represents
    // the current cooldown duration for this Kitty. This starts at zero
    // for gen0 cats, and is initialized to floor(generation/2) for others.
    // Incremented by one for each successful breeding action, regardless
    // of whether this cat is acting as matron or sire.
    uint16 cooldownIndex;

    // The "generation number" of this cat. Cats minted by the CK contract
    // for sale are called "gen0" and have a generation number of 0. The
    // generation number of all other cats is the larger of the two generation
    // numbers of their parents, plus one.
    // (i.e. max(matron.generation, sire.generation) + 1)
    uint16 generation;
}

仮想通貨 × コンテンツの可能性

CryptoKittiesの登場により仮想通貨とコンテンツの融合に大きな可能性が見えてきた気がします。ERC721はコンテンツごとの価値の違いを表現できるところが面白いなと感じているところです。

ここから分散アプリケーション(DApps)の台頭が始まると思うのですが、どう使えばいいのかが難しいですね。素晴らしい技術はあってもこれをうまく使うアプリを作るのはなかなか難しそうです。

今後もEthereumの技術について最新情報を追っていきたいと思います。

おすすめ書籍

Ethereumを使ったDApps開発を学びたいなら今だとこの1冊が1番良いです!開発環境の構築から使うべきツール、フレームワーク、実装方法・注意点まで網羅的に解説されている書籍なのでおすすめです。出版も2018年1月ということでかなり新しい本で、DMM Bitcoinを作っているネクストカレンシー所属の方が書いているので信頼できます。

ビットコインとブロックチェーンの詳細をしっかりと学びたい方にはこちらの書籍が非常におすすめです。ウォレットの仕組み、楕円曲線暗号、P2Pプロトコル、公開鍵暗号などビットコインを支える技術について詳細に解説されています。また、サンプルコードを通して実際に手を動かして学べるので非常に濃い内容となっています。

The following two tabs change content below.

髙妻智一

2013年CyberAgent新卒入社 スマホゲームを作る子会社に所属し、サーバーサイドのエンジニアを担当。2年目の終わりから新規子会社の立ち上げに参加し、サーバーサイドのエンジニアリーダーとしてサービースのリリースから運用までを担当。 2018年仮想通貨のスマホウォレットを提供するGinco Incにブロックチェーンエンジニアとして入社。






よく読まれている関連記事はこちら




コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です