Skip to content

​What Does Freezing a Token Account Do?

Freezing a token account keeps the same owner, mint, and balance, but prevents the token account from receiving, transferring, or burning tokens until the token account is thawed. A frozen account can still be closed if the frozen account has a zero token balance. Only a mint that still has a freeze authority can freeze token accounts. If a mint’s freeze authority is revoked, accounts for that mint can no longer be frozen.

​How to Freeze a Token Account

Freezing a token account uses the Token Program’s FreezeAccount instruction. The FreezeAccount instruction verifies that the token account belongs to the mint and that the signer is the mint’s freeze authority, then changes the token account state from initialized to frozen. Native token accounts do not support freezing.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
MintThe mint state stores the optional freeze authority used to freeze token accounts.SourceSource
AccountStateThe token account states, including Initialized and Frozen.SourceSource
FreezeAccountAn instruction that changes a token account into the frozen state.SourceSource
process_toggle_freeze_accountShared processor logic for freezing and thawing token accounts.SourceSource

​Kit

These examples use @solana/kit.

​Web3.js v3

These examples use the class-based @solana/web3.js v3 API with @solana-program instruction builders.
Instructions

​Rust

Add these dependencies to Cargo.toml (tested with Rust 1.89 and 1.98):
Cargo.toml
Rust

​Python

This example uses solana (solana-py) 0.41 and solders:
Terminal
Python

​Web3.js (legacy)

These examples use legacy @solana/web3.js 1.x with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.