Ethereum ERC-20, ERC-223, ERC-721, and ERC-777
It’s not easy for most people to figure out how Bitcoin works, and Ethereum is even more difficult. Even if you are with technology at “you”, it will take a long time to understand how this system works.
So, Ethereum is a decentralized platform on which smart contracts written in the programming language Solidity can work. It can also run hundreds of decentralized applications. For any new application that uses blockchain or smart contracts, a new Ethereum token can be created – as part of this project, several standards were developed for such tokens, and tokens of various standards are suitable for various types of applications.
The presence of standards facilitates the interaction between tokens and smart contracts, and therefore Ethereum is a popular platform for developing decentralized applications. You can liken Ethereum to iOS or Android operating systems for decentralized applications – it simplifies their creation and supports work.
The most common standard for Ethereum tokens is currently ERC-20, but there are also ERC-223, ERC-721 and ERC-777 standards. In this article we will talk about each of them.
Token Ethereum ERC-20
This is the current industry standard that is used by thousands of different cryptocurrency projects. The ERC-20 token standard has six mandatory parameters for each smart contract and three additional (but recommended!).
For example, the permissible number of decimal places applies to additional ones. In comparison, bitcoin supports eight decimal places, a character (usually a 3-4-digit code), and a name. Six required parameters determine the number and transfer of tokens.
The first two are used to specify the initial distribution:
- The totalSupply function determines the total number of tokens. After reaching the maximum, the smart contract ceases to issue them.
- The balance0f function assigns the initial number of tokens to any address (usually this is the address of the ICO owners).
Two methods of transfer are required for distribution between users and transfer from one user to another. They are extremely important for the secondary market:
- The transfer function transfers tokens from the primary address to individual users who bought them during the ICO.
- The transferFrom function is used to transfer tokens from one user to another.
Two more functions are needed to verify the two previous ones:
- The approve function checks if tokens remain in the smart contract.
- The allowance function ensures that at a certain address there are enough tokens to send them to another address.
These six simple steps allowed wallet developers and exchanges to create a single code base capable of interacting with any ERC-20 standard contract.
Token Ethereum ERC-223
Although the ERC-20 standard is very useful, it is far from ideal. For example, due to design flaws, people can send tokens to a smart contract, believing that they send them to a regular wallet – thus, tokens worth more than $ 3 million have already been irreversibly lost.
In ERC-223, this error is fixed – here you can transfer tokens to smart contracts and wallets with one function. In addition, with ERC-223 tokens, unlike ERC-20, a transfer requires one operation, not two, which means that there is half as much gas to pay for it. And in addition, ERC-223 tokens are backward compatible with the ERC-20 standard, that is, all original functions are also supported.
Thus, it can be expected that the ERC-223 standard will sooner or later supplant the ERC-20 as the most common token standard in Ethereum. However, most Ethereum wallets do not yet support ERC-223 tokens, so the project developers were in no hurry to implement it.
However, given how quickly the cryptocurrency ecosystem is evolving, don’t be surprised if the ERC-223 tokens become popular as early as 2020 – or even earlier.
Token Ethereum ERC-721
ERC-721 tokens first gained fame at the end of 2017, when the collectible game CryptoKitties, based on the Ethereum platform, thundered around the world. The key difference between the ERC-721 standard and other ERC standards is that the ERC-721 allows you to create non-convertible tokens (NFT), that is, within the same platform or ecosystem there can be tokens with different costs.
Such tokens are extremely useful because they allow tokenizing, among other things, unique assets, and these are not only digital images of cats, but also artwork, fine wines, real estate, diplomas and much more.
In the coming years, tokenization will affect a wider range of real assets, and it can be argued that the popularity of the ERC-721 standard will far overshadow the popularity of the CryptoKitties game – in the Ethereum blockchain it will be possible to reflect ownership of a work of art or a ticket to some show.
At the same time, the authenticity and integrity of the product will be monitored throughout the entire life cycle – with unprecedented accuracy.
Ethereum Token ERC-777 and ERC-820
Like the ERC-223, the ERC-777 is designed to improve the ERC-20 standard and is backward compatible with it. In ERC-777, as in ERC-223, it is now more difficult to lose tokens by mistake, but it also has unique features – it supports a lot of transaction processing mechanisms.
To deal with the ERC-777, you first have to take a look at the ERC-820 standard. According to this standard, the Ethereum network has a central registry of smart contracts, allowing anyone to check the address of a smart contract and find out what features it supports.
ERC-777 uses the same central registry from the ERC-820 standard, which is designed to provide verification of supported functions, and in addition, instead of the transfer (‘transfer’) and approve (‘approve’) functions, it is specified completely A new set of functions, in particular, the send function, which is used to transmit live broadcasts directly. In addition, the concept of an “approved operator” appears in ERC-777, that is, people can trust smart contracts to transfer tokens on their behalf.
This makes ERC-777 very flexible: you can make a contract mixer that will mix transactions for greater confidentiality, or an emergency recovery function in case of loss of private keys. In addition, ERC-777 provides for “coinage” and the destruction of tokens, which in some cases may be necessary.
However, no well-known projects based on the ERC-777 standard exist, so it is difficult to say whether it will be widely used. At the same time, given its flexibility and ease of transaction processing, almost any application based on ERC-20 could be useful for transferring to ERC-777.
The Ethereum platform is constantly evolving, and application development standards are developing with it, and if ERC-20 tokens dominate in this market today, in the future, more and more projects will probably be built on improved ERC-223 or ERC-777 standards.
The Ethereum network has already created more than 100 thousand smart contracts describing new tokens, and it does not seem to slow down this process. Of course, most tokens will soon be needed by no one, but the remaining units may well turn the world around.