Anyone who has the slightest knowledge of cryptocurrency, will have heard of tokens or ‘coins’ being created on the Ethereum Blockchain. Ethereum’s ERC-20 standard, made it easy for developers to create and craft new tokens.
It also made it easy for wallets and exchanges to standardize the listing and exchange of these tokens, or coins.
However, this is not the only token on the Ethereum Blockchain, there is another type that serves a totally different purpose, and it is not understood well either. Of course, we are referring to the ERC-721 type of token.
You may understand that ERC-20 tokens are fungible, meaning that they are interchangeable. On the other hand, ERC-721 tokens are non-fungible, meaning that each one is unique and is not interchangeable with any other.
If you are unfamiliar with tokens, then this is a great space to learn, tokens are either fungible or non-fungible. On the Ethereum Blockchain, you can get either one of these types, and we are here today to lift the fog on your knowledge of ERC-20 and ERC-721 tokens.
Let us help you understand what the differences are between these two, and also how they work in the market.
How are tokens defined?
Before we tell you exactly what the differences are between ERC-20 tokens and ERC-721 tokens, we should make it clear about what exactly tokens are on Ethereum, for those of whom this is all very new to.
A custom token of any type in Ethereum is just part of a token ‘contract’. Each token is its own mini database, recording who owns what. This ‘token’ is simply an entry in the token ‘contract’, and who owns this token is recorded in this contract. A token is technically never actually in your wallet.
Instead, your token is just an entry into the tokens contract database that will say something similar to, ‘0xYOURWALLET = 2000 tokens.’ In a weird way, it is a little bit like a pin code that you use at an ATM to see how much money is in your bank account.
Fungible Vs Non-Fungible assets
A fungible asset is an asset that is capable of being swapped for another one, much like currency is. A good way to understand this is using the concept of money, if you have a US dollar bill, then it can be swapped for any other US dollar bill. It does not matter which you have as they are all the same, with the same worth, purpose, and value.
Shares in companies are also much like this, if you were to buy, say, 200 shares in Apple, you wouldn’t care which shares you get, you simply want to receive those 200 shares in Apple. There are no pedantic factors about these, no specifics to choose from.
A non-fungible asset is different, this is an asset that cannot be swapped for another asset, in the sense that no two assets are the same, they do not have the same values.
Trying to swap non-fungible assets like you do fungible assets is a bit like trying to swap a pineapple for a puppy, it is nonsensical, as they do not have the same value, and they are definitely not the same.
A good example of a non-fungible asset in day to day life would be your house or your car. You wouldn’t want to turn from a hard day at work and have your neighbor greet you with, “Hi there, I have swapped your house for mine, and your car for mine too. Here are the keys, have a good day!”
Two houses do not have the same values, and nor do two cars, even if they are the same make and brand due to having had different histories and owners. Non-fungible assets are much like this.
The world of ‘crypto’: Fungible & Non-Fungible
In the world of Ethereum crypto, assets will be grouped into fungible assets and non-fungible assets. If an asset is fungible then they are represented by ERC-20 tokens.
These tokens will represent ownership in projects and the like, somewhat like vouchers redeemable for services, staking tokens, or governance tokens. Think of them a little bit like those gift cards you can get for Amazon, or those activation codes you can get for Xbox or PlayStation.
A non-fungible asset, on the other hand, is represented by an ERC-721 token. At the moment, as it stands, the only main use that ERC-721 have is for in-game assets. A great example of this use would be in the game ‘CryptoKitties’, which is a game in which you collect and breed virtual kitties.
Each kitty in this game is then represented by a unique ERC-721 token. In the future it is possible that we could be tokenization of real-world assets, such as your house. Your house could use ERC-721 tokens.
A coin… Within a coin?
We will get into the deeper understanding of ERC-20, and ERC-721 soon, we promise. But first, we want to highlight the importance of understanding that these tokens live in smart contracts, and these contracts themselves live within the Ethereum Blockchain. In this sense tokens can be looked at as almost a coin… within a coin.
The Ethereum Blockchain itself has no salient distinction of ERC-20, or ERC-721 as token. To the Ethereum Blockchain, tokens are simply variables that are defined in smart contracts. It is just like humans writing the contracts who decide to assign any particular meaning to some variables here or there in smart contracts.
So, we have told you about the ERC-20 standards, and the ERC-721 from a higher-level perspective.
But now we want to explain to you how these standards work, and give you a bit of a better insight into how they work, what they are, and truly how they differ from one another on a deeper scale of knowledge.
ERC-20 and ERC-721 are both tokens used in the crypto world, but the biggest difference between them is them being fungible, and non-fungible.
Understanding ERC-20 Tokens
First of all, we would like to start off with a little history lesson. The ERC-20 standard was created back in 2015 by someone named Febian Vogelstellar. Now, let's consider the most imperative parts to know about ERC-20 tokens.
It is important that you understand that the ERC-20 standard, much like other token standards, only defines the interface (API) of a smart contract but not how it is implemented.
So, when you go to McDonald's, KFC, or wherever, and you order your food you only inform the cashier what kind of food you want. You do not tell them all of the little details about how they should cook the food.
In the kitchen the cooks will deal with the cooking process, and you trust them to do so. Ordering this food is the interface of a fast food restaurant, and the cooking of the food is how it is implemented.
So if a fast food restaurant used ERC-20 tokens, then the ERC-20 token would only define you ordering the food, not how it was cooked.
In a smart contract, the code is organized into logical groups, these logical groups are called functions.
The interface of this smart contract is simply a description of what the functions should do, and the implementation is the actual code of the functions (Think back to our example about fast food restaurants.)
An ERC-20 token is just a smart contract, with code that respects the ERC-20 standard. In simpler terms, this means that the functions of the smart contract respect the interface defined in the ERC-20 standard.
Thinking back to the fast food analogy, these functions would be much like the cooks at the restaurant. So the interface (your order) is a description of what the functions (cooks) should do, and the implementation (cooking of your order) is the actual code (instructions) of the functions (cooks).
If we want to deeper understand this standard, then we need to look deeper at the function interfaces that are defined inside.
There is a group of functions that define the metadata of these smart contracts, these include; name, symbol, decimals. Anyone can call upon these functions and the smart contract will answer with the relevant information.
However, the core of the ERC-20 standard is the account system, each token manages a ledger of Ethereum addresses and token balances, much like a bank manager manages a ledger too.
While a bank manager managed this ledger in a traditional database, these tokens use variables in smart contracts. Variables in programming are basically slots that you used to store and reference data, a bit like a filing cabinet.
There are so many different things to understand about ERC-20, however the primary understanding is that they are fungible assets that work in a unique way that you can relate to both banking/ information storage and order and receiving systems in their core functionality.
Understanding ERC-721 Tokens
ERC-721 is more recent, coming into being two years after ERC-20. It was introduced in late 2017 by the popular online game ‘CryptoKitties’. This is the game we mentioned before.
In this game, players collect and breed virtual kitties, and each of these kitties are represented as an ERC-271 token.
This may seem familiar to ERC-20 tokens, so what is actually the difference between an ERC-20 token and an ERC-721 token then? Well, an ERC-721 token represents a class of assets, so in the case of ‘CryptoKitties’ the ERC-721 token contract represents every unique kitties in the game, as well as who owns which Kitties.
In comparison to the ERC-20 token, the ERC-721 tokens are simplified. A player fully owns an asset, or they do not. It is not possible to only own half of a kitty, in CryptoKitties, this applies to many other instances as well, when it comes to non-fungible assets.
An example of this would be in the rise of NFT’s and the selling of the first ever tweet. You cannot own half of this tweet, so the ERC-721 token represents this whole tweet. This is why the ERC-721 token is pretty much standard for non-fungible assets.
The most imperative thing you must know about the ERC-721 standard is that it is used primarily for non-fungible assets and that it represents a single type of asset as we have just discussed.
You can never have partial ownership of something non-fungible, and so the use of ERC-721 tokens is implemented. Aside from this, the rest of the ERC-721 standard is very similar to the ERC-20 standard. Especially in terms of token transfers.
While these two types of tokens seem very similar, they have plenty of differences, especially in their use. ERC0721 is a more ‘advanced’ kind of token that is non-fungible. AN ERC-20 token is more like money, and is used for things that are in relation to money.
ERC-20 tokens should also be thought of much like money, as they are interchangeable, in that they are all the same, i.e. Bitcoin. ERC-721 is the token type you are more likely to use for collectibles, or unique items, i.e. CryptoKitties, a tweet, some artwork. It is more like the Ethereum version of baseball cards.
To conclude the overall differences of these two token types used in the crypto world, we have to also say that both ERC-20 and ERC-721 are both works in progress. Both of these have their own sets of challenges, and improvements on these two token types are always up for discussion.
ERC-20 is a token type that is used for money, and money-like tokens. ERC-721 on the other hand, is for things, and thing-like tokens. There are whole ecosystems in the crypto world that revolve around these two token types.
Many trades and factors of the cryptocurrency world revolve around ERC-20, and the newest NFT world has a lot of involvement with ERC-721.
Either way, if you want to enter the crypto world and delve into its mysteries, it is a good idea to know your tokens, whether they are ERC-20, or ERC-721, or otherwise.