TON Blockchain for Developers: Stars, USDT, TonConnect, and Telegram Payments
A technical deep-dive on TON integration in Telegram Mini Apps from The Open Squad's experience. Architecture, TonConnect, Jettons (USDT), Telegram Stars, escrow contracts, security.
TON Blockchain in 2026 isn't "Telegram fan crypto" — it's the infrastructure layer for the messenger's entire payments stack. At The Open Squad we integrated TON into every product: USDT payouts in The Open Earn, escrow smart contracts in The Open Guarantor. This guide is what we learned along the way.
Why TON for Telegram products
Alternatives:
- Stripe / PayPal — slow, expensive (3–5%), don't work for users in 50+ countries we serve
- Multi-chain crypto wallets — UX nightmare: users have to know networks, addresses, gas
- Internal balance with no withdrawal — users don't trust it
TON solves three problems at once:
- Low fees — fractions of a cent per transaction (vs $0.30+ on Stripe)
- Speed — finality in 5 seconds
- UX — TonConnect lets users link a wallet in two taps, no copying addresses
TON architecture in two minutes
TON is a sharded PoS blockchain. The native unit is TON. On top of it run:
- Jettons — token standard (the TON equivalent of ERC-20). USDT on TON is a Jetton issued by Tether
- NFTs — unique-token standard
- Workchains / Shardchains — shards for scaling
For developers this means:
- One SDK (
@ton/ton,@ton/core) handles both TON and Jettons - No multi-chain juggling
- A transaction is a message from one contract to another (everything is a contract, including wallets)
Connecting a wallet via TonConnect
TonConnect is an open-source protocol that links a dApp to a user's wallet. Every major TON wallet supports it: Tonkeeper, MyTonWallet, Tonhub.
In a Mini App it looks like this:
import { TonConnectUI } from "@tonconnect/ui";
const tonConnectUI = new TonConnectUI({
manifestUrl: "https://yourapp.com/tonconnect-manifest.json",
});
// Open the wallet picker modal
await tonConnectUI.openModal();
// After connection — wallet info available:
const wallet = tonConnectUI.wallet;
console.log(wallet?.account.address);
The manifest (tonconnect-manifest.json) is a static JSON with your app's metadata. Wallets read it to show your icon and name in the consent screen.
Receiving payments: TON and USDT
Scenario 1: receive TON. Generate a deposit address per user (via an HD-wallet sub-account). Listen for new transactions through a TON API:
from pytoniq import LiteClient
async def listen_deposits(address: str):
async with LiteClient.from_mainnet_config() as client:
txs = await client.get_transactions(address, count=10)
for tx in txs:
if tx.in_msg.value > 0:
process_deposit(user_id, tx.in_msg.value)
Scenario 2: receive USDT (Jetton). USDT is a Jetton contract. Every recipient has their own Jetton wallet (a separate address from their main TON wallet). You listen to transactions on the Jetton wallet, not the main one.
The simplest path: use a hosted TON Index API (Tonapi.io, TonCenter) with webhooks on incoming transfers.
Telegram Stars: Telegram's digital currency
Stars are Telegram's virtual currency (1 Star ≈ $0.013). Used to buy digital goods: subscriptions, custom emoji, themes, bot premium features.
Unlike TON, Stars can't be freely withdrawn — Telegram converts Stars to TON only for verified creators and with delay.
When to use Stars instead of TON:
- Paid content (articles, courses, bot premium features)
- In-app purchases (stickers, themes)
- Tips and donations
- App Store / Play Store compliance (Apple and Google require Stars for in-app digital purchases)
When TON directly is better:
- B2B payouts
- P2P escrow
- Larger amounts
- When users need free withdrawal
Smart contracts: escrow lessons from The Open Guarantor
The Open Guarantor is our bot for safe P2P deals on TON. The logic is simple:
- Buyer sends TON to the escrow contract
- The contract holds the funds until confirmation
- Buyer confirms receipt → contract pays the seller
- On dispute, an arbiter (us) decides
Contracts are written in FunC (TON's low-level language) or Tact (high-level). We use Tact:
contract Escrow {
buyer: Address;
seller: Address;
arbiter: Address;
amount: Int;
state: Int; // 0 = pending, 1 = released, 2 = refunded
receive("release") {
require(sender() == self.buyer, "only buyer");
require(self.state == 0, "already settled");
send(SendParameters{
to: self.seller,
value: self.amount,
mode: SendPayGasSeparately
});
self.state = 1;
}
// ... refund, dispute logic
}
Deploy with blueprint (TON DevKit). Test on testnet first, then mainnet.
Payment security checklist
What we put in place after our first incident:
- Validate every incoming amount — never trust the
valuefrom a transaction without checking - Reorg protection — wait 6+ blocks before crediting (≈30 seconds on TON)
- Hot/cold wallet split — keep only ~24 hours of payouts on the hot wallet, the rest in cold
- Hardware wallet for cold — Ledger or multisig
- Withdrawal rate limits — cap N withdrawals per minute per account
- Audit trail — every fund movement logged in DB with replication to S3 / Postgres replica
Operation costs
For unit economics:
- TON transaction — ~0.005 TON gas (≈$0.025 at $5/TON)
- Jetton (USDT) transaction — ~0.05 TON (≈$0.25)
- Smart contract deploy — one-off ~0.1 TON
If you process 1,000 USDT withdrawals per day, that's ~$250/day in gas. To cut it down:
- Batch withdrawals (multiple recipients in one transaction)
- Use TON directly instead of USDT for micro-amounts
What's next
TON is the most practical blockchain for Telegram-native products in 2026. If your product touches money, a TON integration takes 2–3 weeks and instantly gives you UX that classic payment gateways can't match.
If you want to see this running in production — check The Open Earn (USDT payouts) or The Open Guarantor (escrow contracts).