Skip to content

​In short

Optional features of the Token-2022 program, such as metadata, pausing, default-frozen accounts, and transfer hooks, switched on per mint. Most must be chosen when the mint is created.
You’ve used this in: Tokenized asset Step 2

​What are Token Extensions?

The Token Extensions Program (Token 2022) provides more features through extra instructions referred to as extensions. Extensions are optional features you can add to a token mint or token account. You can find the implementation of these extension instructions in the Token Extensions Program source code. Each extension adds specific state that’s generally initialized during mint or token account creation. When initializing either account, you can enable specific extensions simultaneously for different functionality. Most extensions can’t be added after an account is initialized. This is an important consideration when designing your token, as you’ll need to plan ahead for which features you want your token to support. The pages in this section describe each extension and how to integrate it.
Some extensions can’t be combined on the same mint, and some require another. Mint initialization fails with InvalidExtensionCombination (0x33) when:
  • ScaledUiAmount and InterestBearingConfig are both present (each changes how the UI amount is calculated).
  • TransferFeeConfig and ConfidentialTransferMint are present without ConfidentialTransferFeeConfig, or ConfidentialTransferFeeConfig is present without both of them.
  • ConfidentialMintBurn is present without ConfidentialTransferMint.
  • NonTransferable and ConfidentialTransferMint are present without ConfidentialMintBurn.
The rules are in check_for_invalid_mint_extension_combinations.
The Token Extensions Program defines an ExtensionType enum that lists all available extensions you can add to a token mint or token account. Each variant represents a different extension with unique functionality. The ExtensionType enum is defined as follows (Token-2022 program@v11.1.0):
Token Extensions
Each extension adds specialized functionality by including extra state to a mint or token account. All extension specific state is stored in the tlv_data field, which follows the base account data type. You must further deserialize the tlv_data (containing extension state) according to the specific extension types enabled for that account.
Token Extensions