Reports have revealed that the Ethereum ERC777 token standard is ready to replace the ERC20 standard. What is this ERC777 and how does it compare to ERC20?
Currently, the ERC20 token standard is undisputedly the most common and most famous Ethereum technology standard. But, experts believe that the new ERC777 should offer solutions to the biggest shortcomings of the ERC20. What makes up the ERC777?
Where did the ERC20 standard come from?
ERC stands for Ethereum Request for Comments. It is a major topic within the Ethereum Improvement Proposals (EIP) repository which is a collection point for improvement proposals. The collection point is situated on the Ethereum Foundation’s Github account.
The web-based online service, Github, lets developers from around the world to work together on software projects. ERC20 is the result of the 20th improvement suggestion in the “EIP” repository. The improvement was suggested by Vitalik Buterin and Fabian Vogelsteller on November 19, 2015.
ERC20 has the ability to quickly and easily create its local tokens based mainly on the Ethereum blockchain. Due to that reason, the ERC20 became the most popular token standard in the following years. It contributed considerably on the Ethereum and ICO boom.
With at least 500 different Ethereum tokens using the standard, the cumulative value is approximately $25 billion as of last year.
How does ERC20 work?
Fundamentally, ERC20 is a standard or template for a Smart Contract on the Ethereum Blockchain. It stores addresses and the corresponding account balances. Therefore, the ERC20 token standard is a definition of a list of basic functions and tokens that any token programmed using this standard must implement.
Additionally, the token developers can use this standardized program functions to make their tokens usable and transferable. The smart contract of the token standard defines various details that let users know everything about the token at hand. The details include:
- The token abbreviation that mostly features 3 to 4 letters.
- The token name where the token contract is stored.
- A list of token holders with their corresponding token balances.
- The number of decimal places where the token is stored.
- The standard also specifies that the contract manufacturer can issue his standardized tokens.
The total amount of the available tokens is derived from the cumulative amount of the account balances. The ability and possibility to decrease or increase this amount of token is given by the token standard. Either by the Smart Contract taking tokens from the balance sheets and ‘burning’ them or by the Smart Contract minting new tokens. Nonetheless, it all depends on the rules and code defined in the smart contract.
Disadvantages of the ERC20 standard
ERC20 tokens can be transferred between the different Ethereum addresses. But, there is a major difference compared to the ether transactions on the Ethereum blockchain since:
An ether transfer features a transaction field for the transaction amount and the information field. On the other hand, in the token transaction, the number of tokens to be sent is documented in the second field. Thus, transfers between the addresses of the two parties are possible. Nonetheless, using the token as a trigger for a function of another Smart Contract never works.
When a user sends a transaction to a Smart Contract and it is not recognized by the Smart Contract, all the ethers featuring in this transaction are irrevocably lost.
Solution proposed by ERC20
The ERC20 attempts to solve the challenge of sending information together with the token transfer by splitting the process into two steps:
The first step in this process is the approval ( ) function. With that, the user offers the ERC20 contract authority for a particular number of tokens to be debited from their address.
When the user grants that permission, they can request another contract to execute the preferred function. Then, the Smart Contract with the transferFrom ( ) function requests the ERC20 token contract to send a specified payment from the originating user’s address to its own address. Hence, two transactions of the user are necessary. That is a clear shortcoming of the ERC20 token standard.
ERC777: The Advanced Token Standard
Although the ERC223 and ERC677 have tried to resolve this inefficiency, none of these proposals were successful. The new advanced token standard #777 known as the ERC777 proposal was made by Thomas Shababi, Jacques Dafflon, and Jordi Baylina.
This new standard is designed to provide a new possibility to interact with a token contract. Concurrently, the backward compatibility with ERC20 Smart Contract will be preserved.
The main innovation of this token proposal is the definition of a send () function. This token transaction now comprises of an amount field and a data bit field together with a similar operator Data Field. Hence, the parameters can be easily chosen again by the token user and the token operator to forward data to the recipient.
In this case, the token may be used as the original ether. ERC777 has Smart Contract Operators EIn. It also introduces ‘operators’ instead of the allowance mechanisms.
The trustworthy Smart Contracts that can move amounts in the name of the user is what is known as ‘Operators.’ They can be canceled or authorized by the ERC777 users. Therefore, these token contracts can be improved later. This property makes it possible to provide the token system with additional properties later on. Users can check processors, recovery services, or membership payment manager.
Hook prevents lock-up
When using a tokenReceived Hook, users can control contracts and addresses for the receipt tokens or reject them where necessary. The token recipient can also execute a code automatically whenever a token arrives. If anyone sends tokens to a Smart Contract address accidentally, the tokens are not lost but can be returned by that Smart Contract automatically.
The ability to automatically reimburse any tokens sent to the wrong address solves the inefficiency of the ERC20 that needs approve and transferFrom transactions to send tokens to a contract.
Although ERC777 replaces the functions transferFrom () and transfer () with the functions operatorSend and send, all ERC20 functions can still be used. These functions include approve, transfer, allowance, and transferFrom. The new proposal also enables users to implement decimal places.
A token contract can implement ERC777 and ERC20 simultaneously although it is no longer mandatory. The read-only functions of both of these token standards also overlap seamlessly.
ERC 777 Disadvantages
After extensive analysis, it is clear that the gas costs are a small shortcoming. Jordi Baylina commented on the DAppCon 2018 that they will be slightly higher than with the ERC20. Nonetheless, this surcharge is marginal putting into consideration all the additional possibilities and functions.
That statement should be analyzed keenly since an increase in gas costs results in an increase in the transaction costs of simple token transfers. These, for now, account for most of all smart contract operations. The ERC777 was finalized in August 2018. After that, creation of new token smart contracts according to the new standard began.
But, it remains to be seen whether the ERC777 can replace the ERC20 as the most widely used token standard to introduce a new era in the Ethereum universe.