How to Create & Integrate Game NFTs with Playfix

Tobias Abdon
The Playfix Chronicles
7 min readNov 11, 2022
Moonar City

Non-fungible tokens, or NFTs, are major instruments driving the adoption of blockchain-powered games. From tokenizing in-game assets to rewarding gaming activities, the possibilities of building a real-life economy around your game are endless.

Similar to conventional tokens, which are fungible and interchangeable, blockchain games can employ non-fungible, or unique tokens, for a variety of value-creation purposes in the game economy. While ordinary tokens use the ERC-20 token standard, non-fungible tokens use Ethereum’s ERC-721 or ERC-1155 token standards.

In a previous blog, we explained what ERC-20 tokens are and how to create them using the Playfix console.

In this article, we will explain what ERC-721 and ERC-1155 tokens are, and how to easily create NFT tokens of the ERC-721 standard using the Playfix console.

What are ERC-721 Tokens?

Blockchain based currencies and tokens follow standards, which are rules and functions on how the token works and interacts with its smart contract. Tokens on the Ethereum blockchain follow ERC (Ethereum Request for Comments) standards. Unlike ERC-20 which assigns the same token ID to all tokens in a smart contract, hence making them fungible, the ERC-721 standard tells a smart contract to assign unique token IDs that identify each token in a smart contract. That is, regardless of the similarities between each NFT item, they are unique and not interchangeable with each other, even if they belong to the same smart contract.

What are ERC-1155 Tokens?

ERC-1155 is an improvement on ERC-721. ERC-1155 token standard supports the creation of both fungible and non-fungible tokens from the same smart contract. That is, the ERC-1155 token standard has the capability of creating, and transferring both ERC-20 tokens and NFTs from the same smart contract.

Differences Between ERC-1155 and ERC-721?

Although ERC-721 is the most common standard for creating NFTs, both ERC-1155 and ERC-721 are great for creating NFTs. There are quite a few differences between these two ERC token types, but the following two stand out:

  • Token support: ERC-1155 supports the creation of both fungible and non-fungible tokens, while ERC-721 only supports the creation of the earlier.
  • Batch transfer of Tokens: ERC-721 does not allow transfer of multiple tokens at once. In contrast, ERC-1155 allows the transfer of multiple fungible and non-fungible tokens in one transaction.

Why use ERC-721 Over ERC-1155 for Game NFTs

ERC-721 excels at transferring solitary NFTs. It is perfect for use in a gaming economy where there are lots of users because it makes it easy to trace the owner of each NFT item.

Even though ERC-1155 allows for batch token transfers, ERC-721 is ideal for gaming use cases where NFT transfers are typically made to a single user who earns the token; one at a time.

Additionally, ERC-721 NFT standards are also widely used by leading blockchain games such as Axie Infinity and Splinterlands. This means that you’re in good company using ERC-721-based NFTs in your game.

How to Use ERC-721 standard NFTs in Games

In a conventional game, the only advantage a player receives from in-game purchases such as buying a character or upgrading armor is better gameplay within the confines of that particular game. This is changing thanks to blockchain gaming, and NFTs are its key enablers.

NFTs are unique, rare, and indivisible. In an NFT-backed gaming ecosystem, the same armor can be tokenized in a way that turns in-game purchases into transferable assets that can be exchanged for other digital assets or money, even outside the game. It also has an intrinsic value in that, regardless of what happens to the game, players who have purchased or collected the NFTs can use and trade them whenever they want. Also, NFTs are not tied to one game alone. Game developers can integrate an NFT collection into multiple games, driving better economic value for both the NFT and the games.

Players, outfits, armor, skills, and weapons are just a few examples of in-game items that can be represented using NFTs. Additionally, you can use NFTs to reward regular gameplay, contests, or special events in a gaming ecosystem.

Playfix’s NFT API and Console Overview

A flexible NFT API and an intuitive graphical console are important solutions for creating a scalable blockchain gaming economy. Using the Playfix NFT API from the console, developers can create NFT collections that can be minted and traded within and outside the game.

Creating an NFT with Playfix Console

Let’s walk through how to create ERC-721 standard NFTs for your game using the Playfix console.

Prerequisite

To complete this guide, you will need the following:

  • The MetaMask wallet extension installed in your browser. You can install the extension for your browser here.
  • Connect your MetaMask wallet to Polygon Mumbai Testnet by following this guide.
  • Send MATIC testnet tokens to your MetaMask wallet from the Polygon faucet.

Step 1: Create a Project

Game utilities such as tokens, NFTs, and wallets on the Playfix platform require you to create a project that will contain them. This allows you to create separate blockchain utilities for as many game projects as you want.

  1. Login to your Playfix account.
  2. Click on “Projects” from the sidebar.
  3. Click on “Create Project” in the top right corner of the Projects interface.
  4. Enter a Name, brief description of the project, and upload a cover.
  5. Click on “Create” to create your Playfix project.

Step 2: Create an NFT Collection

Next, you will create a NFT Collection. The NFT Collection is the container for all of your NFTs. You might have a collection for Characters, Land, and Accessories, for example.

  1. Navigate to NFTs on the dashboard of your newly created project
  2. Click on “Create new”.
  1. Enter a title for your NFT collection, and a symbol, preferably between 3–4 letters,
  2. Enter a mint price for NFTs in the collection. For example, 0.01, representing 0.01 MATIC.
  3. Enter your Ethereum address, as the initial owner of the NFTs, in the “Address” input field.
  4. Select “Polygon Mumbai Testnet” in the network field.
  5. Enter a short description of the NFT collection, then upload a cover image for the collection.

Step 3: Add NFT Item to a Collection

Next, it’s time to add the actual NFT images to the collection.

  1. Click on “Add NFT Item” on your newly created NFT Collection.
  2. Enter the title of the Item.
  3. Input a short description of the NFT item.
  4. Upload an image of the NFT item.
  5. You can add the unique attributes of the NFT item
  6. Click on create.

After creating the NFT item, it will appear as a draft under the NFT collection. You can modify, update the item while it’s still a draft. You can also add new NFT items to the collection.

To add multiple items to the collection, repeat this process for each of the NFT item.

Step 4: Deploy the NFT Collection

After adding all your NFT items to the collection, it is time to deploy the collection.

  1. Click on “Deploy” from the top menu bar.

This will trigger MetaMask process to deploy your NFT collection smart contract.

  1. Click on “Confirm” on the MetaMask pop-up tab to confirm the transaction fee and continue with the deployment process.

After confirming, Playfix will continue with the deployment process, and you’ll see a “Deployment successful” message once the deployment process is complete.

That’s it! You’ve just created an NFT collection and deployed it to the Polygon blockchain testnet in a matter of minutes! You can click on the NFT item to view the item’s details and mint it.

Playfix does the heavy lifting involved in creating a blockchain backend for your game; allowing you to create all you need for a blockchain gaming ecosystem in minutes instead of months.

To get started creating blockchain utilities for your game using the Playfix platform, contact us at start.playfix.io, and we’ll set you up with a Playfix account immediately.

--

--