Jettons are the standard for fungible tokens on The Open Network (TON), functioning similarly to ERC-20 tokens on Ethereum. Built on a sharded blockchain architecture, TON’s implementation of Jettons offers unique performance and scalability advantages. Whether you're building a decentralized application (dApp), exchange, or wallet service, understanding how to properly handle Jetton minting, transfers, deposits, and withdrawals is essential.
This comprehensive guide walks through Jetton architecture, best practices for secure processing, and practical implementation strategies—ensuring your integration aligns with ecosystem standards and user expectations.
Understanding Jetton Architecture
At its core, each Jetton is powered by two smart contracts:
- Jetton Master (Token Minter): Manages token metadata, total supply, and minting logic.
- Jetton Wallet: Holds user balances and enables sending, receiving, and burning of tokens.
These contracts work together seamlessly across TON’s high-performance blockchain. Unlike traditional models, TON transactions achieve finality in just one confirmation—making real-time processing both feasible and efficient.
👉 Discover powerful tools to test and deploy your Jetton integrations today.
Jetton Master Contract: Core Data & Security
The Jetton Master contract stores critical information about the token:
total_supply: Total tokens issued in base units.mintable: Indicates whether new tokens can be created (-1= yes,0= no).admin_address: Owner capable of managing the contract.jetton_content: Metadata (name, symbol, image) stored off-chain or on-chain.jetton_wallet_code: Blueprint for user wallets.
Retrieving Jetton Data
Use the get_jetton_data() method to fetch token details programmatically. Alternatively, leverage APIs like Toncenter API or SDKs such as:
- JavaScript:
tonweb,ton-core - Go:
tonutils-go,tongo - Python:
pytonlib
Example using tonweb:
import TonWeb from "tonweb";
const tonweb = new TonWeb();
const jettonMinter = new TonWeb.token.jetton.JettonMinter(tonweb.provider, {
address: "EQ..."
});
const data = await jettonMinter.getJettonData();
console.log('Total supply:', data.totalSupply.toString());
console.log('Metadata URI:', data.jettonContentUri);🔐 Security Tip: Always verify the original Jetton Master address via trusted sources (e.g., official project channels or Tonkeeper's asset list) to avoid scams. Fraudulent Jettons may mimic TON transfers or system messages with fake symbols like "TON" or names resembling "ERROR."
Jetton Wallets: User Balances & Deployment
Each user has a Jetton Wallet per token type. This contract holds their balance and handles transfers.
Automatic Wallet Deployment
Users don’t need to pre-deploy a Jetton Wallet. When someone sends Jettons, the sender covers gas fees, and the recipient’s wallet deploys automatically if it doesn’t exist—streamlining onboarding.
Retrieving a User’s Jetton Wallet Address
Given a user’s TON wallet address (owner_address), use the master contract’s get_wallet_address(slice owner_address) method to compute their Jetton Wallet address.
✅ Always confirm that the retrieved wallet belongs to the correct Jetton Master to prevent spoofing attacks.
Message Flow in Jetton Transfers
Understanding message flow ensures accurate transaction parsing.
Message 0: Transfer Initiation
Sent from sender to their own Jetton Wallet:
amount: Number of Jettons to send.destination: Recipient’s wallet address.forward_ton_amount: Must be >0 (e.g., 1 nanoton) to trigger a notification.forward_payload: Optional comment (UTF-8 text prefixed with0x00000000).
Message 2': Transfer Notification
Triggered only if forward_ton_amount > 0. Sent from recipient’s Jetton Wallet to recipient:
- Contains
query_id,amount,sender, andforward_payload.
Message 2'': Excess TON Return
If extra TON remains after gas costs, this message returns it to the response_destination.
⚠️ Common error:709(insufficient TON). Ensure attached TON exceedsTRANSFER_CONSUMPTION + forward_ton_amount(typically >0.04 TON). Also watch forcskip_no_gas, indicating successful transfer but no follow-up execution.
Processing Jetton Deposits
There are two primary models for receiving deposits:
1. Centralized Wallet with Memo
Users send Jettons to a shared address with a unique memo (identifier).
Pros: Simple setup; no upfront deployment cost.
Cons: High risk of user errors (missing/wrong memo); increases support load.
👉 Build robust deposit systems with reliable infrastructure support.
2. Unique Deposit Addresses (Memo-less)
Each user gets a dedicated deposit address via subwallet derivation (using different subwallet_id). No memo needed.
Pros: Eliminates user error; improves UX.
Cons: Requires monitoring multiple addresses and batch withdrawals.
Use tools like bicycle for automated management of non-custodial deposit flows.
Handling Withdrawals Efficiently
For fast, low-cost withdrawals:
- Use Highload Wallet v3—the gold standard for batch processing.
- Bundle multiple withdrawal requests into a single transaction to reduce fees.
- Set
forward_ton_amount = 1 nanotonto ensure standard-compliant notifications.
Withdrawal Processing Steps:
- Validate token type and sufficient balance.
- Generate transfer message with correct payload.
- Batch process outgoing transfers using Highload Wallet.
- Track outgoing transactions via
query_id. - Confirm success using
Excess 0xd53276dborTransfer Notification.
Always set an expiration time and retry logic for failed messages.
Chain vs Off-Chain Processing
Off-Chain (Recommended for dApps & Exchanges)
Monitor blockchain events externally:
- Parse incoming messages for
op=0x7362d09c. - Verify sender, amount, and memo.
- Cross-check Jetton Master authenticity.
On-Chain (For DeFi Protocols)
Smart contracts must:
- Interact directly with known Jetton Wallets—not just any wallet linked to a master.
- Validate bidirectional links between wallet and master.
- Handle custom payloads for composable DeFi use cases (e.g., swap + stake).
- Avoid creating multiple internal wallets to reduce attack surface.
🧩 Best Practice: Treat Jettons as indivisible units at the contract level. Decimal handling should remain a UI concern only.
Security Best Practices
- Verify Authenticity: Always cross-check Jetton Master addresses before displaying tokens.
- Reject Unknown Tokens: Prompt users when receiving unrecognized Jettons; allow manual approval.
- Prevent Spoofing: Clearly display token origin in UI; distinguish from system messages.
- Enable Removal: Let users hide suspicious or unwanted Jettons in wallet interfaces.
- Audit Contracts: Use secure coding practices in FunC; handle all exceptions properly.
Frequently Asked Questions (FAQ)
Q: How do I detect a fake Jetton?
A: Verify the Jetton Master address through official channels or trusted lists like Tonkeeper’s. Check for mismatches between displayed name/symbol and actual contract origin.
Q: Why isn’t my transfer triggering a notification?
A: Ensure forward_ton_amount > 0 (recommended: 1 nanoton). Without it, no transfer notification is sent.
Q: Can I receive Jettons without deploying a wallet first?
A: Yes! The sender pays gas fees, and the wallet deploys automatically upon receipt.
Q: What causes error code 709?
A: Insufficient TON attached to cover processing costs. Attach at least 0.05 TON as buffer when transferring.
Q: Should I use memos or unique deposit addresses?
A: Unique addresses improve UX and reduce errors but require more complex backend logic. Memos are simpler but error-prone.
Q: How do I safely process unknown incoming Jettons?
A: Extract the Jetton Master from the sender’s wallet, validate ownership, retrieve metadata, and warn users if red flags appear.
Final Thoughts
Handling Jettons securely and efficiently requires attention to detail—from verifying contract authenticity to optimizing gas usage during transfers. Whether you're building a centralized exchange or a decentralized finance protocol, following these best practices ensures compatibility, safety, and smooth user experiences on The Open Network.
As TON continues to grow, robust asset handling will become increasingly vital. Stay updated with official documentation, leverage trusted SDKs, and prioritize security at every step.
👉 Accelerate your TON development journey with advanced tools and resources.