In a recent article, we talked about cryptographic tokens implemented on top of blockchains and how they can be used to represent fungible assets, similar to money. However, many blockchain applications involve other assets, such as property deeds. Fungible tokens, such as the ERC-20 tokens defined in the standard EIP-20, cannot represent non-fungible assets. We need a different type of token for this.
Non-fungible assets are different from fungible assets. Let’s think about a fungible asset, the US dollar, for example:
Dollar bills are interchangeable, meaning that each bill has the exact same value and serves the same purpose. The dollar is also divisible. We can use the concept of a quarter, and if we have four quarters, we own $1.
The properties of non-fungible assets are the exact opposite. Let’s use collectible baseball cards as an example:
Each baseball card is unique and depicts a different player. This means that the asset is not interchangeable. Because of this, the value of each card may be different. The price is defined by the market but will depend on the characteristics of the player depicted and the rarity and condition of the card. Baseball cards are also not divisible. We cannot sell half a baseball card. Well, in the traditional paper version we could break a card in two, but that would be pointless. We cannot talk about buying two half cards to obtain the same value as one full card. In general, the asset is not divisible.
Using the above example, we can see why ERC-20 tokens cannot be used to represent non-fungible assets. To implement a non-fungible token, we require a slightly different interface.
First of all, we need a way of distinguishing each token. We need an identifier for each token. Then, we need to change the concept of ownership. It is not enough anymore to say Bob owns three baseball cards. We need to associate Bob with the exact identifiers of his baseball cards. We also need to change the way of transferring tokens from one user to another. We now have to transfer specific token identifiers and cannot just subtract from one balance and add to another.
Creating the token is also different now. For fungible tokens, we can just set a number for total supply and we are done. Non-fungible tokens require unique parameters to be set for each token. As non-fungible tokens can represent many different assets, we have to create a way to add metadata that can represent these parameters.
Finally, we have to remove the notion of decimals, as non-fungible tokens are not divisible.
The ERC-721 token standard
As with many other blockchain applications beyond cryptocurrencies, Ethereum leads the way in non-fungible token applications and a standard has been defined. The ERC-721 token standard, defined in EIP-721 provides all the feature we have identified above.
Non-fungible tokens are a powerful abstraction to represent many real-world abstractions on the blockchain. Of course, as with everything else on the Internet, the most popular use case so far has dealt with pictures of cute cats, but many more interesting applications are starting to emerge.