ERC-20, ERC-223, ERC-721 tokens — how do these standards differ?

Ragunath
6 min readNov 3, 2023

When reading the description of any ICO, you will most likely come across the abbreviation “ERC-20”.

ERC-20, ERC-223, ERC-721 tokens — how do these standards differ?

Moreover, ICO organizers often mention the “create ERC20 token standard” as an advantage of a cryptocurrency token. Sometimes you can see the character sequence “ERC-223”. Does this mean that an ERC-223 token is more than 10 times better than an ERC-20 token? And what does ERC mean? Let’s find out!

Cryptocurrency tokens

From the user’s point of view, tokens differ little from cryptocurrencies and are perceived as an additional currency with special properties. There are many different tokens, some of which are traded on exchanges and can be purchased and transferred between each other. Very similar to cryptocurrencies, but from the point of view of the Ethereum network, a cryptocurrency token is data from a program, more precisely, a smart contract .

For example, in order for Alice to transfer ether to Bob, Alice creates a message “I am Alice, I am transferring to Bob 1 ether that I received from Charlie ,” signs it with her private key and sends it to the network. Network participants check Alice’s signature, verify that the ether received from Charlie was not spent, and, using mining, record the transaction in the blockchain, confirming it.

In order for Alice to transfer Bob, for example, a Golem token, Alice creates the message “I am Alice, I am sending a message to the Golem smart contract. Golem, transfer one token from my account to Bob’s account ,” signs it with his private key and sends it to the network. This message is not a transaction, Alice is not transferring anything to anyone yet, she “wrote a letter” to the smart contract. And after checking Alice’s signature, the Golem smart contract wakes up.

Golem is a full-fledged program, although it runs on a virtual machine. It has its own database, which records how many tokens belong to and who owns it, and it has its own operating algorithm, which was written by Golema programmers. Her algorithm may well have a condition not to transfer tokens to Bob on Fridays or (which is more often used) not to transfer tokens from Alice’s account until 2020 (asset freeze). These tokens essentially do not exist on the Ethereum network. For a virtual machine running a smart contract, the number of tokens in Alice and Bob’s accounts are just the values ​​of variables in one of thousands of programs.

All operations in smart contracts are carried out using commands. In order for Alice to find out how many tokens she has, she needs to send a message to the smart contract and receive a response from it.

Feeling the opportunities that smart contracts provide, thousands of developers began to develop their programs for the Ethereum virtual machine, including new “token management programs.” But because of the flexibility of the language, everyone wrote “token management programs” in their own way. Some had the function for getting the balance “ballance (account_address)”, some had “money(account_address)”, others did not implement the ability to find out the balance at all. Smart contracts are full-fledged programs, and the code can be written in any way you like. The more tokens became available, the clearer it became that tokens needed a standard. ERC-20 became such a standard.

ERC-20

ERC stands for Ethereum Request for Comments , which is a discussed solution for Ethereum. 20 — because it was the 20th question for discussion in order. ERC-20 was initially an informal agreement between developers, but is now a standard.

For a “smart token management contract” to comply with the ERC-20 standard, it must:

  1. When calling the totalSupply() function , that is, sending such a message to the smart contract, report the total number of issued coins.
  2. On balanceOf(address _owner) report the number of tokens at the _owner address (you need to specify the address instead of _owner).
  3. When calling transfer(address _to, uint256 _value) , send from the caller’s address the amount _value to the address _to.
  4. When calling transferFrom(address _from, address _to, uint256 _value), send the number of _value tokens from address _from to address _to. The caller must have permission to transfer funds from the owner of the _from address, which is set by the following function.
  5. When calling approve(address _spender, uint256 _value), transfer the right to the user with the address _spender to transfer the number of _value tokens from the address of the function caller. Used to transfer the right to manage tokens.
  6. When calling allowance(address _owner, address _spender) , report how many coins _owner has allowed the user _spender to transfer from his account.
  7. Include in your smart contract the variables name (full name of the token), symbol (short name of the token) and decimals (how many decimal places are taken into account in the quantity).
  8. Trigger two events Transfer (for any movement of tokens) and Approval (for transferring the right to transfer someone else’s tokens).

These are all the rules of the standard. That is, if you know that a token is ERC20 token development compliant, you can communicate with the smart contract that manages it using these commands. There may be more commands, but all of the above must be present, and the token must respond to them as the standard dictates.

To use an analogy, imagine if there were no standard for car controls. Every time you got into a new car, you would look for the gas and brake pedals, and they could be on the steering wheel, or above your knees. Instead of a steering wheel there could be a joystick, and the turn signals could be turned on using buttons on the armrests. For each car you would have to learn to drive again. Fortunately, there are standards that ensure that drivers do not feel much discomfort when changing cars.

ERC-223

Even before ERC-20 became a standard, ERC-223 appeared. Again, the numbers here are just a sequential number. ERC-223 is intended to improve ERC-20 and become its successor. For some time, the standards developed in parallel and some of the improvements from the new standard were transferred to the “big brother”. Currently there are only two differences.

Firstly, in ERC-20 it is possible to send tokens to the smart contract address rather than the user . In this case, the sent tokens hang at the smart contract address, and nothing can be done with them. It would seem that it is their own fault — they do not look where they are sending, but at the moment millions of dollars worth of tokens are stuck. ERC-223 solves this problem.

Secondly, ERC-223 slightly reduces gas consumption for requests .

The ERC-223 standard is backward compatible with ERC-20 and is, so to speak, its extension. Sooner or later, all tokens will switch to ERC-223.

ERC-721

The ERC-721 standard token is different from those described above.

ERC-20 and ERC-223 are used to create “faceless” tokens, each of which is indistinguishable from the other, much like two new bills or two dollars in a bank account.

Each ERC-721 token is unique and can be used for collecting or declaring ownership. You need to communicate with the smart contract that manages ERC-721 tokens differently — not using numbers, but specifying the 256-bit identifier of each token. Tokens can only be moved one at a time and, logically, tokens cannot be divided into parts.

The standard is used in the popular game CryptoKitties , where each token corresponds to a cat with a unique appearance. Cats can be bought, bred and sold. It doesn’t sound very interesting, but some cats were sold for $100,000, and at the peak of the game’s popularity, the Ethereum network had difficulties conducting transactions — the network was overloaded.

Bottom line

It was thanks to the ERC20 token development service standard that we saw explosive growth in the ICO market in 2017. The presence of a standard allows you to build an ecosystem around this standard, in which creating a new token and adding it to exchanges costs almost nothing. Considering that several thousand tokens have already been produced, the question may arise as to whether this is a good thing. However, the emergence of a token that does not support ERC-20 or ERC-223 standards is now unlikely.

--

--

Ragunath

Safe and Secure Blockchain Technology Service Provider !!