In previous posts we have been talking about what the tokens are and what tokens are the most popular. We have also introduced the concept of the ERC-20 token from Ethereum. In this post we will dive into this concept and we will explain everything about ERC-20, ERC-721 and ERC-1151 and their applications.
What is a token?
First of all, we must remember what a token is. When we are talking about tokens within a blockchain ecosystem, we mean the digital representation of other assets. The tokens can be originally digital (for instance the cryptocurrencies), or digital representations of physical assets. For this second group we may find several of the NFT (Non Fungible Tokens) examples.
In this sense, the standards ERC-20, ERC-721 and ERC-1155 which Ethereum developed serve precisely to create these tokens. In fact, the acronym ERC comes from “Ethereum Request for Comments”. Basically they are standard protocols to create these token in a standard way which enables to integrate them into the network.
Thanks to their conception in the Ethereum blockchain, the tokens from these standards do not have any interoperability problem. They work as a template for new tokens. By starting with these templates you add any additional features you may need for the tokens. Furthermore, with these standards the risk of coding errors is lower, as these protocols are universal and have been properly tested.
What is the added value of ERC in the creation of tokens?
There are several reasons why is so positive the development of these standards within Ethereum. Among them we can find the following:
- Security – the best way of testing the reliability of these standards is a massive use of them by the community. Furthermore, it ensures the conditions for the proper functioning of a defined kind of token. Without the use of these standards, the likelihood of a programming mistake is higher.
- Auditability – the code is public and available for the whole community. This means that is auditable and, therefore, we can check its security and the properties of the tokens.
- Publicity – the high number of tokens created within the Ethereum network is the best advertising for the community. In fact, it is a good measure of its scalability, as well as the independence of the projects and their interoperability.
- Better programming – last but not least, there is no doubt about the uniformity and simplicity in the creation of tokens that these standards will bring for the developers.
This is the most popular of the standards, and most of the tokens have been created thanks to it. Its main property is the fungibility, as all the tokens from a given smart contract are interchangeable. Therefore, the ERC-20 would not serve to create NFT as they are, by definition, not fungible. Furthermore, the ERC-20 enables to divide the tokens, as the contract allows decimal positions to transfer fractions of tokens.
This is why is this standard is such a useful contract to develop digital coins, as one of the advantages of its tokens is the compatibility and interoperability among them. Therefore, all of them maintain their own accounting under the system of Ethereum.
The ERC-20 is, as we have said, a smart contract with a predefined format. In this format there are 9 different rules, which 6 of them are mandatory for developers, and the remaining 3 are optional. The information stored in these rules contain all the data for the tokens, such as the number of decimal positions, the name, etc.
Pros and cons of tokens ERC-20
The ERC-20 is not perfect. For obvious reasons, it is better than creating a token from scratch, but it has some limitations. Moreover, the fact that this standard creates fungible tokens makes it unfit for other type of tokens.
Among the advantages of the ERC-20 tokens are the savings in time and resources. The ERC-20 tokens are developed within the Ethereum infrastructure, so they do not need a new network to be deployed. Furthermore, this type of tokens is widely accepted within the developers community, and allows great flexibility in its implementation. Another advantage is the interoperability with other tokens and other decentralized applications within Ethereum. This means that this standard can presume of a great level of liquidity, as it is used by most of the tokens within the Ethereum network.
From the disadvantages side, there are several limitations in the Ethereum network which become disadvantages for the ERC-20 tokens. On one side, the instability due to changes in the consensus protocol of the network, which may cause the loss of tokens. On the other side, a high transaction fee and the slowness on the network in case of overload.
Additionally, the easiness of implementing new tokens with this standard has caused that a lot of useless tokens have been created with no added value for the network. It also occurs that, with the ERC-20 tokens, you cannot undo an erroneous transaction. If you send the tokens to an incorrect account, the tokens become lost and they cannot be recovered by the user.
If the previous standard based its usefulness in the fungibility of the tokens, the standard ERC-721 tries just the opposite. This smart contract has been designed to create Not Fungible Tokens (also known as NFT), so they can be used as digital collectables. Each of these tokens is unique and indivisible, and there is where its value remains. As there is only one piece of each token, they can presume of having intrinsic value.
Nowadays, the main use case of this standard is to create digital collectables for blockchain based games, such as Cryptokitties, Decentraland, etc. However, the unique character of these tokens allows them to be used in applications related with the digital property of certain objects. In these cases, the representation of art pieces, real state, etc., could make real sense for these NFT.
Pros and cons of tokens ERC-721
The main advantage of this standard is the capacity of creating a unique token, with no replicable properties. This saves a great amount of time and programming resources when creating NFTs.
On the negative side, this standard shows some limitations which are precisely related with the uniqueness of the tokens. If you want to transfer several tokens and they are ERC-721 tokens, you need to go one by one, which becomes expensive. It is not just about the uniqueness of the token, but also about the number of pieces of the token itself, which must be one. If we are talking about a videogame, the token should only exist for that videogame. However, we may want to create several copies of that videogame, so we can transfer the token among the different users.
Under this scenario, the use of ERC-721 tokens is expensive in time and resources. Moreover, this standard is not compatible with ERC-20. Given the fact than they are the most used standards in Ethereum, their incompatibility can be detrimental for the network.
The last standard we will see in this post is one of the most recently created, and it allows to group under the same blockchain account both ERC-20 and ERC-721 tokens. The idea was to develop one smart contract from which you can control and transfer fungible and not fungible tokens. Therefore, the functionalities of both standards are combined, reducing their limitations.
This allows that the network has a more efficient, secure and stable functioning. Moreover, the fact that this smart contract enables the interoperability between ERC-20 and ERC-721 tokens makes it much more interesting for the community. The properties which make the ERC-1155 in a differential program can be resumed in the following:
- Massive transfer of tokens regardless their type. This enables to save time, resources for the network and transaction fees for the users.
- Creation of multiple ERC-20 and ERC-721 tokens simultaneously, in the same contract.
- Secure transfer of the token, with the automatic check for the transactions. Moreover, it enables the refund of the tokens by the issuer in case of error. This mechanism must be careful about the double spending risks. Regarding its usefulness, it seems to attempt against the principle of immutability of the blockchains.
- Detection of the token type. Depending on the tokens of the contract, some functionalities are activated instead of others. This improves the compatibility among the different standards.
Pros and cons of tokens ERC-1155
Apart from the previous advantages, it is also important to mention the time savings in the creation of these tokens. The ERC-1155 standard enables to create a token in just 2 steps (instead of the 4 steps of the other standards), and minimizes the efforts in the process.
However, on the opposite side, we have to mention the loss of traceability in the transactions. This can become an important factor, as this is one of the basic elements for the blockchain networks. Moreover, due to the lack of popularity in comparison with the other standards, this could reduce the reliability of ERC-1155 in the community of developers.
Other available standards
We have seen until now the three most popular standards for token creation. However, we just saw that none of them is perfect. Depending on the use case, one of them may be more useful than the other. Below we can find three more standards not so popular but with additional functionalities which may be also helpful:
- ERC-223: it protects the user against accidental transfers.
- ERC-827: it allows a third party to spend our tokens.
- ERC-777: it allows the user to reject tokens from an unwanted wallet.
The previous standards enable to use the advantages of a code already tested, so it gives security and flexibility to our tokens.
As we have seen, the predefined smart contracts do not just make easier the creation of new tokens, but they also enable the interoperability, increase the security of the code and support the network with new functionalities. That is the reason why this kind of programs is being increasingly used. Furthermore, the developers are creating new standards to improve the use of this technology within the Ethereum network.
However, these standards are closely related with their use cases. They provide great level of flexibility, but not all of them serve for any purpose. Therefore, depending on the application or the service we want to develop, we will need one of them instead of the others.