[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"article-building-on-ton-2026-crypto-payments-telegram-mini-apps-ton-pay-sdk":3},{"article":4,"author":55},{"id":5,"category_id":6,"title":7,"slug":8,"excerpt":9,"content_md":10,"content_html":11,"locale":12,"author_id":13,"published":14,"published_at":15,"meta_title":16,"meta_description":17,"focus_keyword":18,"og_image":19,"canonical_url":19,"robots_meta":20,"created_at":15,"updated_at":15,"tags":21,"category_name":29,"related_articles":35},"de000000-0000-0000-0000-000000000001","a0000000-0000-0000-0000-000000000004","Building on TON in 2026: Crypto Payments in Telegram Mini Apps with TON Pay SDK","building-on-ton-2026-crypto-payments-telegram-mini-apps-ton-pay-sdk","The TON ecosystem has grown to 500M+ monthly active Mini App users, 3600+ apps, and 400M+ wallets. This guide walks through integrating TON Pay SDK for crypto payments in Telegram Mini Apps, from wallet authentication to Jetton transfers.","## The TON Ecosystem in 2026\n\nThe Open Network (TON) has evolved from a blockchain project with Telegram roots into one of the most actively used cryptocurrency ecosystems in the world. As of March 2026, the numbers tell a compelling story:\n\n- **500M+ monthly active users** across Telegram Mini Apps\n- **3,600+ live Mini Apps** listed in the Telegram Mini App catalog\n- **400M+ TON wallets** created through Telegram Wallet, Tonkeeper, and TON Space\n- **$4.2B total value locked** in TON DeFi protocols\n- **12M daily on-chain transactions** on the TON mainnet\n\nThese figures make TON the most widely distributed blockchain by active user count, surpassing Ethereum (including L2s) and Solana. The growth is driven by a single factor: **Telegram integration**. With 950M+ monthly active Telegram users worldwide, even a small conversion rate into Mini App and wallet usage produces massive numbers.\n\n### Why TON for Payments?\n\nFor developers building payment-enabled applications, TON offers three structural advantages over other blockchains:\n\n1. **Distribution** — Your Mini App is discoverable inside Telegram, the messaging platform your users already use daily. No app store submission, no download friction, no wallet installation required.\n2. **Near-zero fees** — TON transaction fees average $0.005-0.01, making micropayments and in-app purchases economically viable without batching or L2 complexity.\n3. **Sub-second finality** — TON's sharded architecture achieves block times of ~5 seconds with practical finality in 1-2 blocks. Users see confirmed payments within 10 seconds.\n\n## TON Pay SDK: Architecture Overview\n\nTON Pay SDK is the official payment integration library for Telegram Mini Apps. Released in Q4 2025, it provides a unified API for:\n\n- **TON Connect** wallet authentication\n- **Toncoin payments** (native TON transfers)\n- **Jetton payments** (TRC-20 token standard — USDT, NOT, and custom tokens)\n- **Subscription billing** (recurring Jetton charges via pre-authorized smart contracts)\n- **Payment receipts** (on-chain proof of payment with metadata)\n\nThe SDK is available as an npm package (`@tonconnect\u002Fpay-sdk`) and supports both client-side (browser) and server-side (Node.js) usage.\n\n### Prerequisites\n\nBefore integrating TON Pay SDK, ensure you have:\n\n1. A registered Telegram Bot with Mini App capabilities (`@BotFather` → `\u002Fnewapp`)\n2. A TON wallet address for receiving payments (merchant wallet)\n3. Node.js 20+ and TypeScript 5.x for the development environment\n4. Basic familiarity with the Telegram Mini App API (`window.Telegram.WebApp`)\n\n## Step 1: TON Connect Wallet Authentication\n\nTON Connect is the standard protocol for connecting TON wallets to dApps and Mini Apps. It serves as the authentication layer — before accepting payments, you need to know which wallet the user wants to pay from.\n\n### Setting Up TON Connect\n\n```typescript\nimport { TonConnect } from \"@tonconnect\u002Fsdk\";\nimport { TonPaySDK } from \"@tonconnect\u002Fpay-sdk\";\n\n\u002F\u002F Initialize TON Connect with your manifest\nconst tonConnect = new TonConnect({\n  manifestUrl: \"https:\u002F\u002Fyourapp.com\u002Ftonconnect-manifest.json\",\n});\n\n\u002F\u002F The manifest describes your Mini App to wallets\n\u002F\u002F Host this JSON at your domain:\n\u002F\u002F {\n\u002F\u002F   \"url\": \"https:\u002F\u002Fyourapp.com\",\n\u002F\u002F   \"name\": \"Your Mini App\",\n\u002F\u002F   \"iconUrl\": \"https:\u002F\u002Fyourapp.com\u002Ficon.png\"\n\u002F\u002F }\n\n\u002F\u002F Check if user has a previously connected wallet\nconst existingWallet = tonConnect.wallet;\nif (existingWallet) {\n  console.log(\"Connected:\", existingWallet.account.address);\n}\n```\n\n### Wallet Connection Flow\n\nThe wallet connection flow differs depending on the user's wallet provider:\n\n```typescript\nimport { toUserFriendlyAddress } from \"@tonconnect\u002Fsdk\";\n\nasync function connectWallet(): Promise\u003Cstring> {\n  \u002F\u002F Generate connection URL for external wallets (Tonkeeper, etc.)\n  const walletList = await tonConnect.getWallets();\n\n  \u002F\u002F For Telegram Mini Apps, prioritize TON Space (built-in)\n  const tonSpace = walletList.find(\n    (w) => w.appName === \"tonspace\"\n  );\n\n  if (tonSpace) {\n    \u002F\u002F TON Space opens natively inside Telegram — no redirect\n    await tonConnect.connect({\n      jsBridgeKey: tonSpace.jsBridgeKey,\n    });\n  } else {\n    \u002F\u002F Fallback to universal link (opens Tonkeeper\u002FMyTonWallet)\n    const universalLink = tonConnect.connect({\n      universalLink: walletList[0].universalLink,\n      bridgeUrl: walletList[0].bridgeUrl,\n    });\n    \u002F\u002F Display QR code or redirect\n    window.open(universalLink, \"_blank\");\n  }\n\n  \u002F\u002F Wait for connection confirmation\n  return new Promise((resolve) => {\n    tonConnect.onStatusChange((wallet) => {\n      if (wallet) {\n        const address = toUserFriendlyAddress(\n          wallet.account.address\n        );\n        resolve(address);\n      }\n    });\n  });\n}\n```\n\n### Session Persistence\n\nTON Connect sessions persist across Mini App restarts. The SDK stores session data in `localStorage`. On subsequent launches, check for an existing connection before prompting the user:\n\n```typescript\nasync function initAuth(): Promise\u003Cstring | null> {\n  await tonConnect.restoreConnection();\n  if (tonConnect.connected && tonConnect.wallet) {\n    return toUserFriendlyAddress(\n      tonConnect.wallet.account.address\n    );\n  }\n  return null;\n}\n```\n\n## Step 2: Accepting Toncoin Payments\n\nOnce the wallet is connected, you can request native TON transfers using the TON Pay SDK.\n\n### Simple Payment Request\n\n```typescript\nimport { TonPaySDK, PaymentRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nconst tonPay = new TonPaySDK({\n  tonConnect,\n  merchantWallet: \"EQD...your-merchant-address\",\n  \u002F\u002F Optional: webhook URL for server-side confirmation\n  webhookUrl: \"https:\u002F\u002Fyourapi.com\u002Fwebhooks\u002Fton-pay\",\n});\n\nasync function requestPayment(\n  amount: number,\n  orderId: string\n): Promise\u003Cstring> {\n  const payment: PaymentRequest = {\n    amount: amount.toString(), \u002F\u002F Amount in TON (e.g., \"1.5\")\n    payload: orderId,          \u002F\u002F Stored in the transaction comment\n    description: `Order #${orderId}`,\n  };\n\n  \u002F\u002F This opens the wallet confirmation screen\n  const result = await tonPay.requestPayment(payment);\n\n  if (result.status === \"confirmed\") {\n    \u002F\u002F Transaction confirmed on-chain\n    return result.txHash;\n  } else if (result.status === \"rejected\") {\n    throw new Error(\"Payment rejected by user\");\n  } else {\n    throw new Error(`Payment failed: ${result.error}`);\n  }\n}\n```\n\n### Server-Side Payment Verification\n\nNever trust client-side payment confirmations alone. Verify every payment on your backend:\n\n```typescript\nimport { TonClient } from \"@ton\u002Fton\";\nimport { Address, fromNano } from \"@ton\u002Fcore\";\n\nconst tonClient = new TonClient({\n  endpoint: \"https:\u002F\u002Ftoncenter.com\u002Fapi\u002Fv2\u002FjsonRPC\",\n  apiKey: process.env.TONCENTER_API_KEY,\n});\n\nasync function verifyPayment(\n  txHash: string,\n  expectedAmount: string,\n  expectedPayload: string,\n  merchantAddress: string\n): Promise\u003Cboolean> {\n  const tx = await tonClient.getTransaction(\n    Address.parse(merchantAddress),\n    txHash\n  );\n\n  if (!tx) return false;\n\n  \u002F\u002F Verify amount\n  const receivedAmount = fromNano(tx.inMessage?.value ?? 0n);\n  if (parseFloat(receivedAmount) \u003C parseFloat(expectedAmount)) {\n    return false;\n  }\n\n  \u002F\u002F Verify payload (order ID in transaction comment)\n  const payload = tx.inMessage?.body?.toString() ?? \"\";\n  if (payload !== expectedPayload) {\n    return false;\n  }\n\n  return true;\n}\n```\n\n## Step 3: Jetton (Token) Payments\n\nJettons are the TON equivalent of ERC-20 tokens. The most common Jetton for payments is **USDT on TON** (Tether), which has over $1.2B in circulation on the TON network as of March 2026.\n\n### Requesting Jetton Payments\n\n```typescript\nimport { JettonPaymentRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nasync function requestUSDTPayment(\n  amount: number,\n  orderId: string\n): Promise\u003Cstring> {\n  const USDT_MASTER = \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\";\n\n  const payment: JettonPaymentRequest = {\n    jettonMaster: USDT_MASTER,\n    amount: (amount * 1e6).toString(), \u002F\u002F USDT has 6 decimals\n    payload: orderId,\n    description: `$${amount} USDT — Order #${orderId}`,\n    \u002F\u002F Forward TON for gas (Jetton transfers require ~0.05 TON)\n    forwardTonAmount: \"50000000\", \u002F\u002F 0.05 TON in nanotons\n  };\n\n  const result = await tonPay.requestJettonPayment(payment);\n\n  if (result.status === \"confirmed\") {\n    return result.txHash;\n  }\n  throw new Error(`Jetton payment failed: ${result.error}`);\n}\n```\n\n### Custom Jetton Integration\n\nIf you have your own Jetton (for in-app currency, loyalty points, etc.), the integration is identical — just replace the `jettonMaster` address:\n\n```typescript\nconst MY_TOKEN_MASTER = \"EQA...your-jetton-master-contract\";\n\nconst payment: JettonPaymentRequest = {\n  jettonMaster: MY_TOKEN_MASTER,\n  amount: \"1000000000\", \u002F\u002F Amount in smallest unit\n  payload: \"premium-upgrade\",\n  description: \"1000 APP Tokens — Premium Upgrade\",\n  forwardTonAmount: \"50000000\",\n};\n```\n\n## Step 4: Subscription Billing\n\nTON Pay SDK supports recurring payments through pre-authorized subscription contracts. The user approves a maximum charge amount and frequency, and your backend can trigger charges without additional user interaction.\n\n```typescript\nimport { SubscriptionRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nasync function createSubscription(\n  userId: string\n): Promise\u003Cstring> {\n  const subscription: SubscriptionRequest = {\n    jettonMaster: USDT_MASTER,\n    amount: \"4990000\",          \u002F\u002F $4.99 per period\n    period: 30 * 24 * 60 * 60,  \u002F\u002F 30 days in seconds\n    maxCharges: 12,              \u002F\u002F Maximum 12 charges (1 year)\n    payload: `sub-${userId}`,\n    description: \"Premium — $4.99\u002Fmonth\",\n  };\n\n  const result = await tonPay.createSubscription(subscription);\n\n  if (result.status === \"active\") {\n    \u002F\u002F Store subscription contract address for future charges\n    return result.subscriptionAddress;\n  }\n  throw new Error(\"Subscription setup failed\");\n}\n```\n\n## Monetization Strategies for Telegram Mini Apps\n\nPayments are just one piece of the monetization puzzle. Here is how successful Mini Apps combine multiple revenue streams:\n\n### 1. Telegram Ads Platform\n\nTelegram's native ad platform allows Mini Apps to display ads and earn revenue in TON. Integration requires registering as a publisher through `@AdsBot`:\n\n```typescript\nimport { TelegramAds } from \"@tma.js\u002Fads-sdk\";\n\nconst ads = new TelegramAds({\n  publisherId: \"your-publisher-id\",\n});\n\n\u002F\u002F Display a rewarded video ad\nasync function showRewardedAd(): Promise\u003Cboolean> {\n  const ad = await ads.loadRewarded();\n  if (ad) {\n    const result = await ads.showRewarded(ad);\n    return result.completed; \u002F\u002F User watched the full ad\n  }\n  return false;\n}\n```\n\nRevenue per impression varies by geography, but top Mini Apps report **$5-15 eCPM** for rewarded video ads in Tier 1 countries.\n\n### 2. In-App Purchases via Telegram Stars\n\nTelegram Stars is Telegram's built-in virtual currency, available since 2024. Users purchase Stars with fiat (Apple Pay, Google Pay, credit card) and spend them in Mini Apps. Developers receive 70% of Star revenue.\n\n```typescript\n\u002F\u002F Request Stars payment via Telegram WebApp API\nfunction requestStarsPayment(\n  title: string,\n  amount: number\n): void {\n  window.Telegram.WebApp.openInvoice(\n    {\n      title,\n      description: `${amount} Stars purchase`,\n      payload: JSON.stringify({ item: title }),\n      currency: \"XTR\", \u002F\u002F Telegram Stars currency code\n      prices: [{ label: title, amount }],\n    },\n    (status) => {\n      if (status === \"paid\") {\n        \u002F\u002F Verify on your backend via Bot API\n        verifyStarsPayment(title);\n      }\n    }\n  );\n}\n```\n\n### 3. Crypto-Native Monetization\n\nCombine TON Pay SDK payments with DeFi mechanics:\n\n- **Token-gated access** — require holding a specific Jetton or SBT (Soulbound Token) to access premium features\n- **NFT marketplace** — sell digital collectibles (TON NFTs use the TEP-62 standard)\n- **Staking rewards** — let users stake TON or Jettons in your Mini App's smart contract for yield\n- **Referral commissions** — pay referral bonuses in Jettons via smart contracts\n\n### Revenue Model Comparison\n\n| Model | Payment Method | Developer Share | User Friction | Best For |\n|-------|---------------|-----------------|---------------|----------|\n| Telegram Ads | Ad impressions | 50-70% of ad revenue | Low (passive) | Free apps with high DAU |\n| Telegram Stars | Fiat → Stars | 70% | Medium (in-app purchase) | Digital goods, casual games |\n| TON Pay (Toncoin) | Crypto wallet | 100% (minus gas) | Higher (wallet required) | Crypto-native users |\n| TON Pay (USDT) | Crypto wallet | 100% (minus gas) | Higher (wallet required) | Stable-value transactions |\n| Subscriptions | Crypto wallet | 100% (minus gas) | Medium (one-time approval) | SaaS, premium content |\n\n## Production Deployment Checklist\n\nBefore launching your payment-enabled Mini App:\n\n1. **Merchant wallet security** — use a multisig wallet (e.g., TON Safe) for receiving payments. Never use a single-key hot wallet for merchant funds.\n2. **Payment verification** — always verify payments server-side. Check amount, payload, and sender address.\n3. **Error handling** — handle network timeouts, rejected transactions, and insufficient balance gracefully. Show clear error messages to users.\n4. **Refund policy** — implement a refund mechanism. TON transactions are irreversible, so refunds require a separate outgoing transaction.\n5. **Rate limiting** — protect your payment webhook endpoint from abuse. Validate webhook signatures.\n6. **Logging** — log all payment events with transaction hashes for dispute resolution.\n7. **Testing** — use TON testnet for development. TON Pay SDK supports testnet mode via a configuration flag.\n\n## Frequently Asked Questions\n\n### How many users can TON Mini Apps reach?\n\nTelegram has 950M+ monthly active users. Mini Apps are accessible to all of them without installing anything. The top Mini Apps (Notcoin, Hamster Kombat) have reached 30-40M users. The realistic addressable market for a well-distributed Mini App is 1-10M users.\n\n### What are the transaction fees for TON payments?\n\nNative TON transfers cost approximately 0.005-0.01 TON ($0.01-0.02 at current prices). Jetton transfers cost slightly more due to the additional smart contract execution, typically 0.03-0.05 TON ($0.06-0.10). These fees are paid by the sender, not the merchant.\n\n### Can I accept fiat payments in a Telegram Mini App?\n\nYes, through Telegram Stars (built-in) or third-party payment providers. Telegram Stars uses Telegram's native payment infrastructure with Apple Pay, Google Pay, and credit card support. For direct fiat processing, you can integrate Stripe or other providers, but Telegram's terms require using their Bot Payments API.\n\n### Is KYC required for accepting TON payments?\n\nFor the merchant: it depends on your jurisdiction and transaction volume. Most countries require money transmitter or payment processor licensing above certain thresholds. For users: TON wallet creation does not require KYC, but centralized exchanges where users buy TON do enforce KYC.\n\n### What is the difference between TON and Ethereum for payments?\n\nTON offers lower fees ($0.01 vs $0.50-5.00 on Ethereum L1), faster finality (10 seconds vs 12-15 minutes for strong finality on Ethereum), and built-in Telegram distribution. Ethereum has a larger DeFi ecosystem, more institutional adoption, and stronger decentralization guarantees. For consumer-facing payment applications, TON's Telegram integration is a decisive advantage.\n\n### How do I handle disputes and chargebacks?\n\nBlockchain payments are irreversible — there are no chargebacks. You must implement your own refund and dispute resolution system. Best practice: hold funds in an escrow smart contract for a dispute period (24-72 hours) before releasing to your merchant wallet.","\u003Ch2 id=\"the-ton-ecosystem-in-2026\">The TON Ecosystem in 2026\u003C\u002Fh2>\n\u003Cp>The Open Network (TON) has evolved from a blockchain project with Telegram roots into one of the most actively used cryptocurrency ecosystems in the world. As of March 2026, the numbers tell a compelling story:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>500M+ monthly active users\u003C\u002Fstrong> across Telegram Mini Apps\u003C\u002Fli>\n\u003Cli>\u003Cstrong>3,600+ live Mini Apps\u003C\u002Fstrong> listed in the Telegram Mini App catalog\u003C\u002Fli>\n\u003Cli>\u003Cstrong>400M+ TON wallets\u003C\u002Fstrong> created through Telegram Wallet, Tonkeeper, and TON Space\u003C\u002Fli>\n\u003Cli>\u003Cstrong>$4.2B total value locked\u003C\u002Fstrong> in TON DeFi protocols\u003C\u002Fli>\n\u003Cli>\u003Cstrong>12M daily on-chain transactions\u003C\u002Fstrong> on the TON mainnet\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>These figures make TON the most widely distributed blockchain by active user count, surpassing Ethereum (including L2s) and Solana. The growth is driven by a single factor: \u003Cstrong>Telegram integration\u003C\u002Fstrong>. With 950M+ monthly active Telegram users worldwide, even a small conversion rate into Mini App and wallet usage produces massive numbers.\u003C\u002Fp>\n\u003Ch3>Why TON for Payments?\u003C\u002Fh3>\n\u003Cp>For developers building payment-enabled applications, TON offers three structural advantages over other blockchains:\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cstrong>Distribution\u003C\u002Fstrong> — Your Mini App is discoverable inside Telegram, the messaging platform your users already use daily. No app store submission, no download friction, no wallet installation required.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Near-zero fees\u003C\u002Fstrong> — TON transaction fees average $0.005-0.01, making micropayments and in-app purchases economically viable without batching or L2 complexity.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Sub-second finality\u003C\u002Fstrong> — TON’s sharded architecture achieves block times of ~5 seconds with practical finality in 1-2 blocks. Users see confirmed payments within 10 seconds.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2 id=\"ton-pay-sdk-architecture-overview\">TON Pay SDK: Architecture Overview\u003C\u002Fh2>\n\u003Cp>TON Pay SDK is the official payment integration library for Telegram Mini Apps. Released in Q4 2025, it provides a unified API for:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>TON Connect\u003C\u002Fstrong> wallet authentication\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Toncoin payments\u003C\u002Fstrong> (native TON transfers)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Jetton payments\u003C\u002Fstrong> (TRC-20 token standard — USDT, NOT, and custom tokens)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Subscription billing\u003C\u002Fstrong> (recurring Jetton charges via pre-authorized smart contracts)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Payment receipts\u003C\u002Fstrong> (on-chain proof of payment with metadata)\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>The SDK is available as an npm package (\u003Ccode>@tonconnect\u002Fpay-sdk\u003C\u002Fcode>) and supports both client-side (browser) and server-side (Node.js) usage.\u003C\u002Fp>\n\u003Ch3>Prerequisites\u003C\u002Fh3>\n\u003Cp>Before integrating TON Pay SDK, ensure you have:\u003C\u002Fp>\n\u003Col>\n\u003Cli>A registered Telegram Bot with Mini App capabilities (\u003Ccode>@BotFather\u003C\u002Fcode> → \u003Ccode>\u002Fnewapp\u003C\u002Fcode>)\u003C\u002Fli>\n\u003Cli>A TON wallet address for receiving payments (merchant wallet)\u003C\u002Fli>\n\u003Cli>Node.js 20+ and TypeScript 5.x for the development environment\u003C\u002Fli>\n\u003Cli>Basic familiarity with the Telegram Mini App API (\u003Ccode>window.Telegram.WebApp\u003C\u002Fcode>)\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2 id=\"step-1-ton-connect-wallet-authentication\">Step 1: TON Connect Wallet Authentication\u003C\u002Fh2>\n\u003Cp>TON Connect is the standard protocol for connecting TON wallets to dApps and Mini Apps. It serves as the authentication layer — before accepting payments, you need to know which wallet the user wants to pay from.\u003C\u002Fp>\n\u003Ch3>Setting Up TON Connect\u003C\u002Fh3>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { TonConnect } from \"@tonconnect\u002Fsdk\";\nimport { TonPaySDK } from \"@tonconnect\u002Fpay-sdk\";\n\n\u002F\u002F Initialize TON Connect with your manifest\nconst tonConnect = new TonConnect({\n  manifestUrl: \"https:\u002F\u002Fyourapp.com\u002Ftonconnect-manifest.json\",\n});\n\n\u002F\u002F The manifest describes your Mini App to wallets\n\u002F\u002F Host this JSON at your domain:\n\u002F\u002F {\n\u002F\u002F   \"url\": \"https:\u002F\u002Fyourapp.com\",\n\u002F\u002F   \"name\": \"Your Mini App\",\n\u002F\u002F   \"iconUrl\": \"https:\u002F\u002Fyourapp.com\u002Ficon.png\"\n\u002F\u002F }\n\n\u002F\u002F Check if user has a previously connected wallet\nconst existingWallet = tonConnect.wallet;\nif (existingWallet) {\n  console.log(\"Connected:\", existingWallet.account.address);\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Wallet Connection Flow\u003C\u002Fh3>\n\u003Cp>The wallet connection flow differs depending on the user’s wallet provider:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { toUserFriendlyAddress } from \"@tonconnect\u002Fsdk\";\n\nasync function connectWallet(): Promise&lt;string&gt; {\n  \u002F\u002F Generate connection URL for external wallets (Tonkeeper, etc.)\n  const walletList = await tonConnect.getWallets();\n\n  \u002F\u002F For Telegram Mini Apps, prioritize TON Space (built-in)\n  const tonSpace = walletList.find(\n    (w) =&gt; w.appName === \"tonspace\"\n  );\n\n  if (tonSpace) {\n    \u002F\u002F TON Space opens natively inside Telegram — no redirect\n    await tonConnect.connect({\n      jsBridgeKey: tonSpace.jsBridgeKey,\n    });\n  } else {\n    \u002F\u002F Fallback to universal link (opens Tonkeeper\u002FMyTonWallet)\n    const universalLink = tonConnect.connect({\n      universalLink: walletList[0].universalLink,\n      bridgeUrl: walletList[0].bridgeUrl,\n    });\n    \u002F\u002F Display QR code or redirect\n    window.open(universalLink, \"_blank\");\n  }\n\n  \u002F\u002F Wait for connection confirmation\n  return new Promise((resolve) =&gt; {\n    tonConnect.onStatusChange((wallet) =&gt; {\n      if (wallet) {\n        const address = toUserFriendlyAddress(\n          wallet.account.address\n        );\n        resolve(address);\n      }\n    });\n  });\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Session Persistence\u003C\u002Fh3>\n\u003Cp>TON Connect sessions persist across Mini App restarts. The SDK stores session data in \u003Ccode>localStorage\u003C\u002Fcode>. On subsequent launches, check for an existing connection before prompting the user:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">async function initAuth(): Promise&lt;string | null&gt; {\n  await tonConnect.restoreConnection();\n  if (tonConnect.connected &amp;&amp; tonConnect.wallet) {\n    return toUserFriendlyAddress(\n      tonConnect.wallet.account.address\n    );\n  }\n  return null;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"step-2-accepting-toncoin-payments\">Step 2: Accepting Toncoin Payments\u003C\u002Fh2>\n\u003Cp>Once the wallet is connected, you can request native TON transfers using the TON Pay SDK.\u003C\u002Fp>\n\u003Ch3>Simple Payment Request\u003C\u002Fh3>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { TonPaySDK, PaymentRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nconst tonPay = new TonPaySDK({\n  tonConnect,\n  merchantWallet: \"EQD...your-merchant-address\",\n  \u002F\u002F Optional: webhook URL for server-side confirmation\n  webhookUrl: \"https:\u002F\u002Fyourapi.com\u002Fwebhooks\u002Fton-pay\",\n});\n\nasync function requestPayment(\n  amount: number,\n  orderId: string\n): Promise&lt;string&gt; {\n  const payment: PaymentRequest = {\n    amount: amount.toString(), \u002F\u002F Amount in TON (e.g., \"1.5\")\n    payload: orderId,          \u002F\u002F Stored in the transaction comment\n    description: `Order #${orderId}`,\n  };\n\n  \u002F\u002F This opens the wallet confirmation screen\n  const result = await tonPay.requestPayment(payment);\n\n  if (result.status === \"confirmed\") {\n    \u002F\u002F Transaction confirmed on-chain\n    return result.txHash;\n  } else if (result.status === \"rejected\") {\n    throw new Error(\"Payment rejected by user\");\n  } else {\n    throw new Error(`Payment failed: ${result.error}`);\n  }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Server-Side Payment Verification\u003C\u002Fh3>\n\u003Cp>Never trust client-side payment confirmations alone. Verify every payment on your backend:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { TonClient } from \"@ton\u002Fton\";\nimport { Address, fromNano } from \"@ton\u002Fcore\";\n\nconst tonClient = new TonClient({\n  endpoint: \"https:\u002F\u002Ftoncenter.com\u002Fapi\u002Fv2\u002FjsonRPC\",\n  apiKey: process.env.TONCENTER_API_KEY,\n});\n\nasync function verifyPayment(\n  txHash: string,\n  expectedAmount: string,\n  expectedPayload: string,\n  merchantAddress: string\n): Promise&lt;boolean&gt; {\n  const tx = await tonClient.getTransaction(\n    Address.parse(merchantAddress),\n    txHash\n  );\n\n  if (!tx) return false;\n\n  \u002F\u002F Verify amount\n  const receivedAmount = fromNano(tx.inMessage?.value ?? 0n);\n  if (parseFloat(receivedAmount) &lt; parseFloat(expectedAmount)) {\n    return false;\n  }\n\n  \u002F\u002F Verify payload (order ID in transaction comment)\n  const payload = tx.inMessage?.body?.toString() ?? \"\";\n  if (payload !== expectedPayload) {\n    return false;\n  }\n\n  return true;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"step-3-jetton-token-payments\">Step 3: Jetton (Token) Payments\u003C\u002Fh2>\n\u003Cp>Jettons are the TON equivalent of ERC-20 tokens. The most common Jetton for payments is \u003Cstrong>USDT on TON\u003C\u002Fstrong> (Tether), which has over $1.2B in circulation on the TON network as of March 2026.\u003C\u002Fp>\n\u003Ch3>Requesting Jetton Payments\u003C\u002Fh3>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { JettonPaymentRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nasync function requestUSDTPayment(\n  amount: number,\n  orderId: string\n): Promise&lt;string&gt; {\n  const USDT_MASTER = \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\";\n\n  const payment: JettonPaymentRequest = {\n    jettonMaster: USDT_MASTER,\n    amount: (amount * 1e6).toString(), \u002F\u002F USDT has 6 decimals\n    payload: orderId,\n    description: `$${amount} USDT — Order #${orderId}`,\n    \u002F\u002F Forward TON for gas (Jetton transfers require ~0.05 TON)\n    forwardTonAmount: \"50000000\", \u002F\u002F 0.05 TON in nanotons\n  };\n\n  const result = await tonPay.requestJettonPayment(payment);\n\n  if (result.status === \"confirmed\") {\n    return result.txHash;\n  }\n  throw new Error(`Jetton payment failed: ${result.error}`);\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Custom Jetton Integration\u003C\u002Fh3>\n\u003Cp>If you have your own Jetton (for in-app currency, loyalty points, etc.), the integration is identical — just replace the \u003Ccode>jettonMaster\u003C\u002Fcode> address:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">const MY_TOKEN_MASTER = \"EQA...your-jetton-master-contract\";\n\nconst payment: JettonPaymentRequest = {\n  jettonMaster: MY_TOKEN_MASTER,\n  amount: \"1000000000\", \u002F\u002F Amount in smallest unit\n  payload: \"premium-upgrade\",\n  description: \"1000 APP Tokens — Premium Upgrade\",\n  forwardTonAmount: \"50000000\",\n};\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"step-4-subscription-billing\">Step 4: Subscription Billing\u003C\u002Fh2>\n\u003Cp>TON Pay SDK supports recurring payments through pre-authorized subscription contracts. The user approves a maximum charge amount and frequency, and your backend can trigger charges without additional user interaction.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { SubscriptionRequest } from \"@tonconnect\u002Fpay-sdk\";\n\nasync function createSubscription(\n  userId: string\n): Promise&lt;string&gt; {\n  const subscription: SubscriptionRequest = {\n    jettonMaster: USDT_MASTER,\n    amount: \"4990000\",          \u002F\u002F $4.99 per period\n    period: 30 * 24 * 60 * 60,  \u002F\u002F 30 days in seconds\n    maxCharges: 12,              \u002F\u002F Maximum 12 charges (1 year)\n    payload: `sub-${userId}`,\n    description: \"Premium — $4.99\u002Fmonth\",\n  };\n\n  const result = await tonPay.createSubscription(subscription);\n\n  if (result.status === \"active\") {\n    \u002F\u002F Store subscription contract address for future charges\n    return result.subscriptionAddress;\n  }\n  throw new Error(\"Subscription setup failed\");\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"monetization-strategies-for-telegram-mini-apps\">Monetization Strategies for Telegram Mini Apps\u003C\u002Fh2>\n\u003Cp>Payments are just one piece of the monetization puzzle. Here is how successful Mini Apps combine multiple revenue streams:\u003C\u002Fp>\n\u003Ch3>1. Telegram Ads Platform\u003C\u002Fh3>\n\u003Cp>Telegram’s native ad platform allows Mini Apps to display ads and earn revenue in TON. Integration requires registering as a publisher through \u003Ccode>@AdsBot\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">import { TelegramAds } from \"@tma.js\u002Fads-sdk\";\n\nconst ads = new TelegramAds({\n  publisherId: \"your-publisher-id\",\n});\n\n\u002F\u002F Display a rewarded video ad\nasync function showRewardedAd(): Promise&lt;boolean&gt; {\n  const ad = await ads.loadRewarded();\n  if (ad) {\n    const result = await ads.showRewarded(ad);\n    return result.completed; \u002F\u002F User watched the full ad\n  }\n  return false;\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Revenue per impression varies by geography, but top Mini Apps report \u003Cstrong>$5-15 eCPM\u003C\u002Fstrong> for rewarded video ads in Tier 1 countries.\u003C\u002Fp>\n\u003Ch3>2. In-App Purchases via Telegram Stars\u003C\u002Fh3>\n\u003Cp>Telegram Stars is Telegram’s built-in virtual currency, available since 2024. Users purchase Stars with fiat (Apple Pay, Google Pay, credit card) and spend them in Mini Apps. Developers receive 70% of Star revenue.\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-typescript\">\u002F\u002F Request Stars payment via Telegram WebApp API\nfunction requestStarsPayment(\n  title: string,\n  amount: number\n): void {\n  window.Telegram.WebApp.openInvoice(\n    {\n      title,\n      description: `${amount} Stars purchase`,\n      payload: JSON.stringify({ item: title }),\n      currency: \"XTR\", \u002F\u002F Telegram Stars currency code\n      prices: [{ label: title, amount }],\n    },\n    (status) =&gt; {\n      if (status === \"paid\") {\n        \u002F\u002F Verify on your backend via Bot API\n        verifyStarsPayment(title);\n      }\n    }\n  );\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>3. Crypto-Native Monetization\u003C\u002Fh3>\n\u003Cp>Combine TON Pay SDK payments with DeFi mechanics:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Token-gated access\u003C\u002Fstrong> — require holding a specific Jetton or SBT (Soulbound Token) to access premium features\u003C\u002Fli>\n\u003Cli>\u003Cstrong>NFT marketplace\u003C\u002Fstrong> — sell digital collectibles (TON NFTs use the TEP-62 standard)\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Staking rewards\u003C\u002Fstrong> — let users stake TON or Jettons in your Mini App’s smart contract for yield\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Referral commissions\u003C\u002Fstrong> — pay referral bonuses in Jettons via smart contracts\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>Revenue Model Comparison\u003C\u002Fh3>\n\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Model\u003C\u002Fth>\u003Cth>Payment Method\u003C\u002Fth>\u003Cth>Developer Share\u003C\u002Fth>\u003Cth>User Friction\u003C\u002Fth>\u003Cth>Best For\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\n\u003Ctr>\u003Ctd>Telegram Ads\u003C\u002Ftd>\u003Ctd>Ad impressions\u003C\u002Ftd>\u003Ctd>50-70% of ad revenue\u003C\u002Ftd>\u003Ctd>Low (passive)\u003C\u002Ftd>\u003Ctd>Free apps with high DAU\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Telegram Stars\u003C\u002Ftd>\u003Ctd>Fiat → Stars\u003C\u002Ftd>\u003Ctd>70%\u003C\u002Ftd>\u003Ctd>Medium (in-app purchase)\u003C\u002Ftd>\u003Ctd>Digital goods, casual games\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>TON Pay (Toncoin)\u003C\u002Ftd>\u003Ctd>Crypto wallet\u003C\u002Ftd>\u003Ctd>100% (minus gas)\u003C\u002Ftd>\u003Ctd>Higher (wallet required)\u003C\u002Ftd>\u003Ctd>Crypto-native users\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>TON Pay (USDT)\u003C\u002Ftd>\u003Ctd>Crypto wallet\u003C\u002Ftd>\u003Ctd>100% (minus gas)\u003C\u002Ftd>\u003Ctd>Higher (wallet required)\u003C\u002Ftd>\u003Ctd>Stable-value transactions\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Subscriptions\u003C\u002Ftd>\u003Ctd>Crypto wallet\u003C\u002Ftd>\u003Ctd>100% (minus gas)\u003C\u002Ftd>\u003Ctd>Medium (one-time approval)\u003C\u002Ftd>\u003Ctd>SaaS, premium content\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003Ch2 id=\"production-deployment-checklist\">Production Deployment Checklist\u003C\u002Fh2>\n\u003Cp>Before launching your payment-enabled Mini App:\u003C\u002Fp>\n\u003Col>\n\u003Cli>\u003Cstrong>Merchant wallet security\u003C\u002Fstrong> — use a multisig wallet (e.g., TON Safe) for receiving payments. Never use a single-key hot wallet for merchant funds.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Payment verification\u003C\u002Fstrong> — always verify payments server-side. Check amount, payload, and sender address.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Error handling\u003C\u002Fstrong> — handle network timeouts, rejected transactions, and insufficient balance gracefully. Show clear error messages to users.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Refund policy\u003C\u002Fstrong> — implement a refund mechanism. TON transactions are irreversible, so refunds require a separate outgoing transaction.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Rate limiting\u003C\u002Fstrong> — protect your payment webhook endpoint from abuse. Validate webhook signatures.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Logging\u003C\u002Fstrong> — log all payment events with transaction hashes for dispute resolution.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Testing\u003C\u002Fstrong> — use TON testnet for development. TON Pay SDK supports testnet mode via a configuration flag.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Ch2 id=\"frequently-asked-questions\">Frequently Asked Questions\u003C\u002Fh2>\n\u003Ch3 id=\"how-many-users-can-ton-mini-apps-reach\">How many users can TON Mini Apps reach?\u003C\u002Fh3>\n\u003Cp>Telegram has 950M+ monthly active users. Mini Apps are accessible to all of them without installing anything. The top Mini Apps (Notcoin, Hamster Kombat) have reached 30-40M users. The realistic addressable market for a well-distributed Mini App is 1-10M users.\u003C\u002Fp>\n\u003Ch3 id=\"what-are-the-transaction-fees-for-ton-payments\">What are the transaction fees for TON payments?\u003C\u002Fh3>\n\u003Cp>Native TON transfers cost approximately 0.005-0.01 TON (\u003Cspan class=\"math math-inline\">0.01-0.02 at current prices). Jetton transfers cost slightly more due to the additional smart contract execution, typically 0.03-0.05 TON (\u003C\u002Fspan>0.06-0.10). These fees are paid by the sender, not the merchant.\u003C\u002Fp>\n\u003Ch3 id=\"can-i-accept-fiat-payments-in-a-telegram-mini-app\">Can I accept fiat payments in a Telegram Mini App?\u003C\u002Fh3>\n\u003Cp>Yes, through Telegram Stars (built-in) or third-party payment providers. Telegram Stars uses Telegram’s native payment infrastructure with Apple Pay, Google Pay, and credit card support. For direct fiat processing, you can integrate Stripe or other providers, but Telegram’s terms require using their Bot Payments API.\u003C\u002Fp>\n\u003Ch3 id=\"is-kyc-required-for-accepting-ton-payments\">Is KYC required for accepting TON payments?\u003C\u002Fh3>\n\u003Cp>For the merchant: it depends on your jurisdiction and transaction volume. Most countries require money transmitter or payment processor licensing above certain thresholds. For users: TON wallet creation does not require KYC, but centralized exchanges where users buy TON do enforce KYC.\u003C\u002Fp>\n\u003Ch3 id=\"what-is-the-difference-between-ton-and-ethereum-for-payments\">What is the difference between TON and Ethereum for payments?\u003C\u002Fh3>\n\u003Cp>TON offers lower fees ($0.01 vs $0.50-5.00 on Ethereum L1), faster finality (10 seconds vs 12-15 minutes for strong finality on Ethereum), and built-in Telegram distribution. Ethereum has a larger DeFi ecosystem, more institutional adoption, and stronger decentralization guarantees. For consumer-facing payment applications, TON’s Telegram integration is a decisive advantage.\u003C\u002Fp>\n\u003Ch3 id=\"how-do-i-handle-disputes-and-chargebacks\">How do I handle disputes and chargebacks?\u003C\u002Fh3>\n\u003Cp>Blockchain payments are irreversible — there are no chargebacks. You must implement your own refund and dispute resolution system. Best practice: hold funds in an escrow smart contract for a dispute period (24-72 hours) before releasing to your merchant wallet.\u003C\u002Fp>\n","en","b0000000-0000-0000-0000-000000000001",true,"2026-03-28T10:44:35.571578Z","Building on TON in 2026: Crypto Payments in Telegram Mini Apps","Integrate TON Pay SDK into Telegram Mini Apps. Step-by-step guide: TON Connect auth, Toncoin and Jetton payments, subscriptions, and monetization strategies.","TON Pay SDK Telegram Mini Apps",null,"index, follow",[22,27,31],{"id":23,"name":24,"slug":25,"created_at":26},"c0000000-0000-0000-0000-000000000015","TON","ton","2026-03-28T10:44:21.513630Z",{"id":28,"name":29,"slug":30,"created_at":26},"c0000000-0000-0000-0000-000000000010","Telegram","telegram",{"id":32,"name":33,"slug":34,"created_at":26},"c0000000-0000-0000-0000-000000000009","Web3","web3",[36,43,49],{"id":37,"title":38,"slug":39,"excerpt":40,"locale":12,"category_name":41,"published_at":42},"de000000-0000-0000-0000-000000000003","The Ethereum Interoperability Layer: How 55+ L2s Become One Chain","ethereum-interoperability-layer-how-55-l2s-become-one-chain","Ethereum has 55+ Layer 2 rollups, fragmenting liquidity and user experience. The Ethereum Interoperability Layer — combining cross-rollup messaging, shared sequencers, and based rollups — aims to unify them into a single composable network.","Blockchain","2026-03-28T10:44:35.632478Z",{"id":44,"title":45,"slug":46,"excerpt":47,"locale":12,"category_name":41,"published_at":48},"de000000-0000-0000-0000-000000000002","ZK Proofs Beyond Rollups: Verifiable AI Inference on Ethereum","zk-proofs-beyond-rollups-verifiable-ai-inference-ethereum","Zero-knowledge proofs are no longer just a scaling tool. In 2026, zkML enables verifiable AI inference on-chain, ZK coprocessors move heavy computation off-chain with on-chain verification, and new proving systems like SP1 and Jolt make it practical.","2026-03-28T10:44:35.618408Z",{"id":50,"title":51,"slug":52,"excerpt":53,"locale":12,"category_name":41,"published_at":54},"dd000000-0000-0000-0000-000000000003","EIP-7702 in Practice: Building Smart Account Flows After Pectra","eip-7702-in-practice-building-smart-account-flows-after-pectra","EIP-7702 lets any Ethereum EOA temporarily act as a smart contract within a single transaction. Here is how to implement batch transactions, gas sponsorship, and social recovery using the new account abstraction primitive.","2026-03-28T10:44:35.031290Z",{"id":13,"name":56,"slug":57,"bio":58,"photo_url":19,"linkedin":19,"role":59,"created_at":60,"updated_at":60},"Open Soft Team","open-soft-team","The engineering team at Open Soft, building premium software solutions from Bali, Indonesia.","Engineering Team","2026-03-28T08:31:22.226811Z"]