TLDR:
ERCs are application level EIPs (Ethereum Improvement Process). They define a set of functions that a smart contract must implement to follow a standard.
ERC721 is the first NFT standard on Ethereum and spun out from Cryptokitties, its interoperability allowed NFT marketplaces like Opensea to emerge.
ERC721 has an individual metadata per NFT, while ERC1155 has a singular metadata for multiple NFTs.
New ERC standards and extensions are always cropping up, a healthy ecosystem will lead to more ERCs and hence more building blocks for Ethereum apps.
This week I’ve decided to break down what ERC standards are and their relevance in the space as they are a corner stone of NFTs. Most people in the space have probably seen the term “ERC” thrown around at some point or another, for example with ERC721, but probably have no idea what it stands for or what a “standard” even is.
As I covered in a previous post highlighted below, we’ll only reach mainstream adoption when we stop talking about the tech and start focusing on its use-cases. Nonetheless, the truth today is that we still talk about NFTs often in terms of the standards they implement, so it’s important to know what they are.
We’ll go through a bit of history of the NFT standards and dive into the space’s two most well known ERC standards, namely ERC721 and ERC1155.
What is an “ERC Standard”?
The first step is for us to simply understand what the term “ERC Standard” even means. This requires us breaking down the meaning for both “ERC” and “standard”, let’s start with the latter.
A standard is a document that provides requirements, specifications or guidelines that can be used consistently to ensure that materials, products or processes are fit for purpose. The International Standards Organization (ISO) explains them “as a formula that describes the best way of doing something” and that “Standards are the distilled wisdom of people with expertise in their subject matter and who know the needs of the organisations they represent”.
Essentially standards allow technology to combine seamlessly by providing common guidelines and by making components interoperable. An obvious example in the analog world is the voltage and plug-types of electricity sockets that are all standardised between countries with 2 or 3 main standards. Without these standards every single electricity socket could be different and it would be chaos.
ERC stands for “Ethereum Request for Comments” and comes from the EIP “Ethereum Improvement Process”. Ethereum’s EIP is a concept copied from Bitcoin’s BIP and does exactly what it says on the tin as it defines a process by which we can propose improvements for Ethereum. Proposals for the core Ethereum network use the term EIP, while application level EIPs like token specifications are called ERCs. They are accompanied with a number to differentiate each one like “721”, the number is unimportant as long as it does not clash with an already existing proposal’s number. You can see a diagram of an EIP proposal’s life cycle below:
EIPs/ERCs begin as an idea, get written as a draft, spend time being reviewed and questioned by the community, go through a last call, then eventually make their way to become final. However, most are never finalised as they become stagnant and get abandoned or withdrawn along the way. Plus even those that make it to the final stage do not necessarily become adopted by the mainstream.
Therefore, you can view ERCs essentially as way of standardising code allowing us to build composable and interoperable application level software on Ethereum more easily. Precisely, ERC standards define specific functions that a smart contract must implement and what those functions must do.
The first Ethereum NFT standard
In late 2017 Dapper Labs released an experimental game on the Ethereum blockchain called Cryptokitties that assigned Ethereum tokens with cute pictures of cartoon kittens and gave them unique traits. The game led to Ethereum experiencing significant network congestion for the first time ever due to a high volume of transactions as people traded and bred these digital kitties. Not so long after Dapper Labs themselves span out the ERC721 standard from Cryptokitties.
NFTs had already been around in the crypto space for a long time, with projects like Rare Pepes on Bitcoin and Cryptopunks on Ethereum. However, neither of these followed clear standards and the ERC721, even though not an overly complex standard, created the foundation for an explosion of innovation and the rise of NFTs as a significant segment within the crypto ecosystem.
The ERC721 standard defined a set of functions that smart contracts had to follow to fit the criteria of being considered an NFT. It was inspired by its earlier cousin the ERC20 that defined a standard for fungible tokens, the difference here being that with ERC721 each token was uniquely different. With these predefined functions other developers could create generic software that would interact with any new NFT smart contracts created that followed the standard.
This gave rise to marketplaces like Opensea that saw the potential for trading ERC721 tokens, and when the last bull-run of 2021-22 kicked in and NFTs exploded in popularity, Opensea grew to be the primary marketplace for NFTs ballooning into a billion dollar company. Nowadays there’s plenty of other marketplaces like Blur for pro-traders and SuperRare for the art niche. Since there’s a clear standard to follow these marketplaces can write their code with the certainty that all NFTs will be compatible.
The 2 main types of NFT standard that have proliferated the most on Ethereum and other EVM compatible chains are the ERC721 and the ERC1155 standard that followed. Learning these two standards allows you to understand how over 95% of NFTs work today as they are the base on which much of the NFT space has evolved.
ERC721
As explained above the ERC721 standard essentially just defines a set of functions that a smart contract must implement to be an NFT. The standard is not particularly complex, and a smart contract only needs to implement a small set of functions shown below to be ERC721 compliant.
Although there are not many functions, these are enough to ensure the smart contract has the ability to transfer a uniquely individual token with a specific identifier to a unique owner.
The standard has “optional” extensions IERC721Metadata and IERC721Enumerable that pretty much all NFTs implement allowing them to store some specific metadata for each NFT. It just means that there’s a few more functions to implement for this additional benefit. New devs don’t need to write most of these functions themselves as there are already battle-hardened standard implementations for all of them in repositories like OpenZeppelin.
Other than an NFT’s name and symbol, the most important part here is the “tokenURI” function that takes an index and returns the URI for that NFTs accompanying “metadata”. The smart contract stores a pointer (or URI) to somewhere on the internet with this “metadata”, which in itself is nothing more than a set of hard-coded variables in a file that describe this specific NFT.
In most cases the metadata is stored on some decentralised storage like IPFS (we’ll discuss IPFs in a future post). This means the blockchain only stores who owns each token and a pointer to some outside data for each token. Example metadata for an Azuki NFT is shown below:
If you take a look at the first few lines of the metadata you can see 3 main variables: name, image, and attributes. Name is self-explanatory, image will always have a URI to where the image is stored online, while attributes is a list of name and value pairs.
Although this metadata standard doesn’t seem like much, its complex enough to have created pretty much all the different types of NFTs we mostly interact with today. For example, since every single individual NFT in an ERC721 points to its own metadata it’s possible to create the common PFP collection where we often have something like 10,000 NFTs all with their own individual names, images and attributes.
ERC1155
ERC1155 took the best of ERC721 (the non-fungible token standard) and ERC20 (the fungible token standard) and introduced the idea of being “semi-fungible”. In the ERC1155 specification a smart contract will implement these functions below:
The new functions here are centred around the idea that you can now move multiple NFTs at the same time, hence the “batch” prefix for some of the functions. But its real key difference from ERC721 is that, through its extensions, multiple NFTs are now able to share a single metadata so a set of NFTs can be seen as inter-changeable, hence “semi-fungible”.
Due to this semi-fungible property ERC1155s are often used for things like editions where an artist sells say 20 editions of the same piece of art. All 20 pieces are individual NFTs but they all point to the same metadata and are inter-changeable. Open editions, where the number of mint-able tokens is unbounded, are always done with ERC1155s as each new token has an individual owner but shares the same singular metadata.
Its also worth noting that both the ERC721 and ERC1155 standard implementations allow the smart-contract owner to change the metadata whenever they want. This means you could wake up one day and the piece of art or PFP you bought could have a new name and image assigned to it! However, in practice owners will never do this as it would destroy the trust and hence value of the NFT. The rare moment that owners do use this functionality is for PFP reveals, where they set an initial dummy metadata on tokens and then on the reveal date switch them to their unique metadata.
ERC Standards are building blocks
Creating Standards means that people can build on top of them and extend or optimise them. For example Azuki re-worked the standard ERC721 implementation to something they named the ERC721A, which is more efficient by doing “batch minting” and effectively stores less on chain. Less storage used means a lower cost to mint, but since it follows the standard it still implements the same core functions expected and is as interoperable as any other ERC721. This particular optimisation pushes the cost of storage later down the line to when NFTs are transferred.
One of the original and most popular ERC standards is the ERC20 that was mentioned earlier. All fungible tokens on the Ethereum network from USDC and USDT to meme coins like Shiba Inu are implemented as ERC20s. It’s one of the simpler standards and does not differentiate between individual tokens or have extensions to store any sort of metadata. All tokens minted from a contract are identical and directly inter-changeable. The ERC20 played a big part in the original ICO craze of 2017-18 as people would sell new fungible tokens promising the world to investors, very similar to the NFT bull market of 2021-22.
There are hundreds of other ERC standards, some less popular some more popular. For example the ERC-1337 standard is new one that’s been designed for replicating subscription-based payments in blockchain apps. While the proposal has potential, it hasn’t yet been finalised and remains a half-baked standard.
New standards are being created all the time. The more standards there are the more we can build on top of them with more new and innovative mechanisms, just as with more infrastructure in a city you can build more complex cities!
And… that’s a wrap for today.
Now, next time you come across a new ERC Standard you’ll understand exactly what the term means and if someone asks you’ll know how to explain it to them.
Keep building builders!