Typefully

A Gentle Introduction to ERC Standards: ERC20 vs ERC721 vs ERC1155

Avatar

Share

 • 

3 years ago

 • 

View on X

✨A Gentle Introduction to ERC Token Standards: ERC20 vs ERC721 vs ERC1155✨ A thread. 🧶
✨First of all, WTH is ERC?✨ ERC stands for Ethereum Request for Comments, and it is a proposal document that developers write which is then reviewed by the Ethereum community using a process called 'Ethereum Improvement Proposal' or EIP.
✨What is ERC-20?✨ ERC-20 is the 20th proposal and is the most commonly used token standard in the Ethereum ecosystem.
The tokens created using the ERC-20 standard have three properties: 🔹 They are fungible: all tokens hold the same value. 🔹 They are transferrable: can be sent from one address to another. 🔹 They have a fixed supply.
✨The Need for ERC-20✨ Back in the day when everyone was trying to come up with their own fungible tokens, there were no set rules or guidelines for developing tokens. As a result, all the tokens were different from each other.
This was extremely painful for developers to work with other tokens, and for exchanges and wallets to list and handle different tokens on their platforms. Plus, developing new tokens meant basically reinventing the wheel every frickin' time.
The ERC-20 introduced a standard (or a set of rules) that allowed developers to create their own 'Fungible' tokens on the Ethereum blockchain. It laid out a set of guidelines that all Ethereum-based tokens must adhere to.
Today, wallets like Metamask and exchanges like Binance use the ERC-20 standard to list various standardized tokens onto their platforms and handle the exchange of value between them.
ERC-20 provides a standard interface for fungible tokens. So, what is an Interface? An interface defines rules that a program must follow. In this case, it contains a set of functions and events that a smart contract must implement.
The ERC-20 standard defines three optional and six mandatory functions that a smart contract should implement to create & manage a fungible token.
Apart from these functions, the smart contract should also emit two events:
✨What is ERC-721?✨ While the ERC20 standard caters to the creation of fungible tokens, ERC721 is the token standard for creating non-fungible tokens (NFTs). Proposed by William Entriken, Dieter Shirley, Jacob Evans, & Nastassia Sachs from the CryptoKitties team in 2018.
The ERC-721 standard defines a minimum interface a smart contract must implement to allow unique tokens to be managed, owned, and traded.
Unlike the ERC-20 standard, where there is no concept of "uniqueness", all tokens that are created using the ERC-721 standard are "non-fungible" or unique, and each NFT is linked to its respective owner and possesses its metadata and a unique `tokenId`.
The use cases for the ERC-721 can be both digital & physical ownership. We can own digital assets like digital art, music NFTs, digital land like Decentraland, as well as physical assets like tokenized house deeds & real art.
The ERC-721 standard has the following functions that a smart contract should implement:
Apart from these functions, the ERC-721 smart contract should also emit the following events:
While the ERC-721 token standard allows us to create unique "non-fungible" tokens, it does have its shortcomings. 1️⃣ Can't do batch transfers. 2️⃣ Gas inefficient. 3️⃣ Storage redundant.
Now that we know that ERC20 & ERC721 standards provide an interface for managing fungible & non-fungible tokens respectively. What if there was a single standard that could facilitate the creation of both fungible & non-fungible tokens in a single deployed smart contract?🤔
✨What is ERC-1155?✨ 🔹The ERC-1155 token standard combines the abilities of both ERC-20 and ERC-721 & tackles their shortcomings by providing a standard interface for smart contracts to manage multiple token types. 🔹Introduced by Witek Radomski & the Enjin team in 2018.
✨Some key features of ERC-1155✨ 🛠 Ability to create fungible, non-fungible, and semi-fungible tokens with a single smart contract. 🔀 Ability to do batch transfers. ⛽️ Gas efficient. 📦 Requires less storage space.
✨One key difference between the ERC20, ERC721, and ERC1155✨ 🔹 The ERC20 maps different addresses to the no. of tokens they hold, 🔹 The ERC721 maps unique token IDs to owners, 🔹 The ERC1155 has a nested mapping of IDs to owners to amount of tokens they own.
The ERC-1155 token standard has the following functions that a smart contract should implement:
✨ERC-1155 Events✨
✨Closing Thoughts✨ So, we've learned how the ERC20 provides a basic structure for the creation of fungible tokens, and how ERC-721 tackled the shortcomings & inefficiencies of the ERC-20 by providing a standard interface for creating & managing non-fungible tokens.
And then how the ERC-1155 standard sort of combines the abilities of both ERC-20 and ERC-721 by tackling their shortcomings such as storage redundancy and gas inefficiency, providing a "best of both worlds" experience.
If you'd prefer reading long-form content, here’s a blog post that goes into a little more detail, especially the interface functions & events of these token standards. cryptoshuriken.com/a-gentle-intro-to-erc-standards
Also, please consider subscribing to my newsletter & get content like this delivered right into your inbox. ⬇️ cryptoshuriken.com/#/portal/
Avatar

Akshay

@cryptoshuriken

Social Media Manager @Impact3Growth / Helping crypto brands & KOLs go viral / Memecoin degen