Navigating the ERC-20 Token Standard

Are cryptocurrencies and tokens the same thing?

Cryptocurrencies. Crypto tokens. Common to the space, both terms are very often used interchangeably. Yet, there is a small difference between them. To understand how they differ, a division of definitions is a good start. Cryptocurrencies are ‘canonical’ to a blockchain: they are the currency needed to perform transactions on their respective chains. Key examples include Ether (ETH), Bitcoin (BTC), and Dogecoin (DOGE). In contrast, crypto tokens are built on top of a decentralized blockchain—such as Ethereum—based on a common standard. Such assets rely on the underlying blockchain network for deployment.

Cryptocurrencies are ‘canonical’ to a blockchain. | Nenad Novaković

What is the ERC-20 token standard?

Ethereum Improvement Proposals (EIPs) describe standards for the Ethereum platform to include core protocol specifications, client APIs, and contract standards. A subcategory of EIPs for contract standards is called Ethereum Request for Comments (ERC). ERC-20 is the one used as a token standard. Over time, it has been commonly used to refer to fungible tokens. But what is a fungible token? It is one that is replaceable by another identical item; mutually interchangeable.

What does ERC-20 mean for token transfers?

As previously outlined, Ether is the native cryptocurrency of Ethereum. The same blockchain, however, also supports crypto tokens. Taking the form of other currencies or assets, these tokens could present as company shares, gold certificates, loyalty points, and such. Meanwhile, a smart contract bears the tasks of (a) token creation, (b) managing transactions around the token created, and (c) keeping track of the balance of each token holder. ERC-20 features six mandatory functions and three optional ones.

VIDEO: What is an ERC-20 smart contract responsible for? | Simply Explained

Which are the optional and core functions of ERC-20?

Let’s go over the non-compulsory functions involved with ERC-20 token creation. During deployment, one can choose to include or exclude the assignment of certain elements to a token. These elements are name (of the token), symbol (for the token), and the number of decimals (the token supports to control divisibility).

Diagram: The six fundamental rules of ERC-20 | Image: Nirolution

There are six compulsory ERC-20 functions: totalSupply specifies the limit on the number of tokens the smart contract allows and balanceOf indicates the number of tokens an address holds. The transfer function requires that the sender have enough balance to send; transferFrom allows a transfer from an account that isn’t making the transaction. The approve function allows a contract to spend a specified amount of tokens from an account; allowance returns the amount an approved contract is still allowed to spend or withdraw.

Who created the ERC-20 standard and when?

The authors of the EIP on the ERC-20 token standard are Fabian Vogelsteller and Vitalik Buterin (2015).

TL;DR (key takeaways):

  1. ERC-20 tokens follow a set of standards unique to Ethereum smart contracts
  2. It defines the common rules for developers to observe when creating the tokens
  3. Compliance with this six-function token standard prevents unnecessary confusion
  4. The six rules help users avoid issues that can arise from individual token differences
  5. It lets tokens interact with wallets, exchanges, and different smart contracts smoothly
  6. Non-compulsory ERC-20 functions: name, symbol, and the number of decimals (divisibility)
  7. Mandatory ERC-20 rules: totalSupply, balanceOf, transfer, transferFrom, approve, and allowance

Here is a list of ERC-20 tokens that are available on Etherscan.

  • Deborah Joy Peter