DEV Community

Fkylol
Fkylol

Posted on

I built a Telegram bot that only answers after a Solana payment — here's the paywall design

Built with heavy AI assistance while learning TypeScript — every test below runs real transactions, roast away.

I'm solo, first launch. I wanted a crypto Q&A bot that actually earns, without Stripe (micropayments + France = pain).

The design: pay with a transaction, not an account.

  1. User asks my Telegram bot anything → live demo here.
  2. Bot replies with my Solana address + price (0.1 SOL).
  3. User sends SOL, then pastes !verify <signature> <their-address>.
  4. Bot fetches the transaction and checks: confirmed, no error, SystemProgram transfer of the right amount, from the right sender, to my wallet.
  5. Valid → LLM answer (Groq, free tier) + their Telegram ID is linked, so next questions skip the proof.
  6. Every signature is stored in SQLite — reuse = instant reject (anti-replay).

Code (MIT Lite): https://github.com/Fkylol/solpay-bot

Stack, 100% free: ElizaOS runtime, Groq LLM, CoinGecko prices, Solana Devnet for tests, PGlite + SQLite local.

What I learned:

  • X's free API tier can't read anything (402 on timelines/mentions). My whole "reply on X" plan died there — Telegram (free read+write) saved the project.
  • Groq sometimes returns empty replies: one automatic retry fixed it.
  • UX trap: my 60s anti-spam cooldown fired on new users' second message. Now only paid users are throttled.

Biggest open question: pay-per-question vs monthly subscription for a bot like this? Would love your takes.

Pro version with the full paywall + commercial license + support ($49): https://fkylo.gumroad.com/l/solpay-bot

Top comments (0)