Inspiration

Managing 80+ Telegram groups with 2M users, we faced high payment processing fees eating into sustainability. Starknet's ultra-low fees ($0.01 vs $5+) and fast confirmations (30 seconds) offered the perfect solution to make micropayments viable at scale.


What it does

Bae Bot is a Telegram group management tool serving 2M users across 80+ communities. Users can now pay for premium features using STRK, ETH, or WBTC on Starknet with sub-cent transaction fees. The bot:

  • Accepts multi-token payments (STRK/ETH/WBTC)
  • Converts USD to crypto in real-time via price oracle
  • Verifies transactions on-chain via Starknet RPC
  • Provides dual payment options: traditional crypto (OxaPay) + Starknet
  • Displays transaction proofs via Starkscan links

How we built it

Tech Stack:

  • Python with Telethon for Telegram integration
  • starknet-py for blockchain interaction
  • MongoDB for payment tracking
  • CoinGecko API for price conversion

Architecture:

  1. Created StarknetPaymentAPI module for payment processing
  2. Built PriceOracle with 60-second caching for USD↔crypto conversion
  3. Integrated on-chain transaction verification via Starknet RPC
  4. Extended MongoDB schema to support both OxaPay and Starknet payments
  5. Implemented dual verification: button flow + /verifypayment command

Challenges we ran into

1. Telegram Button Data Limit: Callback data restricted to 64 bytes—our payment IDs exceeded this. Solution: Used MongoDB ObjectIds as short references.

2. Transaction Verification: Parsing Starknet events for amount validation required understanding Uint256 format (low/high 128-bit split). Implemented 1% tolerance for price fluctuations.

3. Dual Payment System: Maintaining backward compatibility with OxaPay while adding Starknet required careful database schema design and payment status checking logic.

4. Price Oracle Reliability: Added caching and error handling to prevent CoinGecko API failures from blocking payments.


Accomplishments that we're proud of

Production-ready integration serving 2M real users
90%+ cost reduction on transaction fees
Multi-token support (STRK/ETH/WBTC) in one flow
Seamless UX: Users see USD prices, pay in crypto, verified in 30 seconds
Zero downtime migration: Starknet payments added without disrupting existing OxaPay users
Complete transparency: All payments verifiable on Starkscan


What we learned

  • Starknet's scalability is real: Sub-cent fees make micropayments economically viable at scale
  • ZK-rollup architecture: Understanding execution vs finality for payment confirmation
  • Smart event parsing: Working with Starknet transaction events and calldata structures
  • Price oracle design: Caching strategies for real-time conversion without API abuse
  • User psychology: Users prefer seeing USD amounts but paying in crypto—price oracles bridge this gap

What's next for Bae Bot

Immediate (Post-Hackathon):

  • Automatic payment detection via webhooks (eliminate manual TX hash entry)
  • Testnet support for user experimentation
  • Payment analytics dashboard

Short-term:

  • Smart contract escrow for recurring subscriptions
  • Multi-signature payment verification for enterprise groups
  • USDC/DAI stablecoin support
  • Payment batching for gas optimization

Long-term:

  • NFT-based membership passes (tokenized subscriptions)
  • Reward tokens for active community members
  • DeFi integration (stake STRK, earn premium features)
  • Cross-chain bridge support (Bitcoin → Starknet via Atomiq)

Vision: Make Bae Bot the first Telegram management platform fully powered by Starknet, demonstrating how blockchain can reduce costs while improving UX for everyday applications.


Stats:

  • 80+ Telegram groups
  • 2M total users
  • Dual payment system (OxaPay + Starknet)
  • 90% fee reduction with Starknet
  • ~1,200 lines of Starknet integration code

Built With

  • pymongo
  • python-telegram-bot
  • starknet
  • telethon
Share this project:

Updates