The Ethereum ERC-20 Token Specification

The Ethereum Request For Comment ERC are defined technical protocols from an EIP (Ethereum Improvement Proposal) request to the Ethereum development community. Once the EIP has been approved, it becomes an ERC, and can be implemented on the blockchain. The ERC-20 token was a specification that allowed projects to use the Ethereum blockchain as a source for funding. It became very significant when ICOs (Initial Coin Offering) became popular between 2015 and 2017. That was until financial and trading compliance issues affected the continuation of ICOs due to lack of regulatory clarity. Certain projects will be under scrutiny to participating in ICO if they have not passed the statutes of limitation for the issuance of an unregistered “security”. This falls under the SEC (Securities and Exchange Commission) for most jurisdictions and have since discouraged new projects from issuing an ICO.

Since many projects are already using this as a standard on the Ethereum blockchain, the number of ERC-20 token contracts has grown. By mid-2017, there were around 5,500 ERC-20 smart contracts on the Ethereum network. It grew past 40,000 in 2018 and are further increasing. ERC-20 is not just a technical specification for creating tokens, but it also provides a guideline for how to interact with other wallets, smart contracts and digital marketplaces within the Ethereum ecosystem.

The ERC-20 became a standard on the Ethereum platform not only for funding, but for the issuance of tokens. Several cryptocurrency projects started out as ICO with tokens (e.g. EOS, Tron, OmiseGo). These projects used the Ethereum blockchain to fund their own coins as issued tokens which can later be exchanged for the native cryptocurrency asset once the main network is running. The ERC-20 tokens were temporarily locked into smart contracts that hold a certain amount of Ether. Once the projects were able to build their blockchain, the ERC-20 tokens from the smart contract could be exchanged for the native asset for that blockchain.

As a standard, ERC-20 provides uniformity of technical and protocol standard. This allows developers to follow a procedure, much like how developers create API for their application to communicate with other applications. This reduces complexity of understanding each type of token implementation. A tremendous benefit it brings to the Ethereum blockchain is enhanced liquidity, since Ether or ETH is required to purchase the tokens. That can affect the price of ETH in terms of market cap.

The structure of an ERC-20 token contains 6 functions, 2 events, and 3 token information functions. These functions are invoked and can be be called within a smart contract. From the ERC-20 specification, the following are the 6 functions:

1. totalSupply(): Total supply of Token.

2. balanceOf(address _owner): The balance in the _owner address.

3. Transfer(address _to, uint256 _value): Sends a token of _value to address_to, triggering the Transfer event.

4. transferFrom(address _from, address _to, uint256 _value): Sends a pass from the address_from _value to address_to, triggering the Transfer event.

5. Approve (address _spender, uint256 _value): Approve _spender to extract a certain amount of money.

6. Allowance(address _owner, address _spender): Returns the amount that _spender extracted from _owner.

Decentralized Apps or DApps also support ERC-20. These apps run on top of the Ethereum blockchain. The DApp can be used to query information or even to execute a smart contract. Developers can use the functions when dealing with digital tokens created on the Ethereum blockchain.

The following are the 2 events that are triggered by the functions:

1. Transfer(address indexed _from, address indexed _to, uint256 _value): Triggered when the token is transferred.

2. Approval(address indexed _owner, addressindexed _spender, uint256 _value): Triggered when the approve method is successfully called.

The token also needs to be set with any of these 3 types of token information:

1. Name: Name of the issued Token.

2. Symbol: The name of the Token issued. For example, EtherCent token or ECT on https://rinkeby.etherscan.io/token/0x8caca3dbb57ecb058a82209effde5bf647459771


3. Decimals: Set how many digits this token can reach after the small digits. Generally, the set value is 18, which means that it can reach 18 digits after the decimal point.

The following is an example ERC-20 token created on the Rinkeby test network.

Since Ether (ETH) was released prior to the ERC-20 standard, it does not actually comply with the specification. As a result, this led to the creation of Wrapped Ether (WETH). This is an ERC-20 token that represents Ether at a 1:1 ratio (1 WETH = 1 ETH) which can be exchanged for other ERC-20 tokens.

Since the popularity of ICOs have waned in 2020, ERC-20 tokens are not as common. They are still in use mainly by projects that have not yet released their own native tokens or by new projects that are testing token development (usually on a test network). By keeping their ERC-20 tokens locked with ETH, they are providing a sort of promise to their holders that they can convert it for more value in the future. The converted tokens can then be used within those blockchain projects as a medium of exchange or store of value.

The Cardano Principles For Scalability, Interoperability and Sustainability

Cardano is a unique cryptocurrency project that is based on sound principles rooted in science and engineering. Its application goes beyond financial systems, but implements a blockchain that covers a wider variety of applications. While it is available as a coin on digital exchanges, it does not yet have an actual use case (as of this posting). It is a development in progress that aims to nail the foundations for a well designed blockchain.

We can consider Cardano a Third Generation Blockchain. The First Generation uses Bitcoin’s Proof-of-Work (PoW) consensus mechanism and the UTXO model. Ethereum forms the basis for the Second Generation, which implements Turing complete Smart Contracts or EDCC (Executable Distributed Code Contracts). The Third Generation, which include other cryptocurrency like EOS and Tron, were based on Ethereum but innovate on consensus mechanisms. Like other Third Gen blockchains, it was also issued using an ICO that raised $62 Million.

Cardano, like Ethereum, uses a smart contract based system. The token or digital asset used on the network is called Ada. Ada provides balances to users with the Daedalus digital wallet. Cardano is also a platform for technological innovation and development. It will provide an operating system layer for DApp (Decentralized Applications) that run on the Cardano network. These DApp provide an interface to smart contracts that execute code to transfer value (e.g. payments, transfers, change of ownership, etc.). Cardano will facilitate these transactions and record it on its own blockchain for immutability and transparency purposes.

Cardano has 3 main features in its blockchain.

  1. Scalability – The network must be able to scale to meet the demands for high volume transaction processing. The developers address the issue of scaling by adopting a different consensus protocol mechanism that is based on Proof-of-Stake (PoS). Scalable systems are faster and more efficient, which is what a blockchain needs in order to handle production level processing of transactions. The network architecture for Cardano proposes using RINA (Recursive Internetwork Architecture).
  2. Interoperability – Many blockchains cannot directly interoperate with one another. There are solutions now that allow for “atomic swaps”, which essentially provides a way for two blockchains to transfer value between each other. Prior to that, digital exchanges were the only way to go. That creates an intermediary which is something a blockchain using direct P2P transfers can remove. With a third party, the cost of transactions increases and it can be tampered, censored or rejected.
  3. Sustainability – Many critics have called Bitcoin inefficient and unsustainable in the long run due to the way it consumes resources. A sustainable system is always more ideal in terms of efficiency and reliability. Sustainable systems have a way to last thus ensuring some degree of surviving into the future. Many blockchain projects lack this feature and have to end for a variety of reasons.

PHILOSOPHY

The following are Cardano’s philosophical principles taken from their website.

  • Separation of accounting and computation into different layers
  • Implementation of core components in highly modular functional code
  • Small groups of academics and developers competing with peer-reviewed research
  • Heavy use of interdisciplinary teams including early use of InfoSec experts
  • Fast iteration between white papers, implementation and new research required to correct issues discovered during review
  • Building in the ability to upgrade post-deployed systems without destroying the network
  • Development of a decentralized funding mechanism for future work
  • A long-term view on improving the design of cryptocurrencies so they can work on mobile devices with a reasonable and secure user experience
  • Bringing stakeholders closer to the operations and maintenance of their cryptocurrency
  • Acknowledging the need to account for multiple assets in the same ledger
  • Abstracting transactions to include optional metadata in order to better conform to the needs of legacy systems
  • Learning from the nearly 1,000 altcoins by embracing features that make sense
  • Adopt a standards-driven process inspired by the Internet Engineering Task Force using a dedicated foundation to lock down the final protocol design
  • Explore the social elements of commerce
  • Find a healthy middle ground for regulators to interact with commerce without compromising some core principles inherited from Bitcoin

OUROBOROS

Cardano’s consensus algorithm uses PoS and is called Ouroboros. This determines how participating computers called nodes come to a consensus on the network. Instead of miners like in PoW consensus algorithms (used by Bitcoin), PoS requires staking funds to qualify or participate as a validator node. These “stakeholders” must contribute to secure and process blocks of transactions on the network and in return they will be incentivized in Ada. If a “stakeholder” is dishonest or attempts to attack the network, they can lose the funds they staked so there is a consequence. This aims to make “stakeholders” good faith actors rather than become bad actors. Once “stakeholders” validate a block it is added to the main network’s blockchain.

What makes Cardano different from other PoS-based networks is according to their own website:

“For a blockchain to be secure, the means of selecting a stakeholder to make a block must be truly random. An innovation of Ouroboros to produce the randomness for the leader election process is to do this by way of a secure, multiparty implementation of a coin-flipping protocol.”

DEVELOPMENT COMMUNITY

Cardano also fosters a development community since it is an open source project. There are no barriers to entry for those who want to contribute, but is mostly on a voluntary basis. Developers are rewarded in Ada for their efforts. Cardano’s code is available for others to use in order to develop applications for the platform.

At the moment, Cardano is being managed by the IOHK (Input Output Hong Kong). They will be a part of the project until 2020 according to their contract.

FUNCTIONAL PROGRAMMING

The main programming language used in Cardano is Haskell which is functional, strong and static typed. One of the reasons it was used is due to its reliability in mission critical systems. They provide a solid and secure foundation for back end systems that handle massive workloads. This means the code and logic is stable enough to be able to scale and provide reliability with little room for failures.

In functional programming if there is a function f(x) that we want to use to calculate a function g(x) to get the results of yet another function h(x). Rather than solving in sequence, it can be simplified to a single function:

h(g(f(x)))

This provides a mathematically simpler way of computing. These form the foundations for Cardano Smart Contracts. It aids in Formal Verification to prove how a program acts and what its results will be. This gives Cardano a “High Assurance Code” property.

THE PROJECT ROAD MAP

Cardano follows a road map for its development. It is divided into 5 phases called eras: Byron, Shelley, Goguen, Basho and Voltaire. It is now in the Voltaire era in 2020, which will decide the digital governance used on the network.

For more on the road map, click here.

THOUGHTS

Like any cryptocurrency project, I don’t suggest buying their token just because the project looks good on paper. This is how Cardano is like. While it is based on a sound foundation, it has not yet been applied to solving real world problems. It offers a theoretical solution that is yet to be proven. If it does deliver on its goals, Cardano’s prices may not really go up either, since it depends on the asset’s liquidity and volume. The project looks promising and that can spur certain expectations.

Note: This is not financial advice. DYOR always to verify facts.