Crypto Alphabet

What are ERC-20 tokens?

Launched in 2014, Ethereum (ETH) wants to create an ecosystem where everything works together seamlessly as part of its vision for a ‘world computer’ – and that includes the tokens required to power it.

Ethereum is the popular cryptocurrency and blockchain system that was designed to make it possible for anyone to code nearly any type of app and deploy that on a blockchain. Ethereum is based on the use of tokens which can, among other things, be purchased, sold, or traded. There are several different tokens that are compatible with the Ethereum protocol, and these differ from Ether. Ether is the currency native to the Ethereum blockchain that is used to pay for transaction fees, miner rewards and other services on the network.

Tokens, in this case, represent digital assets that combine several values and can represent anything from loyalty points to vouchers and IOUs to actual objects in the physical world. In this way, tokens are essentially smart contracts that are developed on Ethereum blockchain, which is an open source blockchain platform that allows for the creation of so-called “smart contracts”. One of the most significant token standards of all for Ethereum is called ERC-20, which is simply a cryptocoin that’s built atop Ethereum and that allows developers of wallets, exchanges and other smart contracts, to know in advance how any new token based on the standard will behave.

ERC-20 tokens empower developers

The ERC-20 defines a common list of rules for all Ethereum tokens to follow. This means that this particular token empowers developers of all types to accurately predict how new tokens will function within the larger Ethereum system. It’s important to note that projects do not need to be redone each time a new token is released, which means that the impact that ERC-20 has on developers is massive. Rather, they are designed to be compatible with new tokens, but in order for a token to be created and transacted on the Ethereum network, it must follow a set of rules. However, there is a great deal of freedom for developers within these rules, which means that the ERC-20 standard is very adaptable and can be used to make a limitless variety of tokens, each with varying functionalities. Developers of new tokens have by-and-large observed the ERC-20 rules, meaning that most of the Ethereum based tokens being created today are ERC-20 compliant. Some of the more popular ERC-20 tokens are OmiseGo (OMG), Power Ledger (POWR), EOS (EOS), etc.

ERC-20 tokens are defined by 6 functions and 2 events

ERC-20 is defined by a set of six functions that other smart contracts within the ethereum ecosystem will understand and recognize. They include:

  • totalSupply (when this limit is reached, the smart contract will refuse to create new tokens)
  • balanceOf (indicates the number of tokens a given address has)
  • transfer (takes a certain amount of tokens FROM the total supply and give them to a user)
  • transferFrom (this function can be used to transfer tokens from one address to another)
  • approve (verifies that your contract can give a certain amount of tokens to a user taking the total supply into account)
  • allowance (checks whether one user has a sufficient amount of tokens to send to someone else)

These six core functions are found in 99% of all currently live ERC20 tokens. The standard is also defined by two events (signals) that each token takes on and which other tokens are attuned to:

  • Transfer (broadcasts the details coins moving from one contract to another onto the network)
  • Approval (broadcasts the details of approvals of tokens from one address to another onto the network)

Developers agreed on these six functions and two events as the minimal viable token in order to normalize expected behaviors while communicating across the Ethereum network. By establishing this protocol, Ethereum developers are able to work with external smart contracts easily.

Together, these functions and events make ethereum tokens work the same almost everywhere within the ethereum ecosystem, which means that almost all of the wallets that support the ether currency also support ERC-20 compliant tokens. The most popular wallets that support Ether are Jaxx, and Ethereum Wallet (also called Mist Wallet).