Mint Tokens
Once you have created a foundry, you can mint native tokens. You only need to transition the foundry in a transaction, declare that you mint tokens and place them in an output of our choice.
Tokens controlled by a foundry have a globally unique identifier called Token ID that is derived from the properties of the foundry. To get the Token ID, you have to concatenate:
- The serialized Alias Address that controls the foundry (33 bytes).
- The Serial Number of the foundry.
- The Token Scheme Type.
By knowing the Token ID, you can fetch current unspent foundry outputs from the Indexer API defined in TIP-26.
Example Transaction
Transaction B mints all the available tokens in the foundry.
- Minted Tokens in Foundry Output #2 is increased by the number of minted tokens, namely 1000.
- 500 tokens are minted into Basic Output #1 and locked to mintAddress.
- 500 tokens are minted into Basic Output #2 and locked to vestAddress. Additionally, a timelock is specified on the output so that these token can only be unlocked after May 24 2023 18:00:00.
Related Tutorials
- iota.js
Related How-to Guides
- wallet.rs