LEGO and our digital Web3 realm…..
What are token standards and why do we need them?
There is an analogy used in the Web3 world that a blockchain such as Ethereum, Polkadot, or Solana is a platform for money-LEGOs. When audited contracts, DeFi protocols, crypto tokens, etc all have recognisable standards across the eco-system, it guarantees that they can inter-operate smoothly with each other. So when crypto tokens are designed, we need to make sure the infrastructure on the blockchain, e.g. crypto wallets can communicate with them. We therefore ensure that the whole system is composable, just like Lego blocks.
Since we are using the Ethereum Network in our lessons track, we’ll use the Ethereum ecosystem as our basis for explanation here.
The birth of a token standard.
Any ERC token starts its life as a technical design proposal in the Ethereum community. It’s short for an Ethereum Request for Comment. It gets voted on, and if well received, the design will be perfected and it will become an ERC token.
There are many types of these tokens, but we are going to look very briefly at only three of them. Just think ecosystem, interoperability, composability and of course LEGO, and you’ll start to get the picture!
Let’s first make this distinction. Every blockchain has its own unique native currency. Ether, or ETH is the native currency coded into the Ethereum blockchain. It secures the network financially, and is among other things, used for paying transactions fees. But an ERC token is a token standard on top of this.
What does it do though?
It’s good to realise that the token standard is what it is because of the code in the smart contract that creates it. Similarly to ETH, we can use an ERC20 on the network as a token of value. And similarly to money, one token has all the same properties to the next one. So we say that it is fungible. The smart contract that first mints the ERC20 tokens also serves to track ownership and supply of all of those tokens across the network. Actually they never leave the contract. The crypto tokens you see in your wallet, is just a reference to them in their home of the smart contract. That’s why you will sometimes see warnings about scams saying “always check the token contract address”. That address hash, will point towards home to the token contract it came from. Examples of ERC20s are DAI, MATIC, UNI, etc.
Sound reasonable? Now an ERC721 aka an NFT, is a non-fungible token which means it’s unique. And the differences in one to the next can be as big or small as we decide to create in both the smart contract that points to it, and the type of content that it will actually be, whether it’s a seated concert ticket, or a rocket to the Moon. There are proving to be an ever growing number of things we can use them to represent. An ERC721 has all the functionality of an ERC20, and of course much more. We can expect to see half of the world being NFT-ed at some stage in the future!!
And lastly…… at least for this moment in time, the ERC1155, a multi-token standard. Its smart contract seeks to manage both ERC20s and ERC721s from inside one contract. It is proving ideal in the world of gaming where fungible and non-fungible qualities are needed, for example representing life/energy for the former, and any range of attributes/weapons that hold a subjective value for the latter. As far as ERC1155 development is concerned, it is giving us a chance to improve on some design issues on the other two tokens. It makes precious on-chain bytecode storage much more efficient, and it is simply opening up a whole new world of possibilities exponentially.
Are ERC20 and ERC721 tokens going to disappear? No way. But watch this space for the ERC1155!
Now, you have a few NFTs to create, so we’ll let you get back to that. Have fun!