December 9, 2022

ERC 1155 NFTs – What is the ERC-1155 Standard?

Table of Contents

The uniqueness of NFTs (non-fungible tokens) offers countless opportunities, and developers can build all sorts of NFT-related projects with various use cases around them. That said, when you create an NFT project, whether that is a dapp displaying NFT collection data or enabling users to get all NFTs owned by an address, it’s important to understand various NFT standards properly. One such standard is ERC 1155, which is this article’s main focus!

Moving forward, we’ll first answer the “what is ERC-1155?” question. Next, we’ll ensure you understand the difference between ERC 721 and ERC 1155. You’ll also have a chance to learn about semi-fungible tokens. We’ll also ensure you familiarize yourself with ERC 1155 smart contracts. Furthermore, aside from ensuring that you understand the theory and the concepts, we’ll also look at a contract sample. Lastly, we’ll explore the easiest way to get an ERC-1155 wallet address. This is where you’ll learn about some of the ultimate Moralis NFT API endpoints and how to get a wallet balance easily. 

With all that said, there’s some theory we need to cover to ensure that you understand the ERC 1155 standard correctly. However, if you prefer to learn as you build, create your free Moralis account and tackle the many excellent tutorials awaiting in the Moralis docs. For instance, building your first dapp with NodeJS and NextJS is a great place to start. Then, you can proceed to the NFT API tutorials and return to this article whenever the “what is ERC-1155?” question comes to mind.  

wizard holding a cube with the text erc 1155

What is ERC-1155?

In short, the most common explanation of ERC 1155 (a.k.a. ERC-1155) defines it as an NFT token standard. While this is correct, it is at the same time just a partial definition. After all, ERC (“Ethereum Request for Comment“) actually sets the stage for multi-token management and transactions, meaning that a single contract of that standard can include different combinations of non-fungible, fungible, and semi-fungible tokens. 

Moreover, it’s worth pointing out that ERC 1155 originated from the Enjin team, which drew concepts and ideas from various token standards, mainly ERC 20 and ERC 721. However, in addition to combining the existing concepts, the new ERC standard also introduced some improvements. For example, under ERC-20 and ERC-721, devs had to deploy separate contracts for each fungible and non-fungible token. The latter often causes Ethereum’s blockchain to be overwhelmed with redundant bytecode. Also, separating each contract into individual addresses also posed certain functionality limitations. 

1155 ERC standard originated from the enjin team

Consequently, the Enjin team saw that a new standard was required if the NFT and broader token ecosystem were to grow and expand into other applications. So, the goal was to find a new way to minimize transaction volume and the inefficiencies of the contracts. By achieving that goal, Web3 gaming platforms and other types of token-based dapps (decentralized applications) could include NFTs. Fortunately, this progressive way of thinking led to the inception of ERC 1155. 

So, what is ERC-1155? It is a universal token standard that supports transferring different types of tokens in a single instance. This increased effectiveness reduces transaction costs and takes some load off the Ethereum chain. Furthermore, this ERC also supports atomic swaps and escrows of multiple tokens. Moreover, thanks to ERC 1155, the system no longer needs to approve token contracts individually.

graph illustrating differences between erc 1155 and erc 20

The Gold Standard for NFTs

ERC 1155 is the only token standard that enables you to create every type of tokenized asset, from currency and real estate to digital art and gaming items. In turn, this also makes it the gold standard for NFTs. Further, one of its key advantages is that it allows users to create new items without having to deploy new contracts, which is utilized by many NFT marketplaces. Moreover, since applying this feature makes more sense in NFT marketplace projects, it has resulted in ERC 1155 being a superior standard for NFT platforms.

Ultimately, this powerful ERC standard can take your blockchain development game to the next level, especially if you utilize its advantages with advancing tools, such as Moralis. Hence, it’s safe to say there is little to no reason to return to the older and more burdensome standard. However, you may still want to use ERC-20 and ERC-721 if they meet your need for simple projects. Simpler standards are also useful learning tools for all novice blockchain developers. Nonetheless, to help you further understand the two leading NFT standards, let’s look at them side by side.

erc1155 vs erc721

ERC 1155 vs 721

Even if you’ve just glanced at minting NFTs, you must have discovered that ERC-721 and ERC-1155 are the most popular standards for NFTs. However, ERC 721 was first on the scene and is, in turn, behind many older NFT projects. 

The inception of ERC 721 came in the form of a draft EIP (“Ethereum Improvement Proposal“). The latter was issued by Dieter Shirley, CTO of Dapper Labs. Furthermore, aside from William Entriken, Jacob Evans, and Nastassia Sachs, Dieter Shirley is also recognized as one of the authors of the ERC-721 standard. Moreover, this proposal became the basis for the game CryptoKitties.

