Web3 · Telegram Mini App / Its Step · case 06
Paid channel access on TON
My open-source project: a Mini App that sells a subscription to a private Telegram channel for TON. A Tact smart contract stores the expiry date, and the bot lets subscribers in and removes them when it runs out.
- Tact
- TON Connect
- Node.js
- TypeScript

25 testsfor the contract and backend, plus a real testnet payment
The task
Show, as an open project, how to sell access to a private Telegram channel for crypto with no payment provider and no manual checks. The blockchain is the source of truth: anyone can verify a subscription without trusting the server.
What I built
- Two Tact smart contracts. The main one takes payments and deploys a small per-subscriber contract that stores the expiry date. Renewing early adds to the time left, and underpayments are bounced back automatically.
- The bot admits people to the channel only through join requests. Before approving, it reads the subscription from the blockchain, and every minute it removes members whose subscription has expired.
- A Mini App that looks like Telegram itself: subscription status, payment with TON Connect, confirmation and a button to open the channel. Colors follow the user’s Telegram theme.
- The server verifies Telegram’s signature on every Mini App request, so nobody can view or pay for a subscription as someone else.
- Deployed to testnet and tested with a real payment. It caught a bug the tests had missed: the wallet took the fee out of the amount and the contract bounced the payment. The server now asks for a 0.01 TON reserve, covered by its own test.
Results in numbers
25 testsfor the contract, bot and API on the TON sandbox
≈ 0.001 TONnetwork fee per payment
2 contractsa main one and one per subscriber
Testnetdeployed and verified with a real payment