NFTs

Intro

NFTs, or Non-Fungible Tokens, are a type of digital asset that represent ownership of an in-game item such as a sword, shield, or magic wand. NFTs can be sent between players to transfer ownership of an in-game item.

NFT Explained

NFT Tokens and NFT Collection

Non-Fungible Tokens (NFT) are the records on the blockchain that contains essential information about the token and address that owns the token.

NFTs are grouped in collections. You can think of them as folders such as that each collection is a folder and each token is a file in the folder.

Create NFT Collection

Create NFT Collection can be seen as creation of a folder for the NFTs of the game. One game can have multiple NFT Collections.

Only AppAgent addresses can own and manage NFT Collections.

Mint NFT

Minting an NFT is creating a blockchain record that represents an in-game asset on the blockchain.

This record contains information about who owns the asset. Blockchain addresses of any type can own an NFT token - both regular and keyless addresses.

Withdraw NFT

When the game processes a withdrawal requested by a player, the player' blockchain address becomes the owner of the token. At the same time the in-game item shall be deleted from the in-game account of the player.

TODO add diagram

On the diagram above the game preliminary minted the token. Another strategy that the game can employ is to mint token directly to the player' address.

Transfer NFT

When the first player Alice transfers an NFT, she sends a blockchain transaction, which changes the owner of the token. From this point on, another player Bob becomes a new owner of NFT and can freely transfer the token to other blockchain addresses.

This transfer is facilitated by the decentralized infrastructure and doesn't require any support / action from the game.

Deposit NFT

When the player transfers the token back to the game (makes a deposit) the game becomes the owner of the token and issues a deposit of the in-game item to the player's account.

After the successful deposit the token is not bound to the player. Later the game can send this token to another player on withdrawal of the same in-game item. Or the game can burn the token and mint it again when needed.

Burn NFT

The AppAgent admins can burn previously created NFTs. In this case, the record of the token is completely deleted from the blockchain.

The AppAgent admins can burn NFT at any moment regardless who owns the token - a keyless address controlled by the AppAgent or a regular blockchain address controlled by a player. This power comes with responsibility - all actions with player' tokens must be justified.

NFT Metadata

The blockchain record of NFT contains a link to the metadata - a JSON file with information about the token such as a name and a link to the cover image. The blockchain only stores a permanent link to the JSON file. The JSON file itself is stored on a server or in a Content delivery network (CDN). Client apps such as TRAIT wallet rely on metadata for displaying the token to the user. Metadata is the key element for NFT interoperability and a good player experience.

The blockchain record doesn't contain anything directly related to the visual assets, such as 3D models, textures, or shaders.

What data can be stored on-chain?

Generally, on-chain storage is suitable for critical data that requires immutability and transparency such as transaction records, token ownership. However, off-chain storage is preferred for large data sets such as multimedia files since storing them on the blockchain would be inefficient or costly.

Read more about Metadata

Guides to using NFTs in your app:

Discover more:

Last updated