Token-2022 (Token Extensions)
Program address: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
import { TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';Token-2022 extends the base Token program with configurable extensions. For a full guide to available extensions and their use cases, see the Token Extensions documentation.
For stablecoins, tokenized securities, or allowlisted tokens with sRFC-37 compliance, Mosaic packages the extension set and authority wiring as templates. Check its Kit-version caveats in mosaic.md first.
When to Use Token-2022 vs Token
| Use Token-2022 | Use Token |
|---|---|
| Transfer fees needed | Simple fungible tokens |
| On-chain metadata | Maximum compatibility |
| Confidential transfers | Lowest compute cost |
| Transfer hooks | Existing ecosystem integration |
| Interest-bearing tokens | |
| Non-transferable tokens |
Key Differences from Base Token
Variable Account Sizes
Unlike base Token (fixed 82/165 byte accounts), Token-2022 sizes vary by extension. Calculate before creating or rent allocation fails:
import { getMintSize, getTokenSize } from '@solana-program/token-2022';
// Without extensions
const baseSize = getMintSize(); // 82 bytes
// With extensions - pass extension configs
const sizeWithExtensions = getMintSize([
{ extension: 'TransferFeeConfig', ... },
{ extension: 'MetadataPointer', ... },
]);ATA Derivation
Same pattern as base Token, but you must pass TOKEN_2022_PROGRAM_ADDRESS — using the wrong program address derives the wrong ATA.
import { findAssociatedTokenPda, TOKEN_2022_PROGRAM_ADDRESS } from '@solana-program/token-2022';
const [ata] = await findAssociatedTokenPda({
owner: walletAddress,
mint: mintAddress,
tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
});Extension Initialization Order
Most extension instructions must come before InitializeMint. TokenMetadata, TokenGroup and TokenGroupMember come after it. See tokens.md for the full order and sizing rules.
Account Fetching
Same patterns as base Token — extensions are accessible via mint.data.extensions:
import { fetchMint, fetchToken } from '@solana-program/token-2022';
const mint = await fetchMint(rpc, mintAddress);
// Access extensions via mint.data.extensionsExtensions Reference
See Token Extensions documentation for implementation details on each extension.