Tokens: CW20 vs tokenfactory

The Ethereum blockchain was the first one to introduce the concept of tokens. Within Ethereum, the ETH coin is the native gas coin of the chain, and you can natively (meaning: a function of the chain itself) send ETH to other wallets, to smart contracts, and even include some ETH when executing smart contracts. However, people wanted to be able to create new assets without spinning up a new chain.

To allow for this, the Ethereum ecosystem invented ERC20, a standard for tokens. This is a smart contract API, and any smart contract that provides the necessary functionality can be considered its own token. There are thousands of such tokens available on Ethereum.

In the Cosmos ecosystem, we have a related standard: CW20. This is intended to do the same thing as ERC20, but based on Cosmos smart contracts. Both standards allow for sending tokens, checking balances, and executing smart contract messages with attached funds. However, in both ecosystems, it's not as natural or as cheap (from a gas perspective) as interacting with the native coins.

A number of chains in the Cosmos ecosystem have been moving away from CW20. Instead, there are two common ways to deal with other assets these days:

  1. Using Inter Blockchain Communication (IBC), you can bridge a token from one chain to another.
  2. Some chains provide a token factory, which allows you to create a new native coin on that chain.

On the Osmosis chain, for example, you can trade ATOM. The ATOM you'll be trading is bridged via IBC to Osmosis. Also on Osmosis, the Levana team created a new LVN token using token factory, so that its native location is Osmosis.

For the most part, CW20s are dying off now, so you should focus on native coins, IBC, and token factory. Each of these is identified by a denom or denomination, a string that uniquely identifies each asset on that chain. You can see a list of Osmosis assets. Some examples:

  • uosmo is the native Osmosis coin. The u at the beginning means "micro," so that 1,000,000 uosmo is one OSMO coin.
  • ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 is the IBC-bridged ATOM coin on Osmosis.
  • factory/osmo1mlng7pz4pnyxtpq0akfwall37czyk9lukaucsrn30ameplhhshtqdvfm5c/ulvn is the Levana token created via token factory.

With native tokens, including IBC and token factory, you can send the coins with a normal MsgSend message, query the balance using native queries, and attach the funds to any smart contract execution.