From a technical perspective, the ERC 721 standard defines the minimum interface a smart contract has to implement. When this minimum is met, it allows Web3 wallets to own, trade, and manage NFTs. Also, ERC-721 doesn’t require a standard for metadata connected to tokens and doesn’t restrict adding functions that complement the minimum requirement. Furthermore, please remember that smart contracts for NFTs do not contain NFT-representing files. These files are too big, and saving them on the blockchain is not technically nor economically sound. Thus, NFT contracts only include the links, or URIs, to these files and their metadata. By taking this approach, NFTs reference off-chain resources and ensure that the blockchain is not responsible for hosting this data.

It’s safe to say that ERC 1155 is, in some ways, an improvement of ERC 721. After all, it can serve the same purpose. However, it also supports non-fungible and semi-fungible tokens. By looking at the following image, we can also compare the two standards:

a table showcasing pros and cons of erc 721 and erc 1155

Note: If you are more of a video person, we recommend watching the following:

Explanation of ERC 1155:

Explanation of ERC 721:

Semi-Fungible ERC 1155 Tokens

Among other things, ERC 1155 also introduced a new way to create semi-fungible tokens (SFTs). The latter are particular types of tokens that merge different properties of fungible and non-fungible tokens. In turn, this makes it possible to have the best of both worlds. 

To help you grasp SFTs, let’s consider a “store coupon” analogy. A store coupon is “fungible” as it holds a specific value and can be traded for an item worth the same value. Once redeemed, its value drops to zero and is no longer valid as a fungible item. Now, let’s say we have a store coupon that, once redeemed, gets its properties altered. For example, it changes the coupon’s info regarding the item, the customer, the price, etc. In turn, it becomes non-fungible. Essentially, a semi-fungible token standard, such as ERC1155, is capable of representing both attributes, enabling you to create SFTs – tokens that start as fungible tokens and end up as NFTs.

digital art cover showing users creating semi fungible tokens

Main Advantages of ERC 1155

Now that you can answer the “what are the ERC-1155 and ERC-721 standards?” question, it’s time to look at a list of the main advantages of ERC 1155:

  • Enables you to deploy NFTs, fungible tokens, and semi-fungible tokens
  • Gives you the ability to deploy multiple token types in a smart contract
  • Higher level of security
  • Lower gas fees
  • Enhanced support for decentralized exchanges (DEXs)
  • Less workload
  • Dynamic metadata

The above-listed advantages make ERC 1155 the ultimate token standard. However, ERC 721 and ERC 20 remain perfect for releasing individual non-fungible and fungible tokens. Thus, the nature of your project will tell you which standard to focus on. 

smart contract code

ERC 1155 Smart Contracts

At this point, you know that ERC 1155 smart contracts support multi-type token transfers at the same time. These types of Web3 contracts also enable you to build functionalities such as atomic swaps and escrows. Moreover, this enables you to eliminate the need to authorize individual token contracts separately, which is the case with ERC-721.  

Nonetheless, make sure to look at Enjin’s diagram below, showing how ERC 1155 simplifies a token swap of any number of tokens (even different kinds):

diagram showcasing how erc-1155 simplifies a token swap

The above diagram demonstrates that the entire batch gets approval and transacts in two simple steps known as an “atomic swap” of multiple tokens. This is why ERC1155 contracts save a lot on Ethereum gas fees. 

Additionally, thanks to ERC 1155 contracts, users can send multiple items to different recipients in a single transaction. Here’s a diagram demonstrating an example of such nature: 

transaction diagram of erc 1155 transactions

It’s quite amazing that a smart contract and a single transaction can handle transfers of different types to multiple users. 

Smart Contract Sample

If you want to answer the “what is ERC-1155?” question confidently, it helps to look at the following standard’s contract sample. The following lines of code represent an example of a simple ERC 1155 contract of tokenized items in a game:

// contracts/GameItems.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";

