What Are Tokens?
If you’re new to the world of digital currency, you will often hear the terms “coin” and “token” used, at times, interchangeably. In our physical world, you know a “token” is a physical (tangible) representation of something of value.
In the world of cryptocurrency, a “token” also represents something of value in a particular ecosystem. Usually, a token represents an asset or utility that a company has, which are given away to investors. This could represent anything from value, stake, voting rights, or any creative item or thought of value. For this reason, tokens can represent more than one concept, taking on different roles.
What Type of Token Do You Have?
There are two types of tokens in the crypto-verse--fungible tokens and non-fungible tokens. Let’s explore both.
Fungible Tokens
A token is considered “fungible” if it can be used interchangeably with other goods or assets of the same type.
Take the following example:
Alice wants to borrow $100 from Bob. To pay Bob back, does Alice need to pay him back with the exact same $100 bill?
Of course not. It’s very easy to pay Bob back with two (2) $50 bills or even ten (10) $10 dollar bills. Same concept with a cryptocurrency token that is considered to be “fungible”. Not all tokens are fungible.
The most popular example of a fungible token is Bitcoin.
Non-Fungible Tokens (NFT)
Non-Fungible Tokens, or NFT, aren’t as easily tradeable.
Let’s take the same example above with Alice and Bob, except instead of money, Alice wants to borrow Bob’s car. When she’s done with the car, would it be okay if she gave Bob a different car? Definitely not, and she would probably be facing questions on a stolen vehicle. A story for another time.
In this scenario, the only way Bob will be happy is if/when he gets his car back, and the exact car he lent to Alice. So why is this different here?
Bob’s car is considered a “collectible”, which is why it is considered to be non-fungible. A currency’s value is determined by its fungibility. The more widely regarded and accepted a specific cryptocurrency is, the more people will use it, of course attributing more perceived value to it.
Non-fungibility is a characteristic for items that are considered to be “unique”, rare, or otherwise limited in quantity. Therefore, when you’re interacting with cryptocurrencies, always make sure you know whether or not the token you have or are using is fungible or not. This will dictate what you choose to use as payment.
The most popular example of a non-fungible token is CryptoKitties.
What Standard is the Token Governed By?
Once you have identified the type of token you have, now look to how it’s governed. In creating a healthy crypto ecosystem, developers needed to analyze the smart contract structures behind each token, which is why there are certain rules which have been implemented to help govern a token’s underlying architecture.
The two most commonly used standards are the ERC-20 and ERC-721 standards.
ERC-20: Fungible Standard
A token is considered “fungible” if it can be used interchangeably with other goods or assets of the same type.
Take the following example:
Alice wants to borrow $100 from Bob. To pay Bob back, does Alice need to pay him back with the exact same $100 bill?
Of course not. It’s very easy to pay Bob back with two (2) $50 bills or even ten (10) $10 dollar bills. Same concept with a cryptocurrency token that is considered to be “fungible”. Not all tokens are fungible.
The most popular example of a fungible token is Bitcoin.
- totalSupply
- balanceOf
- transfer
- transferFrom
- Approve
- Allowance
Assuming the token has all of the above-mandated requirements, it has the option of having the following characteristics:
- Token Name
- Symbol
- Decimal [up to 18]
Now, going back to our understanding of fungibility--if you are interacting with a “fungible token”, this means that another token of the same type can replace that one token, while the underlying rules that govern those two tokens are the same. And lastly, the tokens are divisible and can be used to pay back a larger amount.
For example, 1 BTC can be paid back with 0.50 BTC, 0.30 BTC, and 0.20 BTC.
ERC 721: Non-Fungible Standard
If you’re dealing with a non-fungible token, this will fall under the ERC-721 standard. This is similar to ERC-20 in that it’s easy for developers to make the transition while making life easier for users who can store these tokens. Specifically, this standard describes the transfer and approval of tokens.
- ownerOf, which helps query a token’s owner;
- transferFrom, which helps transfer ownership of a token.
Looking at these two methods, it’s important to understand how these functions work.
Token Ownership
When you are purchasing ERC-20 tokens, your ownership rights are written into the smart contracts, which contains data on how much tokens each address will have after the deal. The reason why these contracts don’t have to worry about specific tokens is that they are fungible.
For ERC-721 tokens, remember, they are non-fungible, and no token is the same. Therefore, simply adding an address and balance to the smart contract, like for ERC-20 tokens, isn’t enough.
Instead, a token’s unique ownership details also need to be added.
Transfer Events
When a contract is ready to call for an event, the event is then broadcasted to any listening programs, which then execute the code. With ERC-721 tokens, there are only two events
Transfer
When a token changes hands, the event is broadcasted. Each time a token’s ownership transitions from one person to another, this event is broadcasted, sharing the following information:
- Which account sent the token?
- Which account received the token?
- Which token was transferred?
Approval
The second event, “approval”, is broadcasted when a user allows another user to take ownership of a particular token. This details which account currently owns the token and which account will be obtaining the permission to own it in the future. This requires the token ID to be checked so that the particular token has been approved for the completion of the transfer.
Other Non-Fungible Token Standards
In addition to ERC-721, there are other NFT standards that are used.
ERC-1155
Created by the Enjin team, ERC-1155 is an NFT which represents a class of assets, rather than a single asset like ERC-721.
Think of a “cards” collectible, where you would have 50 cards to 1 ID. Therefore, a user could transfer all 50 cards simply by modifying the smart contract’s state.
However, the disadvantage of ERC-1155 is the loss of traceability.
ERC-998
ERC-998 is for “composable tokens”, which have the ability to combine things, parts, or elements. Specifically, it’s able to represent more than one digital asset. What the ERC-998 protocol does is add an extra step to NFT, by adding a new layer of complexity.
Portfolio of Different Assets
A single ERC-998 token represents a portfolio of digital assets, allowing for NFT to own both non-fungible and fungible assets.
A single NFT can also act as the “central token” to a transaction, which can be supplemented with additional ERC-20 or ERC-721 tokens for a form of added value.
Single Asset and Its Parts
An ERC-998 token can also represent the parts to a whole. Take a Rolex watch, for example. The token can represent the casing, face, and movement arm of the watch, comprising of the Rolex watch as a whole.
Since each part is uniquely represented by its own NFT, each NFT on its own has no value until it is combined with the rest of its counterparts, forming the actual whole product. The purpose of this is to minimize counterfeiting, especially when the token represents jewelry.
Looking at the diagram above, which show three parts which make up the Rolex watch. Each part (case, face, and movement arm) has its own serial number. Taking each part on its own, they have no value until combined together.
For more information on composables, please click here.