Ethereum Token Standards: ERC-20 vs ERC-721 vs ERC-1155

Ethereum has exploded in main stream popularity over the past 12–18 months driven notably by the meteoric rise in price of the network’s native asset, Ether. The Ethereum network is a collection of smart contracts. Originally there were no strict rules about what smart contracts had to do, but over the years the Ethereum community developed a variety of standards for documenting how a contract can interoperate with other contracts. Now all of these smart contracts are written and implemented using the aforementioned agreed upon community standards. These standards usually come in the form of EIP’s (Ethereum Improvement Proposals) or ERC’s (Ethereum Request for Comment). The Ethereum development standards we will look at today focus specifically on token interfaces. These standards help ensure smart contracts remain composable, meaning when a new project issues a token it remains compatible with existing decentralized exchanges. The ability for developers to issue tokens on the Ethereum network has underpinned most of the economic value created within the ecosystem to date. In this article we will explore three of the most popular token standards used on Ethereum: the ERC-20, ERC-721, and ERC-1155 standards by evaluating what makes them unique and the use cases each are built for.

What is a token?

First we need to lay a solid foundation by understanding what a “token” actually is. A token is a representation of something on the blockchain. It can represent anything ranging from money, shares in a company, reputation points, deeds of ownership, or even voting rights. Much of the uncertainty surrounding tokens usually comes from a lack of clarity in the distinction between token contracts and actual tokens. A token contract is simply an Ethereum smart contract and “sending tokens” just means calling a method on a smart contract that someone has written and deployed. In reality, a token contract is basically the mapping of addresses to balances (plus some methods to add and subtract from those balances). It is the balances that represent the actual tokens themselves. Each token is created by a smart contract and someone “has tokens” when their balance in the token contract is non-zero.

As you might imagine there is a big difference between holding two voting rights tokens vs two deed of ownership style tokens: Each vote is equal to all other votes but the same could not be said about a house! This is where we run into the issue of fungibility. Fungible goods are interchangeable and equivalent such as Ether, fiat currencies, and voting rights. Non-fungible goods are distinct and unique, like deeds of ownership, or collectibles. Typically ERC-20 tokens are used to represent fungible items, ERC-721 tokens are used to represent non-fungible items, and the ERC-1155 standard offers you the ability to deal with a hybrid of both fungible and non-fungible assets within the same smart contract. A good way for people who are new to this idea to think about the difference between these types of tokens would be that when dealing with non-fungible tokens (ex. a house or art) you care more about which ones you have, whereas with fungible assets (ex. Ether or US Dollars) it matters more how much you have.

ERC-20 Token Standard

Lets start by looking at the ERC-20 Token standard which was first proposed in 2015 by Fabian Vogelsteller and officially finalized in 2017. As previously noted ERC-20 tokens are fungible and as a result useful for things like a medium of exchange currency or voting rights. An ERC-20 Token acts just like Ether, meaning that 1 Token is and will always be equal to any other single token. This is why ERC-20 tokens are the go-to model for ICO’s (Initial Coin Offerings). Before the ERC-20 standard was adopted, each token contract was slightly different. This was a problem because it meant exchanges and wallets had to write custom code to support each different token. ERC-20 introduced a community standard for Fungible Tokens and as a result exchanges and wallet providers now only have to implement this code once. This gave those wallets and exchanges the ability to easily support all ERC-20 tokens without having to update constantly and the flexibility to add new tokens quickly. The ERC-20 token standard gives developers a guideline for creating their own token by defining 6 mandatory functions that your smart contract should implement (totalSupply, balanceOf, transfer, transferFrom, approve, and allowance) and 3 optional ones (name, symbol, and decimals). Sticking to this standard allows developers to build token applications that are interoperable with other products and services. The specific details about what each of these required methods actually control is beyond the scope of this article but has been explained thoroughly in the Ethereum documentation.

ERC-721 Standard

The next standard we will look at, ERC-721, has exploded in popularity as of late by being the go to token standard for NFT’s (Non-Fungible Tokens). ERC-721 was proposed by William Entriken, Dieter Shirley, Jacob Evans, and Nastassia Sachs in January 2018. In their initial accompanying Ethereum Improvement Proposal the group explicitly stated: “ NFTs can represent ownership over digital or physical assets. We considered a diverse universe of assets, and we know you will dream up many more: Physical property (ex. unique artwork), Virtual collectables (ex. collectable cards), “Negative value” assets (ex. loans).” Every NFT is identified by a unique uint256 ID inside the ERC-721 smart contract. This identifying number CAN NOT change for the life of the contract. As a result, the contract address and uint256 tokenId create a pair that will then be a globally unique and fully-qualified identifier for a specific asset on an Ethereum chain.

There are many use cases of Ethereum smart contracts that depend on tracking assets where some items are valued more than others due to their usefulness, rarity, or some other attribute. This new standard enabled developers to create digital non-fungible tokens that represent things such as valuable collectibles, art, real estate and more. It is important in cases like this that these assets are distinguishable and have their ownership individually tracked. By doing this these unique tokens can have a different value than other tokens from the same smart contract. Having a standard interface to deal with these situations allows broker, auction, and wallet applications to work with any NFT on Ethereum. The facilitation of a uniform standard that allows for cross-functional asset management and sales platforms has contributed an immense amount of value to the Ethereum ecosystem since ERC-721 was adopted. Some of the most popular NFT’s created to date are CryptoPunks, Bored Ape Yacht Club, LAND in Decentraland, and in-game items using systems like EnjinCoin.

ERC-1155 Standard

ERC-1155, sometimes referred to as the “Multi Token Standard”, was adopted by Ethereum as an official token standard in June 2019 after being created by Enjin CTO Witek Radomski. The goal was to create a new token standard by taking the best things from previous standards and forming a new fungibility-agnostic and gas-efficient token contract. The ERC-1155 standard allows for infinite amounts of both fungible (identical), non-fungible (unique), and semi-fungible tokens to exist in a single deployed smart contract. This essentially means it can handle both the functions of the ERC-20 and ERC-721 standards at the same time. It also allows for more efficient trades and bundling of transactions, which lower costs when compared to alternative token standards. This is because standards like ERC-20 and ERC-721 require a separate contract to be deployed for each fungible or non-fungible token making it extremely expensive and inefficient to deploy large databases of items used in things such as mainstream video games. Two of the main features that shine when using the ERC-1155 token standard are Batch Transfers, which can transfer multiple assets in a single call very similarly to regular ERC-20 transfers, and Batch Balance, which gets the balances of multiple assets in a single call. ERC-1155 accounts have a distinct balance for each token id, and non-fungible tokens are implemented by simply minting a single one of them. This approach leads to massive gas savings for projects that require multiple tokens.

By now there seems to have been tokens issued on Ethereum that represent just about any asset you can think of. But as you can see there is a method to this madness. All relevant developers and projects working on Ethereum Virtual Machine (EVM) compatible blockchains have adopted the ERC token standards we have discussed here today. This allows for a level of interoperability and cohesion within the community that would otherwise be sorely lacking if the developers building useful projects were just haphazardly deploying code without being on the same page. Hopefully you now have a basic understanding of the three most popular token standards utilized today and will be more confident when interacting with blockchain assets after learning the capabilities and use cases of these different token types.


Previous
Previous

Bitcoin Surpasses PayPal in Transaction Volume, Could Overtake Mastercard in Five Years: Blockchain Intelligence Firm Blockdata

Next
Next

Former PayPal CEO's Cryptocurrency Exchange Goes Live for Institutional Clients