Features

SPL Token-2022 on Token Metadata

SPL Token-2022 is the latest token program on the Solana blockchain that can be used to create fungible and non-fungible tokens. It supports the same functionalities and structures of the SPL Token program, but also includes a set of extensions to add new functionalities.

In order to support adding metadata information to Token-2022 mint accounts, a set of Token Metadata instructions have been updated to allow specified the desired token program. For example, Token Metadata can initialize a Token-2022 mint, create metadata and mint tokens using the Create and Mint instructions and specifying the SPL Token-2022 as the token program to use.

Specifying token program on Create and Mint

The token program of a mint account can be determined by checking the owner property of the account.

A similar approach can be used for other instructions, such as Burn, Delegate, Lock, Print, Revoke, Transfer, Unlock, Unverify, Updateand Verify. These instruction can validate mint and token accounts from SPL Token-2022. The corresponding token program must be used in any instruction requiring a token program (e.g., Delegate): if the mint and token account are from Token-2022, then the Delegate instruction will validate that the correct token program has been specified.

By default, Create and Mint will create SPL Token mint and token accounts if these accounts do not exist. To use Token-2022 accounts, you need to specify SPL Token-2022 as the token program to use.

Supported Extensions

While Token-2022 provides several extensions, the majority of extensions focus on fungible tokens. For example, the confidential transfer can be used to hide the amount of tokens transferred. While this is relevant for fungibles, since the amount can vary across different transfers, it is not applicable to non-fungible tokens since their supply is always 1 and decimals is always 0. Hence, the transfer amount of a non-fungible token will always be 1.

Token Metadata enforces restrictions on the type of extensions that can be present on mint and token accounts based on the Token Standard. For fungible assets (Fungible and FungibleAsset standards), no restrictions are placed – the only restriction is on the program providing the metadata information. For non-fungible assets (NonFungible and ProgrammableNonFungible standards), Token Metadata validates which extensions are enabled and restricts the set of extensions that can be used.

Mint account extensions

These are extensions that can be enabled on mint accounts of SPL Token-2022.

  • confidential transfers: hides the amount during transfers.

    Asset Fungible Non-Fungible
    Allowed

    Details

    --

    Not applicable since non-fungibles have supply of 1

Previous
NFT Escrow