Skip to content

​What Does Transferring Tokens Do?

Transferring tokens moves tokens from one token account to another token account for the same mint. Transfers do not change the mint supply. Transfers only update balances between token accounts.

​How to Transfer Tokens

Transferring tokens uses the Token Program’s Transfer or TransferChecked instruction. The examples below use TransferChecked, which requires the caller to provide the mint and decimals so the instruction can verify the expected mint and token precision before moving tokens between accounts. In the Token Extension Program, Transfer is deprecated in favor of TransferChecked or TransferCheckedWithFee. The source account owner or an approved delegate signs the transfer. In the Token Extension Program, a mint permanent delegate can also authorize the transfer if the mint has the permanent delegate extension enabled.

​Source Reference

ItemDescriptionToken ProgramToken Extension Program
AccountThe token account state stores the balances updated by a transfer.SourceSource
TransferA transfer instruction that moves tokens between token accounts without requiring the caller to provide the mint or decimals. In the Token Extension Program, use TransferChecked instead.SourceSource
TransferCheckedA transfer instruction that requires the caller to provide the mint and decimals and checks those values before moving tokens between token accounts of the same mint.SourceSource
process_transferShared processor logic for token transfers.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.

​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.