contract GameItems is ERC1155 {
    uint256 public constant COPPER = 0;
    uint256 public constant CRYSTAL = 1;
    uint256 public constant ELDER_SWORD = 2;
    uint256 public constant KNIFE = 3;
    uint256 public constant WAND = 4;

    constructor() public ERC1155("https://game.example/api/item/{id}.json") {
        _mint(msg.sender, COPPER, 10**18, "");
        _mint(msg.sender, CRYSTAL, 10**27, "");
        _mint(msg.sender, ELDER_SWORD, 1, "");
        _mint(msg.sender, KNIFE, 10**9, "");
        _mint(msg.sender, WAND, 10**9, "");

As you can see at the top, the above example utilizes the power of OpenZeppelin, which provides you with verified smart contract templates. Moreover, the above contract includes fungible and non-fungible game items. For example, copper is fungible, while “Elder_Sword” is non-fungible. 

Using “GameItems“, the above contract assigns a number to each item type. By doing so, each integer (“copper“, “crystal“, etc.) becomes an alias for “0“, “1“, and so on. On the backend, these item names are simply read as “0“, “1“, “2“, “3“, and “4“. 

various non-fungible tokens

The parts of the smart contract that actually creates tokens are the “mint” calls in “constructor“. The mint calls create new token types in the amount provided. So, copper is minted in the quantity of ten to the power of 18. Crystal is minted in the quantity of ten to the power of 27. However, the elder sword is minted in a single quantity. This clearly indicates that this item is unique – an NFT. 

Moreover, remember that there might be multiple instances of the same NFT-representing files, each with a unique on-chain ID. So, even though the knife and wand are minted in high quantities, they are NFTs. Hence, they represent individual items separate from one another and are not currency.

How to Get an ERC-1155 Wallet Address Balance

If you covered the above section, you now know what ERC-1155 is and what makes it useful. After looking at the above example, you may already have a proper understanding of how to write these types of contracts, especially if you know Solidity. If you don’t know but would like to, please understand that the creation of smart contracts and minting of NFTs exceeds the scope of this article. 

Instead, we want to use this final section to explain how to get an ERC-1155 wallet address easily. This is where Moralis simplifies things. But before we tell you which NFT API endpoint will get an ERC-1155 wallet address for you, we need to explain a few things.

First, keep in mind that the smart contracts used to mint NFTs also govern the corresponding NFTs’ transfers. This means that you can search for NFTs based on their smart contract addresses (a.k.a. collection addresses). However, once a user or player purchases or otherwise obtains ownership over a specific NFT, the latter becomes assigned to the user’s wallet. So, when you get an ERC-1155 wallet address, you are essentially fetching the owner of that token. Moreover, thanks to Moralis, you get to do that with a single line of code in two different ways:

  • Get an ERC-1155 wallet address by contract:
const response = await Moralis.EvmApi.nft.getNFTOwners({
  • Get an ERC-1155 wallet address by token ID:
const response = await Moralis.EvmApi.nft.getNFTTokenIdOwners({

Note: You can view the details of “getNFTOwners”, “getNFTTokenIdOwners”, and all other NFT API endpoints in Moralis’ documentation.

As a bonus, here’s also a video that will show you how to get any wallet’s native balance: 

ERC 1155 NFTs – What is the ERC-1155 Standard? – Summary

We covered quite a distance in today’s article. You first learned the answer to “what is ERC-1155?” and what makes it the gold standard for NFTs. Next, we looked at the “ERC 1155 vs 721” comparison. You also had a chance to learn what semi-fungible tokens are. After covering the basics, it was time to outline the main advantages of the 1155 standard. Nonetheless, we talked about smart contracts enforcing that ERC standard. This is where you also had an opportunity to explore an example contract. Last but not least, we explained how to get an ERC-1155 wallet address balance and native balances the easy way.

Moving forward, we recommend you take on one of the following two options:

  • Start building killer dapps
  • Explore other blockchain development topics

If you are eager to start building, you discovered at the outset that you only need to create your free Moralis account and follow our tutorials. On the other hand, if you’re interested in exploring other crypto topics, visit the Moralis YouTube channel and the Moralis blog. Some of the latest topics cover and Web3 storage, ethers.js vs Web3 streams, Palm NFT Studio, and much more. In addition, you may want to explore different blockchain development topics in a more professional manner. If so, consider enrolling in Moralis Academy. This is the place to become blockchain certified and learn about Ethereum fundamentals from professionals. 

Unlock the full potential of your NFT projects with this industry-leading NFT API! Fast, easy, and free.
Related Articles
November 28, 2022

Palm Blockchain – What is the Palm Network?

October 27, 2022

What is Aptos? Full Guide to the Aptos Blockchain

September 14, 2022

Complete Guide: How to Build an Avalanche Dapp in 3 Steps

August 14, 2022

How to Fetch an NFT by Address API – Exploring the NFT API

September 28, 2023

Full BSC Node Guide – How to Run BNB Smart Chain Nodes

November 7, 2022

Crypto Wallet Integration Using the Best Crypto Wallet API

December 14, 2022

An Introduction to Web3 Py – What it is and How Can Developers Use It

February 8, 2023

Ethereum Development Tools – How to Build Ethereum Projects in 2023

September 12, 2022

How to Build a Cronos Dapp in 5 Steps