An introduction to minting native tokens on Cardano

An introduction to minting native tokens on Cardano

Written by @elliothill of the Cardano Foundation

Full-featured native tokens will soon arrive on the Cardano mainnet through the Mary hard fork at the end of February. But did you know that right now, it is possible to begin experimenting with native tokens in the Cardano pre-production developer environment?

You can already explore native tokens using the Cardano command-line interface (CLI). As we have recently learned through IOHK’s native tokens blog, native token functionality will also come to Daedalus with Mary, allowing users to send and receive native tokens on Cardano easily.

Eventually, there will also be a dedicated token builder with its own graphical user interface. This will make it easy for anyone to mint, send, and spend native tokens through an intuitive user interface. Take a first look at that here.

In this short article for new developers, we will be looking at what you will need to start exploring native tokens before the Mary hard fork, discover some native token concepts, as well as point you to the relevant documentation along the way.

If you are already familiar with what native tokens are and you want to jump straight in, head over to our docs here.

What are Multi-Asset (MA) tokens, and why are they considered ‘native’?

When Cardano was in its infancy it existed as a single asset ledger, supporting only the ada digital token through the Byron value layer. With the advent of the Mary hard fork at the end of February, Cardano will instead be transitioning to a multi-asset ledger.

This will extend the current accounting infrastructure of Cardano’s ledger, growing to accommodate transactions that can use a range of assets simultaneously. We can describe these assets as ‘user-defined’ tokens, as they are built and deployed by independent developers, individuals, and teams on top of Cardano.

‘User-defined’ may be self-explanatory, but why do we refer to these assets as ‘native’ tokens? This is a result of native tokens’ design principles, which allow them to be deployed using the same token logic as the underlying Cardano protocol. This is somewhat different from tokens that rely on custom-code through smart contracts, such as those on Ethereum. As a result, native tokens on Cardano offer different security guarantees and functionality.

You can read more about these differences here, but it’s important to remember that unlike a smart contract-based token where token logic and behaviors are written into a token contract, native tokens on Cardano have different native components that serve a similar purpose. Let’s explore these in more detail.

How can you mint new tokens on Cardano?

Creating, or ‘minting’, new tokens on Cardano currently requires familiarity with the Cardano CLI, however as we have discussed, this will change in the near future.

At the moment, you will be required to configure a relay node through the CLI to connect to the Cardano native tokens pre-production environment before you can create a native token. You can read more about working with the Cardano CLI to mint native tokens from IOHK here. Instead, we will explore the lifecycle of native tokens below.

To create a token, you will need to set a minting policy. In the token lifecycle diagram above, this falls under ‘Define monetary policy script’. Token minting policies, defined by the asset controllers, are a set of rules that govern how the native tokens scoped under it are managed—for example, setting token burn parameters or specifying the epoch in which token distribution should end.

Tokens may only be scoped under one minting policy. This asset or token can never change its minting policy. In this way, assets on Cardano remain immutable. A single minting policy determines the minting and burning conditions of all tokens scoped under it.

Token minting policies serve some of the same functions as a smart contract would for tokens based on Ethereum, except they require very limited amounts of custom code—and are therefore less vulnerable to exploits.

For example, a time-locked token minting policy could be used to determine when tokens can be sent or spent from an address. In a traditional token sale scenario, this would enable tokens to only be released from the team’s addresses once a certain time slot or epoch had been reached, for example.

Transacting and transferring native tokens on Cardano

Native tokens can be transferred or sent to anyone with an ada wallet, much in the same way that ada can. Any user can send or receive native tokens.

A key difference between native tokens on Cardano and that of other blockchains is that different tokens can be ‘bundled’ and sent in a single transaction. Any tokens can be bundled together, and token bundles can be used to organize tokens into particular data structures (i.e. fungible or non-fungible). You can read more about the practical implementation of token bundles here.

To send a native token on Cardano, some ada must be sent alongside it to cover the transaction fee. This fee is fundamentally different from Ethereum’s gas fees, as it is not a smart contract execution fee and it is not subject to the same network congestion considerations.

Instead, the transaction fee requires a ‘min-ada-value’ which changes according to how many tokens are included in a single output. The min-ada-value increases with an increased number of different tokens included in a transaction.

Native tokens can also be ‘redeemed’, which is the process of sending the tokens back to the issuer. There is no requirement to offer compensation for redeemed tokens, and this can be specified in the minting policy. Or, tokens can be burned (destroyed forever). Burning tokens could either be part of a buy-back event or when tokens no longer serve a purpose.

Ready to dive in? Start here

If you’re ready to begin exploring native tokens, we recommend you start with some of the simple token minting exercises contained within our documentation. These step-by-step exercises are a great way to learn the ropes before you mint your own native token on Cardano.

If you have completed the exercises or you feel comfortable taking on more challenging tasks, you can mint a new token to your own design through the Cardano CLI. We walk you through this process, alongside submitting a transaction and transferring tokens, here.

Finally, if you would just like to learn more about native tokens, multi-asset ledgers, the token builder, or minting a token, check out our multi-asset FAQs on Cardano Docs.

We look forward to seeing what types of tokens you build and deploy on Cardano!


Read more about native tokens and their use cases here:

12 Likes

Is there something more up to date than this, numerous links are broken e.g. https://developers.cardano.org/en/development-environments/native-tokens/multi-asset-tokens-explainer/.

What would be nice is a step by step of how to create your own NFT’s starting with a fresh node setup. Maybe someone could post a link.

Many thanks for any help.

Native tokens on the essential Cardano list and Creation of NFT - #29 by CubanLeo