ERC token standards, much more than just ERC20
If you’ve paid any attention to the ICO market, you’ve surely heard of ERC token standards, and probably seen ERC20 thrown around quite a bit. Basically, these standards are agreed-upon norms for the architecture in Ethereum based systems, designating the types of assets and transactions that are to be part of the network.
The acronym stands for ‘Ethereum Request for Comment’ and the number is simply the designation or unique identifier to distinguish the standard from others. ERC20 was proposed in 2015, but not officially formalized until late 2017. The length of time it takes for an RFC to be finalized depends on many factors, and there are plenty that are still unresolved.
It describes the protocols surrounding the issuance of tokens on an Ethereum-based blockchain, and the standardized format means that many different systems are able to coordinate due to the shared architecture. Many ICOs use the standard, and it ensures that the smart contract functionality based in Ethereum is preserved.
The standard involves tokens that are fungible, which means they are always worth the same as each other at any given time. Other ERC standards cover non-fungible tokens, but we’ll get to that later on in the article.
Creating a platform on the ERC20 platform is simple, because the architecture and rules for the system are already designed and agreed upon. This can reduce development time, and is why many ICOs choose the standard. By issuing ERC20 tokens, trust is developed immediately that the platform complies to the standards.
But what are some other standards to be aware of, both finalized and not finalized?
In case you want to design a system around an asset that is not fungible, this is the standard you would want to use. Now, you may be thinking in terms of cryptocurrency only, and wondering why you would ever want non-fungible assets that can vary in value against each other.
Let’s look at the example of the extremely successful dApp game ‘CrytoKitties.’ As it was built using the ERC721 standard, players were able to access a shared set of rules to build unique digital kitties. The game quickly went viral after it’s release in Nov 2017, and millions of US dollars were spent by people in the game. The key to building a really unique ‘kitty’ in the system was that each token or asset needed to be unique, and have a unique value.
The ERC721 standard allowed the developers to build the game based on the Ethereum blockchain using this protocol, with the game’s rules built right into the smart contract. All smart contracts can interact with ERC20 tokens, but a new protocol was needed to adapt smart contracts to other tokens. That is where ERC165 comes in.
For smart contracts to be effective, they have to be able to interact with crypto tokens. While this is baked into the ERC20 formula, other token types (like the above ERC721) require a method to interact with smart contracts. So while 20 and 721 describe token types, the 165 standard applies more to a method than to describing a token.
This shows a key to the ERC ecosystem, that is an ERC can be for anything from a token to rules to protocols — many people assume it just references a type of token.
ERC165 is an important standard for those looking to develop blockchain based systems that are not specifically cryptocurrency.
One protocol that’s only been proposed but not yet implemented is ERC223. If you send ERC20 tokens to a smart contract that cannot handle tokens, those tokens are lost for good. ERC223 aims to protect tokens by allowing developers a method to accept or decline incoming tokens before they are lost.
There are other solutions being proposed by Ethereum that might make this a moot point, so this is one proposal that may never make it past the proposal stage. Notably, the proposed ‘Ethereum Name Server’ will make ensure that these types of losses do not occur.
If a developer wants to alter the number of available tokens, they would code this based on the ERC621 standard. While also currently still in draft form, it would allow developers to either increase or decrease the total amount of available tokens.
Some feel this proposal goes against one of the basic principles of cryptocurrency that differentiate it from fiat currency. Governments can affect the scarcity of money and effectively change it’s value, while cryptocurrency was created in part to eliminate that variable. It remains to be seen whether or not this standard will be implemented.
Also an extension of ERC 20, this proposal aims to tackle the same problem that ERC223 is trying to solve. If implemented, a token holder can transfer a token and simultaneously approve a 3rd party to spend it.
Importantly, wallets and exchanges can reuse tokens, since both parties agree on how a third party can spend a dynamic amount of the tokens. While not yet approved, this standard would improve the functionality of both exchanges and payment processors.
This proposal is meant to make things easier on a user that’s new to crypto by allowing them to pay mining fees in the token, instead of in Ether. Many who buy tokens and then try to transfer them are surprised that they have to also carry Ether for the transaction fees.
If approved, this would allow those mining fees to be paid in the specific token.
An open source model for development
As you can see, this format of Request for Comment allows the community at large to weigh in on the problem and propose various solutions. One of the keys to Ethereum founder Vitalik Buterin’s vision for the system was allowing this sort of shared development to happen.
Leveraging the expertise of the entire pool of programmers and developers allow these standards to all exist within the same architecture, and you can choose the one that works best for your proposed solution.
You can see all the proposed problems and discussions here.