thru-cli token command provides comprehensive token management functionality, including minting, transfers, account management, and administrative operations.
Prerequisites
- CLI setup with configured keys and RPC endpoint
Command Overview
Initialize Mint
Create a new token with specified properties
Initialize Account
Create token accounts for holding tokens
Transfer
Move tokens between accounts
Mint To
Create new tokens and add to account
Burn
Permanently destroy tokens
Close Account
Close token accounts and reclaim balance
Freeze Account
Freeze accounts to prevent transfers
Thaw Account
Unfreeze previously frozen accounts
Derive Mint Account
Calculate mint account address from authority and seed
Derive Token Account
Calculate token account address from mint, owner, and seed
Initialize Mint
Create a new mint account on the blockchain and initialize it as a token mint with specified properties.Address that can mint new tokens. Use key name from configuration file or full address.
Token symbol, maximum 8 characters (e.g., βUSDCβ, βETHβ)
32-byte hex string for deterministic mint address derivation
Optional hex-encoded state proof for mint account creation. If not provided, the state proof is automatically generated.
Address that can freeze/unfreeze token accounts (optional)
Number of decimal places for token precision (0-18)
Account to pay transaction fees
On success, the mint is created and can be used for token operations
Initialize Account
Create a new token account on the blockchain that can hold tokens from a specific mint.Address Derivation: Token account addresses are automatically derived using SHA256(owner + mint + user_seed), creating a unique address for each mint and owner combination. You can verify the derived address using
derive-token-account.The mint address for which to create an account
Address that will own and control this token account
32-byte hex string for deterministic account address derivation. This seed is hashed with the owner and mint to create the final token account address.
Optional hex-encoded state proof for token account creation. If not provided, the state proof is automatically generated.
Account to pay transaction fees
Transfer
Transfer tokens between two token accounts. Both accounts must be associated with the same mint, and neither account can be frozen. The fee payer must be the owner of the source token account to authorize the transfer.Source token account address
Destination token account address
Amount to transfer (in smallest token units)
Account to pay transaction fees (must be the owner of the source token account)
Mint To
Mint new tokens directly to a token account. The destination account must be associated with the specified mint and cannot be frozen. Only the designated mint authority can perform this operation.The mint address from which to create new tokens
Destination token account to receive the minted tokens
Mint authority address (must match the mintβs authority)
Amount to mint (in smallest token units)
Account to pay transaction fees
Only the designated mint authority can mint new tokens
Burn
Permanently destroy tokens from an account. The account must be associated with the specified mint and cannot be frozen. Only the account owner can perform this operation.Token account containing tokens to burn
The mint address of the tokens being burned
Account owner address (must be the owner of the token account being burned)
Amount to burn (in smallest token units)
Account to pay transaction fees
Close Account
Close a token account and transfer any remaining balance. The account must have a zero balance before closing. Only the account owner can perform this operation.Token account to close
Account to receive any remaining token balance
Account owner address (must be the owner of the token account being closed)
Account to pay transaction fees
Freeze Account
Freeze a token account to prevent transfers. The account must be associated with the specified mint. Only the mintβs freeze authority can perform this operation, and the mint must have freeze authority enabled.Token account to freeze
The mint address associated with the account
Freeze authority address (must match the mintβs freeze authority)
Account to pay transaction fees
Frozen accounts cannot send or receive tokens until unfrozen
Thaw Account
Unfreeze a previously frozen token account. The account must be associated with the specified mint. Only the mintβs freeze authority can perform this operation, and the mint must have freeze authority enabled.Token account to unfreeze
The mint address associated with the account
Freeze authority address (must match the mintβs freeze authority)
Account to pay transaction fees
After thawing, the account can participate in transfers normally
Derive Mint Account Address
Calculate the deterministic mint account address that would be created for a given mint authority and seed combination. Use this to predict the mint address before callinginitialize-mint.
Address Derivation: Mint account addresses are derived using SHA256(mint_authority + seed), then used with the token program for final PDA derivation. This ensures each mint authority can create unique mints with different seeds.
Mint authority address
Seed for derivation (32 bytes hex, 64 hex characters)
Returns the calculated mint account address that will be used when creating the mint
Derive Token Account Address
Calculate the deterministic token account address that would be created for a given mint, owner, and seed combination. Use this to predict token account addresses before callinginitialize-account.
Mint account address
Account owner address
Seed for derivation (32 bytes hex, optional - defaults to all zeros)
Returns the calculated token account address that can be used with other commands
Address Formula: The derived address is calculated as SHA256(owner + mint + seed), then used with the token program as the owner for final PDA derivation. This ensures unique addresses for each combination.
Common Usage Patterns
Initialize a Token Mint
1
(Optional) Verify the mint address
You can optionally verify the mint account address that will be created:Where:
- First argument: mint authority address
- Second argument: seed for mint derivation (save this securely!)
The seed is crucial - save it securely as youβll need it for creating the mint
2
Initialize the mint
Create the mint account - the address and state proof are automatically derived:Where:
- First argument: mint authority address
- Second argument: token symbol/ticker
- Third argument: seed for deterministic address derivation
The command automatically derives the mint address and generates the required state proof
Initialize a Token Account
Creating a token account is now simplified with automatic address and state proof derivation:1
(Optional) Verify the token account address
You can optionally verify the token account address that will be created:Where:
- First argument: mint address (from the mint initialization)
- Second argument: account owner address
--seed: unique seed for this token account (save this!)
2
Initialize the token account
Create the token account - the address and state proof are automatically derived:Where:
- First argument: mint address
- Second argument: account owner address
- Third argument: seed for deterministic address derivation
The command automatically derives the token account address and generates the required state proof