Skip to main content

Introduction to CW20 Spec: Fungible Tokens

In this series, we will need our own cryptocurrency for payment action. Therefore, this chapter will provide readers with basic knowledge about tokens, fungible tokens and what is CW20 token.

What are Tokens?

“Token” is a word that you hear a lot in cryptocurrency. You might hear Bitcoin described as a “crypto token” or something similar, because — technically — all cryptoassets can also be described as tokens. In the world of cryptocurrency, tokens are the king. A token is a thing that serves as a tangible representation of a fact, quality, and can be anything of value. Tokens are not limited and restricted to one specific role; rather, they can fulfill several roles in their native ecosystem. Tokens can serve various purposes; for example, it can act as a gateway to the decentralized applications(DApps). Moreover, they can also qualify the holders to have certain voting rights. Fungible tokens are entirely exchangeable with each other, and one example of fungible assets are fiat currencies. Non Fungible tokens have burst into the mainstream due to the sudden popularity of crypto kitties, a virtual cat collectible game.

And what are Fungible Tokens?

Fungible tokens or assets are interchangeable, divisible and non-unique:

  • Fungible are Interchangeable:

    As we already mentioned, such tokens are interchangeable and can be exchanged with any other token of the equivalent kind. For example, fiat currencies are fungible. For example, $50 notes are interchangeable with other $50 notes. Similarly, one Bitcoin value can be exchanged with other Bitcoin, which makes no difference for holders.

  • Fungible Tokens are Divisible:

    These tokens can be divisible into smaller units, and one can get any number of units, and it does not matter to holders as long as the value remains the same.

  • Fungible Tokens are Uniform:

    All tokens of each type are identical in specification, and each token is identical to each other.

In Blockchain context, ERC-20 is the first technical standard for fungible tokens created using the Ethereum blockchain. The ERC-20 standard has an important roll within the blockchain; it defines a common list of rules that Ethereum tokens using smart contracts must adhere to. Some of these rules include how the tokens can be transferred, how transactions are approved, how users can access data about a token, and the total supply of tokens.

So what is CW20?

CW20 is a specification for fungible tokens based on CosmWasm. The name and design is loosely based on Ethereum's ERC20 standard, but many changes have been made. The types in here can be imported by contracts that wish to implement this spec, or by contracts that call to any standard cw20 contract.

If you want to read it in more detail, refer to the repo CW20 spec on Github.