The simple answer is that ERC 20 is the standard for tokens issued on the Ethereum network.
We’ve learnt what smart contracts are here. Essentially smart contracts are apps on the Ethereum network. With them developers can create anything they want. In order be able to afford to invest the time to create something, they need funding. They can do that with ICO’s. An ICO (initial coin offering) is like and IPO in the stock market. People can invest in the project, funding the developer in return for tokens.
Tokens can do various jobs.
They can act like in game currency within the app. They can also work like shares of a company, growing with the value of the Dapp, or providing voting rights to the holder. Another example use for them would be as loyalty points. Tokens can be used by the dapp itself which may interact with other dapps on the Ethereum network. Importantly they have value and can be traded and used to interact both within the dapp and with other dapps. However, it is up to the developer to create the token.
How are tokens created.
Tokens are created by simply implementing a smart contract on the Ethereum network. The smart contract code will allow you to buy tokens by transferring ether to the contract, which will provide you with a number of tokens in return. In addition to creating the tokens, this smart contract is responsible for handling transactions of the tokens and keeping track of balances of each token holder. It sounds simple but remember that each time a developer creates this smart contract, it is new custom code and each developer is working on their own. Given the fact that Ethereum smart contracts cannot be changed once deployed, if the code has a bug, it can be quite disastrous. Imagine a bug that would allow someone to change details of the token holders, essentially letting someone steal tokens. Furthermore, if two different developers build different tokens, in order to be able to trade or interact between the dapps and tokens, the developers would have to collaborate to map out how the tokens will work with each other and interact. Doing this with every other project that would like to interact with your project is not scalable or realistic
Ethereum allows developers to submit a proposal to improve Ethereum in the form of an EIP (Ethereum Improvement Proposal). This EIP is then reviewed by the Ethereum Committee and then if approved becomes an ERC (Ethereum Request for Comments). ERC’s are guides which contain rules and recommendations for developers to follow.
The 20 in ERC 20 is simply the number assigned to this particular ERC. It deals with the standards for developers of tokens to follow. This allows them to be exchanged for other tokens or transferred into a crypto wallet. The rules to qualify as an ERC20 token are pretty simple but very effective. There are 3 optional rules and 6 mandatory rules
Optional rules are :
• Token Name – Each token should have a name assigned to it
• Symbol – The token should have a symbol . In the same way BTC represents Bitcoin or ETH represent Ethereum
• Decimal (up to 18) – How divisible is the token. Can I spend 0.1 tokens or can I spend as little as 0.000000000000001 of a token
The mandatory rules are that the smart contract should have the following methods. (A “method” in computer programming is simply a way of interacting with this smart contract ):
- totalSupply – using this method shows the maximum number of tokens allowed to be issued
- balanceOf – this method returns the number of tokens that any particular holder has
- approve – Verifies the contract can give tokens to a user taking into account the total supply. I.e is there enough left in the total supply created to give to someone.
- transfer – once approved, this method transfers tokens from the total supply to a user
- allowance – This method verifies User A can give tokens to User B taking into account User A’s balance. i.e. Does User A have enough tokens to give.
- transferFrom – This can be used to transfer tokens between any two users who hold them.
If your smart contract code can do these things, then it is considered an ERC20 token
By knowing how to interface with the smart contract that creates, manages and transfers tokens, Wallet creators and exchanges can now easily add tokens to their apps without any special code needing to be created. It also helps independent developers in the same way by allowing them to interact with tokens without having to relearn the differences each time.
The liquidity and activity of these tokens and the apps they represent, brings real interest from investors and value to the Ethereum network
ERC20 disadvantages and flaws
Low barrier to entry leads to low value tokens
The ERC20 standard is very simple by design. This is actually a good thing, however it means that it is extremely easy for someone to create a token to gain funding. All that is really required is a white paper, outlining your project and the smart contract to create your code. It is so easy, in fact, that there are websites where you can simply type in the name, symbol, divisibility and total supply and it will create and deploy the token for you. Many tokens were overhyped have little supporting them and many more were used to scam unsuspecting investors.
ERC20 standard doesn’t regulate everything the smart contract does. As a result, there are a number of flaws which have been found. One example, is that most smart contracts will accept Ether and provide tokens in return. If instead of sending Ether to the contract, a different token is sent, those tokens could be stuck in the smart contract and lost if the contract isn’t coded for such an eventuality.
Distinction between Ether and tokens
Ether is designed into and is defined by the Ethereum protocol itself, whereas tokens are built and defined by the smart contract deployed on top of the Ethereum platform. ERC20 tokens are not coins or separate cryptocurrencies themselves. They run on top of the Ethereum network. They are another example of something that can be created using the Ethereum platform in the same way, that something can be created on top of a java or web platform. They are simply a special kind of app built on within Ethereum.
In summary, while a cryptocurrency can be thought of as money that is spent or used just like old fiat money, an ERC20 token is more like a share in a company, representing funding and investment into a project. While it can have other uses also, such as providing voting rights, or access, this general distinction is handy to remember when dealing with tokens and their value.