Blockchain Ethereum ERC-20
Ethereum is the second most popular cryptocurrency after Bitcoin. The exhibit to justify this assertion lies in the price of ether and market capitalization as recorded on coin market cap. Like Bitcoin, Ethereum runs on the blockchain technology, which ultimately makes it, decentralized. Notably, ether is the native cryptocurrency on the Ethereum network but other tokens can be used on the network as well. Basically, tokens refer to digital assets that can be representative of physical assets as well. In other words, tokens are more like smart contracts, which mostly leverage the Ethereum blockchain.
The Ethereum network is synonymous with smart contracts and standardized tokens referred to as ERC-20 token contracts. While the smart contracts have gained a considerable degree of popularity, the ERC-20 token contracts remain foreign to many. This is however due to the fact that the ERC-20 token contracts were developed slightly over one year ago.
What are token contracts?
Before appreciating the discussion on what ERC-20 token contracts, it is essential to first gain a good understanding of what token contracts are. The definition of what tokens contracts has been contentious. Essentially, however, token contracts are smart contracts containing account addresses and the balances in those accounts. Notably, the balance in the smart contract is representative of a value that is often determined by the creator of the contract. The unit of the balance in the contract is what is commonly referred to as a token.
To ensure accountability and transparency in the transactions, balances on the two accounts involved is automatically updated by the token contract every time a token transfer is made. It is important to note that the supply of tokens can be changed but only if the token contracts allow. Thus, the tokens can be increased by minting new ones or decreased by burning existing tokens. Burning tokens entail sending existing tokens to an unknown private key, which is often referred to as the zero address.
Defining ERC -20 token contracts
ERC-20 token contracts are Ethereum based tokens created based on the ERC20 standard protocol. HTTP is a commonly used premise but most people do not know that it is the protocol that defines the internet. Similarly, ERC20 defines the commands that a token should implement. Unlike what some may think, ERC20 is not some form of software or technology or even code. It is simply a specification that ought to be adhered to. It is only if a token is developed based on the ERC20 standard that it qualifies to be referred to as an ERC20token. Within the ERC20 standards are key functions that ensure that the token is traded on exchanges. Some of these functions include balance inquiry for a particular address, checking the total supply of the tokens and transferring the tokens from one address to another.
Essentially, all tokens that comply with the ERC20 protocol have the same functions and are built on similar arguments. This characteristic makes it quite easy to add the tokens to an exchange and one can do so as soon as the token is released. Moreover, ERC20 tokens can be traded easily on the trading platform. Notably, before the development of the ERC20 protocol, most tokens would be created with different functions and some on the different argument as well. What this meant was that enabling trading between any two tokens required that the trader or developer familiarize themselves with the intricacies of each token. Hence, attempting to create a platform on which to trade these different tokens would come with major complexities.
Precisely, the key objective of the ERC-20 protocol is to ensure more uniformity, minimize risk is developing the tokens and enhance the liquidity of the tokens.
Functions enabled by ERC-20
The functions embedded in ERC 20 tokens revolve around checking balances of accounts, approval and transferring the crypto from one address to another. Basically, the ‘balance of’ function allows one to view the balance in any particular address. Most importantly, anybody can check the balance on any address for the simple reason that the blockchain is a public ledger. However, it is impossible for one to know who the owner of the address is since personal information is not recorded on the blockchain. The ‘transfer’ function allows one to send tokens from one address to another. Notably, no confirmation checks are conducted on the recipient's end meaning that the sender must perform their due diligence to ensure all the details are correct.
It is important to note that when dealing with smart contracts, the ‘transfer’ functions cannot suffice on itself. The reason behind this is that at the time when the smart contract is expected to execute, it might not have access to details proving the transfer of funds required to execute the contract. Hence, the ‘approve’ function comes into play. For instance, assume person A floats a contract on the network. The contract requires a transfer of 5 tokens to execute. Person B who is willing to get into the contract has 20 tokens in their address. In this scenario, approve and the transfer would have to be used jointly. First, B would give their address approval to make a transfer of 5 tokens to A’s address. This is called allowance. Having defined the allowance, the tokens can then be transferred to A and the contract can execute.
What’s next for ERC-20?
Development of tokens is mired with a host of risks and intricacies which ERC20 standard has helped minimize. However, ERC20 is not without flaws. The ERC223 proposal contains other features that can be added to the ERC20ptotocol to make it more effective. Unfortunately, the ERC223 is currently not compatible with ERC20. This means that developers will have to keep on using the ERC20 protocol in developing tokens. Nonetheless, it is essential to keep track on the ERC223 proposal considering that the process of refining it is still underway. Additionally, one can make contributions to the ERC223 proposal. This will enable the ERC223 developers to create a more versatile protocol.
Other related articles on Blockchain: