When I was first introduced to Crypto probably one of the most confusing things was ERC-20 Tokens and how they were connected with Ethereum. I've got a short post today on some basics of ERC-20 Tokens and Ethereum. Initially this was only going to be about ERC-20 Tokens but I think explaining a couple of the aspects around ERC-20 will help with understanding!
1. Tokens vs. Coins
Before I get into ERC-20 or Ethereum I'll start here. This might be one of the largest points of confusion for people new to Crypto. I know it was for myself when I first started getting involved but is easy to understand once told.
Coins - This is an asset that is native to it's own Blockchain. When thinking of coins what would likely come to mind would be - Bitcoin, Litecoin, Ether, Dash, etc. Generally speaking coins are mined.
Tokens - These are assets that are built on top of an existing Blockchain. When thinking of tokens what would likely come to mind would be - Basic Attention Token, Tron, EOS, etc. This is how we're able to withdraw our BAT to an Ethereum address, as it is built on top of the existing Ethereum Blockchain. Tokens are created.
The creation of Tokens is made extremely easy due to the nature of the Ethereum Blockchain. They can benefit from the existing infrastructure as well as ability to transfer due to the nature of ERC-20.
2. The Ethereum Blockchain
(At A Very High Level)
Isn't Ethereum just like Bitcoin? Yes and no. Ethereum took the technology of Bitcoin and expanded on it.
According to Wikipedia Ethereum is -
"..an open source, public, Blockchain-based distributed computing platform and operating system featuring smart contract (scripting) functionality."
Put into very simple terms, Ethereum is Blockchain with the ability to program it through smart contracts (which is essentially scripting). They strive to have their own decentralized internet and so far are making progress. Wallets, games, applications, exchanges, tokens and more are built on the Ethereum Blockchain.
3. What Is ERC-20?
As we learned earlier tokens are assets that are built on top of an existing Blockchain. ERC-20 is a set of rules that developers must follow when creating a token on the Ethereum Blockchain. Those rules are as follows -
- totalSupply (total number of tokens created)
- balanceOf (number of tokens in a specific wallet)
- transfer (move tokens from totalSupply to a certain account)
- transferFrom (move tokens from one address to another)
- approve (are there enough tokens from wallet to wallet)
- allowance (makes sure when transferring that the user transferring from has enough tokens in their wallet)
What these rules allow is for tokens to be made extremely easily and exchanged/transferred automatically. When everyone is using the same language it's easy to communicate.
One thing as a programmer you run into all the time when going from one job to another is the lack of consistency in the naming conventions. One person may call something approve and the other accept and accept may have meant something completely different at a previous job. ERC-20 allows this confusion to be taken out by streamlining the standard.
Hopefully this helped a little in understanding ERC-20 Tokens and how they work.
Thanks for following, tipping and liking. :)
If you liked this article you might like my previous article on Why Publish0x is the perfect platform to learn how to write quality content.