Why bother?
Tokens are used extensively in the blockchain world. Whether in the form of cryptos or NFTs, we deal with tokens. So it is a must to understand what is it exactly so that we can fully harness the full potential of decentralized value exchange.
Tokens and token contracts
Often misunderstood and used interchangeably, both tokens and token contracts are different yet related.
A token is a digital representation of an asset. It can represent various assets like cryptocurrency, digital goods, or even real-world assets through smart contracts. A token contract is a type of smart contract. It defines rules to create, destroy (burn) and exchange tokens.
Let's take an analogy for tokens and token contracts: currency and central banks. A currency has no value until central banks give some value to it and define rules and regulations regarding its supply and exchange. Similarly token contracts are used to manage tokens.
Dichotomy of Tokens
Fungible Tokens encompass tokens that are used as a medium of exchange. Non-fungible tokens (NFTs) are unique entities where their distinctiveness holds greater significance than their value.
For example, If I give you five ₹100 notes in exchange for ₹500 notes, you won't mind exchanging it because the value is the same only. So currency is a fungible token.
However, if I propose trading my house for yours, you would decline, even if the values of both houses are equal. Houses are non-fungible tokens due to their uniqueness.
All cryptocurrencies like Bitcoin, Ethereum, Matic, etc., are fungible tokens, whereas digital assets traded on marketplaces like OpenSea are non-fungible tokens. So basically, when you make a transaction on OpenSea you are exchanging tokens against tokens only.
Different Token standards
There is no universal, standardized way to write and implement token contracts. However, there are some popular standards in the blockchain for the users to pick and customize as per their needs. For example in the Ethereum blockchain, ERC20 is used for creating token contracts for fungible tokens. While ERC721 is used for creating non-fungible tokens.
Conclusion
To wrap up, tokens are the building blocks of blockchain, making transactions easy and representing different things. Think of fungible tokens like regular money and non-fungible tokens like unique items. Ethereum's ERC20 and ERC721 standards show how tokens work. Knowing all this helps us make the most of decentralized technology!