What are ERC20 Tokens?

What are ERC20 Tokens

To somebody who encounters cryptocurrencies for the first time, it might be difficult to grasp some concepts. Blockchains, Bitcoins, smart contracts, DAPPs, these terms sound strange the first time you hear them and explanations sometimes are so complicated that you start to mix things up.

If we take, for example, Ethereum, most of you are probably wondering why it has both a coin and tokens. And what about these ERC20 tokens, you’ve heard people talk about? How do they come into the picture? I’m sure that your head is full of questions.

So, today we’re going to talk about what ERC20 are. But first, let’s answer some other important questions, shall we?

#1. What’s Ethereum?

Ethereum is a decentralized platform/network based on the blockchain technology – a mass of computers connected to each other. In simple words, it has its own blockchain, which allows you to send and receive payments. Every transaction is recorded and stored on a decentralized ledger, which is available to every node following the main principles of the blockchain.

But Ethereum is not merely a blockchain. It’s a platform, which allows developers to create and run smart contracts and decentralized apps, which is where tokens come into play.

#2. Ether vs. tokens

Ethereum has a native coin – Ether, which is what you need to fuel operations, the asset necessary to use the platform. For example, a smart contract is a series of instructions written in a computer language known as “Solidity” and based on the principle – If this action happens, then that action will happen.

To create this contract and run it the price is calculated in “gas,” and you pay for this “gas” with Ether. Think about the “gas” as the fuel you require to drive your car around, and Ether as the money you give to the person filling up your tank. The more complicated commands, the more “gas” the contract requires.

Besides Ether, Ethereum can support other tokens, which are built on top of the platform and are depended on it. Tokens can represent anything valuable and tradable, so they don’t function in the same way like other digital currencies.

For example, tokens can represent:

  • ​Loyalty points
  • ​Shares of companies
  • ​Access to features
  • Certificates
  • Certificates

We can broadly divide tokens into two categories:

  1. Usage tokens
  2. Work tokens

Decentralized apps have their native tokens, which you need to use the app. That would be usage tokens. Work tokens are those who give you certain privileges like voting on future of the DAAP. Both tokens could be purchased with Ether if you want to be part of the project, or you can receive them as a reward or payment for doing specific tasks.

#3. What are ERC20 tokens?

In a sense, a token is just another smart contract running on top of the Ethereum blockchain. As such, there are two potential issues:

  1. Code errors
  2. Interoperability

Once you’ve made the contract and employed, there is no going back. Imagine that there is a slight error somewhere in the code. What could happen? You can send all the tokens you’ve create to an invalid address, or someone can steal them due to a vulnerability you’ve overlooked.

The other problem is interoperability. Smart contracts are totally different from one another, so it stands to logic that they would have unique tokens. Do you start to see what the problem is?

Let’s say that you want your token to be available on an exchange platform. The exchange would have to write custom code to make their system compliant with your token and allow people to trade it. Wallets would have to do the same so that you can store the token.

It’s a nightmare exchanges and wallets would have to do it over and over again every time a new one appears, so that they could accommodate it. And, as you can imagine, wallet providers, exchanges, and the smart contracts would have to invest a lot of time, resources, and efforts to make different tokens interact with one another.

Fortunately, there is a simple solution to this problem, called ERC 20. ERC20 stands for Ethereum Request for Comment and 20 is the number assigned to the proposal. Its aim is clear – to make a standard protocol for token creation, a set of functions every develops should include to ensure that their token is ERC20 compatible. There are six mandatory ones and three optional.

The six mandatory functions are:

  • ​totalSupply - a method to define the total supply of the token after which the contract won’t create new ones
  • ​balanceOf – shows how many tokens a given address has
  • ​transfer – takes tokens from the total supply and sends them to users
  • transferFrom – transfer tokens between any users who own them
  • approve – checks that it’s possible to send tokens to a user, based on the total supply
  • allowance – validates that the user has enough token balance to send tokens to other users

The optional ones are:

  1. Name of the token
  2. Symbol
  3. Decimal – specifying how dividable your token is

#4. Is it necessary to use ERC20 protocol?

Of course, it’s not obligatory to follow the set of rules defined by ERC20, but it’s strongly advised and recommended. It just makes things easier for everyone in the chain because your token will interact with exchanges, wallets, and contracts with no issues and no need for writing a new code.

You also won’t have to wonder what cryptocurrency wallet to choose, because those that support Ethereum will usually support ERC20 tokens. For example, MyEtherWallet.

#5. How to create ERC2O tokens?

After reading these explanations, you might think that it would be impossible for a person with no computer language knowledge to create a token. Developers have to write the smart contract, which will not only create the token but handle transactions and track people’s balance. However, there is also another option, for those not so familiar with programming languages.

Go to Token Factory. You have to enter the following information:

  • ​Total supply
  • ​Name
  • ​Decimal
  • Symbol

That’s it. The site writes code and the smart contract for you and adds it to the Ethereum blockchain. It is so easy, in fact, that Etherscan lists over 80,000 token contracts. However, not all ERC20 tokens are worth something, and you can be deceived into purchasing a token that is completely worthless. So, buyers beware!

We can conclude that ERC20 tokens are all those tokens created following ERC20 protocol to ensure interoperability. However, there are still some problems in the system like the fact that users tried sending ERC20 tokens to smart contract, which resulted in the loss of these tokens.

That’s why the ERC20 has been improved with the implementation the ERC223 protocol, which doesn’t allow users to send ERC20 tokens to smart contract, which are not designed to accept them.

It’s likely that we will see more improvements in the future when tokens start to play a bigger role in the crypocommunity. So, keep your ears to the ground.

Did you understand what ERC20 tokens are? Do you own some? What do you think is their future? Tell us your opinion in the comments and share the article with your friends.

About the author

    WhaleSumo