How to registry cardano token max supply on mainnet?

Hi all,
I have minted a token MyToken on mainnet, I want to implement max supply for MyToken , how can I do it ?
I tried creating a metadata.json

{
  "1": {
    "name": "MyToken",
    "symbol": "MT",
    "policy": "xxx",
    "decimals": 1,
    "max_supply": 2000000
  }
}

Build transaction and submit it successfully , but I’m not sure if it works.
I also found this project GitHub - cardano-foundation/cardano-token-registry
What is the correct way to do it? Please give me some advice, thank you very much.

1 Like

Neither the Cardano blockchain itself nor the Cardano Token Registry have a concept of “max supply”. It’s just not a thing.

What you usually do instead is minting exactly the number of tokens you want as “max supply” and use a policy that time locks afterwards, that does not allow minting (or burning) after a specific slot.

That way the public can be sure that the currently existing tokens are the maximum because they can see that the policy will never allow to mint additional tokens.

2 Likes

Would you please share me link to documentation of step by step doing this ?
I imagine I have to edit the policy.script file, then create a transaction and submit to add the policy to my token? But I don’t know how to do the detailed operations.
I’m following instruction at GitHub - cardano-foundation/cardano-token-registry to register my token metadata.

You can’t change the policy after the fact. The hash of the policy is the policy ID and part of the identity of the token.

A policy with time lock is shown at: https://developers.cardano.org/docs/native-tokens/minting-nfts#creating-the-policyid (That is the howto for NFTs, but there is no difference between FTs and NFTs in that aspect. If you include a time lock, you can only mint/burn/change the supply until that slot and your supply is fixed after that.)

The token registry is only for metadata, for information about your token. It does not enforce anything on-chain and has nothing to do with the policy.

1 Like

So If I followed this guide : Minting Native Assets | Cardano Developer Portal
I minted 2000000 tokens “MyToken” with policy as simple as
{
“keyHash”: “xxx”,
“type”: “sig”
}
Now I want to include a time lock , so “MyToken” cannot be minted/burn anymore , is it possible ? If it is , how can I do it ?

As said: You can’t for an already existing token! The policy is fixed for eternity after you have created it. I do not know how I can state that more explicitly.

If you do a new token in the future, include a time lock:

{
  "type": "all",
  "scripts":
  [
    {
      "type": "before",
      "slot": <insert slot here>
    },
    {
      "type": "sig",
      "keyHash": "insert keyHash here"
    }
  ]
}
1 Like

Hi @HeptaSean ,
What if I still keep policy.skey , policy.vkey ?

  • Can I burn out all 2000000 tokens “MyToken”
  • Edit policy.script → generate policyid again
    cardano-cli transaction policyid --script-file ./policy/policy.script > policy/policyID
  • Mint 2000000 tokens “MyToken” again ?

If you burn and mint again with another policy, it will be a completely new token with a new asset fingerprint, a new registration in the Cardano Token Registry, and all.

You can do everything you want then. You can keep the same key pair or use a new one. That is totally up to you.

So, yeah, that process should work.

1 Like

@HeptaSean thank you very much.

As already stated in the first answer in this topic, the Token Registry does not even have a field to specify the maximal supply. And if it had, it would have no way to enforce this supply on chain. The proper way is to use a minting/burning policy that is locked after minting the fixed supply.

More complicated monetary policies can be implemented with Plutus contracts.