[Crypto 4NE1] ERC-1155: The Multi Token Standard

MEYCHAIN OFFICIAL
4 min readMay 31, 2022

Tokens standards like ERC-20 and ERC-721 require a separate contract to be deployed for each token type or collection. This places a lot of redundant bytecode on the Ethereum blockchain and limits certain functionality by the nature of separating each token contract into its own permissioned address. With the rise of blockchain games and platforms like Enjin Coin, game developers may be creating thousands of token types, and a new type of token standard is needed to support them. However, ERC-1155 is not specific to games and many other applications can benefit from this flexibility.

One Smart Contract, Many Tokens

First introduced in 2019, the ERC-1155 standard can represent and control both fungible and non-fungible tokens, even both at the same time. It is a hybrid of ERC-20 and ERC-721 while addressing their flaws and limited functionality.

While ERC-20 and ERC-721 tokens required a new smart contract deployed for each new “class” of token, the core concept behind ERC-1155 is that a single smart contract can govern an infinite number of tokens.

Think of this like a vending machine that holds a wide variety of soda, juices, and even snacks. A customer interacts with the machine using a single secure interface (inserting a coin, pressing a button), and the machine dispenses the goodies they have selected. In the same way, an ERC-1155 contract made for a game could contain a wide variety of items, from weapons and armor to health potions, magic scrolls, and more.

Each of these items could be “fungible,” having more than one copy available. Fungible tokens are used for divisible currencies (most ERC-20 tokens), and they’re also very useful for stackable items that don’t need to be differentiated, like a bundle of arrows for a bow.

One-of-a-kind tokens are called non-fungible tokens (NFTs). This structure allows every token to have its own unique parameters, history, and mirrors the real world. A pet dragon in a video game could be an NFT and have a unique name of its own, a power level, and a rich history in the game.

ERC-721 vs ERC-1155

The most popular standards for NFTs are ERC-721 and ERC-1155.

As the first widely-used token standard in NFTs, the ERC-721 token standard is the most easily recognizable NFT token standard. Moreover, this standard allows apps to use Moralis’ Ethereum API for NFTs.

Technically, ERC-721 defines the minimum interface that a smart contract has to implement. This minimum interface allows unique tokens to be owned, traded, and managed. ERC-721 does not require a standard for metadata connected to the token. Furthermore, it does not restrict adding functions that supplement the minimum requirement.

It’s important to remember that a key feature of NFTs smart contracts is that they do not contain the artwork, images, or files themselves, but only the links or URIs to them and their metadata. Such tokens reference off-chain resources for such files and information so that the blockchain itself is not responsible for hosting this data.

ERC-1155 is in some ways an improvement of ERC-721 since its code does not only work for non-fungible tokens (NFTs) but semi-fungible ones as well, as we’ll see in the next section.

ERC-1155 Contracts

With ERC1155 contracts, it is now possible to transfer multiple types of tokens at the same time. You can build multiple functionalities such as atomic swaps and escrows (useful in trading) of various tokens on top of the ERC1155 standard. With this, you eliminate the need to authorize individual token contracts separately, as done with ERC-721. Moreover, as mentioned, you can combine several NFT and fungible token types in one ERC1155 contract.

ERC1155 — The Gold Standard

Large NFT marketplaces use versions of smart contracts. ERC1155 allows users to create new items without having to deploy new contracts on these marketplaces. Thus, ERC1155 presents an edge when you build dApps on Ethereum. Furthermore, it makes more sense in NFT marketplace builds, making it the new superior standard for NFT platforms created today. Alongside Moralis, which offers new powerful ways to optimize your NFT dApps and platforms, ERC1155 can take your blockchain development game to the next level.

With such advantages, there is little to no reason to go back to the older and more burdensome standard; however, it is still an option in simple projects and a useful learning tool for any novice blockchain developer or NFT programmer.

--

--

MEYCHAIN OFFICIAL

An interoperable blockchain to power real estate industry