Skip to main content
The thru-cli token command provides comprehensive token management functionality, including minting, transfers, account management, and administrative operations.
Transaction Fees: Currently all transaction fees are set to 0. Transaction fees will be implemented and charged in future releases.

Prerequisites

  • CLI setup with configured keys and RPC endpoint
State Proof Requirement: Both initialize-mint and initialize-account commands require a hex-encoded state proof for transaction validation. This proof verifies the account creation operation with the blockchain state.

Command Overview

Initialize Mint

Create a new mint account on the blockchain and initialize it as a token mint with specified properties. This command creates the actual account using the provided seed and sets up all the mint data.
thru-cli token initialize-mint <mint_authority> <ticker> <seed> <state_proof> [OPTIONS]
mint_authority
string
required
Address that can mint new tokens. Use key name from configuration file or full address.
ticker
string
required
Token symbol, maximum 8 characters (e.g., “USDC”, “ETH”)
seed
string
required
32-byte hex string for deterministic mint address derivation
state_proof
string
required
Hex-encoded state proof for mint account creation. Required for transaction validation by the token program.
--freeze-authority
string
Address that can freeze/unfreeze token accounts (optional)
--decimals
integer
default:"9"
Number of decimal places for token precision (0-18)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token initialize-mint \
  ta9876543210fedcba9876543210fedcba98765432 \
  GOLD \
  0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
  a1b2c3d4e5f6789...
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. This command creates the actual account using the provided seed and initializes it with the specified mint and owner.
Address Derivation: Token account addresses are derived using SHA256(owner + mint + user_seed), creating a unique address for each mint and owner combination. Use derive-token-account to calculate the address before creating the account.
thru-cli token initialize-account <mint> <owner> <seed> <state_proof> [OPTIONS]
mint
string
required
The mint address for which to create an account
owner
string
required
Address that will own and control this token account
seed
string
required
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.
state_proof
string
required
Hex-encoded state proof for token account creation. Required for transaction validation by the token program.
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token initialize-account \
  ta1234567890abcdef1234567890abcdef12345678 \
  ta9876543210fedcba9876543210fedcba98765432 \
  fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
  f9e8d7c6b5a4321...
First use derive-token-account to calculate the expected address, then use that information when creating the account

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 calling initialize-mint.
Mint vs Token Account: This command derives the address for a mint account (the token definition itself). To derive the address for a token account (which holds token balances), use derive-token-account instead.
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.
thru-cli token derive-mint-account <mint_authority> <seed>
mint_authority
string
required
Mint authority address
seed
string
required
Seed for derivation (32 bytes hex, 64 hex characters)
Example:
thru-cli token derive-mint-account \
  ta9876543210fedcba9876543210fedcba98765432 \
  0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
Returns the calculated mint account address that will be used when creating the mint
Use this command before running initialize-mint to know the mint address that will be created

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 calling initialize-account.
Token vs Mint Account: This command derives the address for a token account (which holds token balances for an owner). To derive the address for a mint account (the token definition itself), use derive-mint-account instead.
thru-cli token derive-token-account <mint> <owner> [OPTIONS]
mint
string
required
Mint account address
owner
string
required
Account owner address
--seed
string
Seed for derivation (32 bytes hex, optional - defaults to all zeros)
Example:
thru-cli token derive-token-account \
  ta1234567890abcdef1234567890abcdef12345678 \
  ta9876543210fedcba9876543210fedcba98765432
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.

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.
thru-cli token transfer <from> <to> <amount> [OPTIONS]
from
string
required
Source token account address
to
string
required
Destination token account address
amount
integer
required
Amount to transfer (in smallest token units)
--fee-payer
string
default:"default"
Account to pay transaction fees (must be the owner of the source token account)
Example:
thru-cli token transfer \
  ta1111111111111111111111111111111111111111 \
  ta2222222222222222222222222222222222222222 \
  1000000
