ERC20: The Ethereum Token Standard
A token is generally defined as a thing that serves as a representation of something else. On a blockchain network, a token often represents financial value or a digital asset, much like how arcade tokens (as in the ones that allow you to play Skee-ball) represent fiat quarters.
An ERC20 token is no different from any other token, it also just happens to conform to Ethereum’s token standard. Why would Ethereum need a token standard? Interoperability. If all tokens created on the Ethereum network use the same standard, those tokens will be easily exchangeable and be able to immediately work with Dapps that use the ERC20 standard.
What makes a token “standardized” is that it uses a certain set of functions. If developers are aware in advance of how a token will operate, they can easily integrate that token into their projects with less fear of bugs or errors. If multiple tokens behave similarly, calling the same functions in the same way, then a Dapp can more easily interface with different sub-currencies.
Because tokens aren’t only a store of value but can represent anything, things like voting rights or discount coupons can be tokenized. The Minime ERC20 token contract allows the ERC20 to be cloned for these and other functions.
Originally, the ERC20 token standard was available and actively being discussed as an Ethereum Improvement Proposal (EIP) here. Due to changes in how the Ethereum Foundation is organizing its GitHub, the ERC20 standard was moved from a GitHub issue to a GitHub pull request (PR), viewable here. On GitHub, Hudson Jameson of the Ethereum Foundation said, “To be clear, this is NOT a new version of ERC-20. This PR is simply meant to formally define ERC-20 version 1 since there are slight deviations within the community. Once community consensus on version1 is reached, we will mark this ERC as accepted and it will become official with regards to the EIP repo.”
While there are many ERC20 tokens currently in use across a multitude of Dapps and startup projects, there is still work being done on the token standard. One minor unresolved issue with the ERC20 standard is that sending tokens directly to a token contract loses your money. It has to do with how token contracts function. While you would use the same wallet in which you store your Ether to buy, sell, or transfer a token, it’s a token contract that you’re actually interacting with. It’s that token’s contract, the contract that created the tokens in the first place, that handles the allocation and tracking of those tokens across Ethereum. So, when a user transfers a token to another party, what they’re actually doing, on a technical level, is calling a function on the token’s contract to move the tokens for them, as opposed to them directly issuing tokens from their own wallet.
That doesn’t mean a token holder doesn’t have complete ownership of the tokens they’ve acquired, though. Instead of the Ethereum network keeping track of who owns tokens the same way it tracks who has Ether, it’s a token contract that keeps tabs on token holders. That’s because tokens are effectively sub-currencies on the Ethereum network, where each token has its own contract that manages the distribution and tracking of those tokens. For example, an Augur user attempting to send REP tokens to someone else would be calling on the REP ERC20 contract to send tokens to a new address. The REP contract would see the initiating address is assigned an amount of REP tokens, see how many they’re attempting to send to a different address, and then allocate the REP appropriately. Token contracts are essentially distributed ledgers within the greater Ethereum distributed ledger.
If you’re interested in an incredibly comprehensive tutorial on creating a digital token, the Ethereum Foundation has a fantastic resource on its website. It goes through every single step in the process of creating your own cryptocurrency, from generating a token contract to deploying and interacting with that contract. The written tutorials even cover adding different levels of customization to your token. As the Ethereum network continues to grow and develop, so may the ERC20 standard. Be sure to check GitHub on occasion to stay up-to-date on all the latest updates and issues regarding Ethereum tokens.