The amount is specified in the smallest token units. For a token with 9 decimals, 1000000000 represents 1.0 tokens

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.
thru-cli token mint-to <mint> <to> <authority> <amount> [OPTIONS]
mint
string
required
The mint address from which to create new tokens
to
string
required
Destination token account to receive the minted tokens
authority
string
required
Mint authority address (must match the mint’s authority)
amount
integer
required
Amount to mint (in smallest token units)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token mint-to \
  ta1234567890abcdef1234567890abcdef12345678 \
  ta9999999999999999999999999999999999999999 \
  alice \
  5000000000
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.
thru-cli token burn <account> <mint> <authority> <amount> [OPTIONS]
account
string
required
Token account containing tokens to burn
mint
string
required
The mint address of the tokens being burned
authority
string
required
Account owner address (must be the owner of the token account being burned)
amount
integer
required
Amount to burn (in smallest token units)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token burn \
  ta9999999999999999999999999999999999999999 \
  ta1234567890abcdef1234567890abcdef12345678 \
  alice \
  1000000
Burned tokens are permanently destroyed and cannot be recovered

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.
thru-cli token close-account <account> <destination> <authority> [OPTIONS]
account
string
required
Token account to close
destination
string
required
Account to receive any remaining token balance
authority
string
required
Account owner address (must be the owner of the token account being closed)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token close-account \
  ta9999999999999999999999999999999999999999 \
  ta8888888888888888888888888888888888888888 \
  alice
The account must have exactly zero tokens before it can be closed

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.
thru-cli token freeze-account <account> <mint> <authority> [OPTIONS]
account
string
required
Token account to freeze
mint
string
required
The mint address associated with the account
authority
string
required
Freeze authority address (must match the mint’s freeze authority)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token freeze-account \
  ta9999999999999999999999999999999999999999 \
  ta1234567890abcdef1234567890abcdef12345678 \
  freeze_authority
This operation will fail if the mint does not have freeze authority enabled during mint creation
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.
thru-cli token thaw-account <account> <mint> <authority> [OPTIONS]
account
string
required
Token account to unfreeze
mint
string
required
The mint address associated with the account
authority
string
required
Freeze authority address (must match the mint’s freeze authority)
--fee-payer
string
default:"default"
Account to pay transaction fees
Example:
thru-cli token thaw-account \
  ta9999999999999999999999999999999999999999 \
  ta1234567890abcdef1234567890abcdef12345678 \
  freeze_authority
This operation will fail if the mint does not have freeze authority enabled during mint creation
After thawing, the account can participate in transfers normally

Common Usage Patterns

Initialize a Token Mint

Complete workflow for creating a new token mint with all required steps:
1

Derive the mint address

Calculate the mint account address that will be created:
thru-cli token derive-mint-account \
  ta9876543210fedcba9876543210fedcba98765432 \
  0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
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

Create the state proof

Generate a state proof for creating the mint account:
thru-cli txn make-state-proof creating ta1234567890abcdef1234567890abcdef12345678
Replace ta1234567890abcdef1234567890abcdef12345678 with the address from step 1.
3

Initialize the mint

Create the mint account with the derived address and state proof:
thru-cli token initialize-mint \
  ta9876543210fedcba9876543210fedcba98765432 \
  MYTOKEN \
  0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
  a1b2c3d4e5f6789012345... \
  --freeze-authority ta5555444433332222111100009999888877776666 \
  --decimals 6
Where:
  • First argument: mint authority address
  • Second argument: token symbol/ticker
  • Third argument: the same seed used in step 1
  • Fourth argument: state proof from step 2

Initialize a Token Account

Complete workflow for creating a token account to hold tokens:
1

Derive the token account address

Calculate where the token account will be created:
thru-cli token derive-token-account \
  ta1234567890abcdef1234567890abcdef12345678 \
  ta9876543210fedcba9876543210fedcba98765432 \
  --seed fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210
Where:
  • First argument: mint address (from the mint initialization)
  • Second argument: account owner address
  • --seed: unique seed for this token account (save this!)
2

Create the state proof

Generate a state proof for creating the token account:
thru-cli txn make-state-proof creating ta8888777766665555444433332222111100009999
Replace ta8888777766665555444433332222111100009999 with the address from step 1.
3

Initialize the token account

Create the token account using the derived address and state proof:
thru-cli token initialize-account \
  ta1234567890abcdef1234567890abcdef12345678 \
  ta9876543210fedcba9876543210fedcba98765432 \
  fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
  f9e8d7c6b5a43210987654321...
Where:
  • First argument: mint address
  • Second argument: account owner address
  • Third argument: the same seed used in step 1
  • Fourth argument: state proof from step 2

Best Practices

Seed Management: Store seeds securely and use deterministic generation for reproducible addresses
Authority Management: Use dedicated key management for mint and freeze authorities
Security: Never share private keys or store them in plain text. Use the CLI’s key management system