DEV Community

flat cash
flat cash

Posted on • Originally published at flat.cash

Building a Private Stablecoin Wallet on Telegram (with BearerSwap)

The Problem: Crypto Wallets Leak Everything

Every time you send USDC on Ethereum, the entire world can see:

  • Who sent it
  • Who received it
  • How much
  • When

For 900M+ Telegram users who value privacy, this is a dealbreaker. They want to send money like cash — where only sender and receiver know.

The Solution: BearerSwap + Telegram Mini App

We built a Telegram Mini App that lets users send stablecoins without any on-chain link between sender and receiver. Here's how.

Architecture

User → Telegram Mini App → FlatID API → BearerSwap Contract → Recipient
Enter fullscreen mode Exit fullscreen mode
  1. FlatID — Email-based account (no seed phrases, no MetaMask)
  2. BearerSwap — Commit-reveal transfer mechanism
  3. Telegram WebApp SDK — Full wallet UI inside Telegram

How BearerSwap Works (The Privacy Layer)

// Step 1: Sender commits tokens
function commit(bytes32 hash, uint256 amount) external {
    // Tokens locked, hash stored
}

// Step 2: Receiver reveals secret to claim
function reveal(bytes32 secret) external {
    // Verifies hash, sends tokens to msg.sender
}
Enter fullscreen mode Exit fullscreen mode

The key insight: the blockchain sees a deposit and a withdrawal, but cannot link them. The secret is shared off-chain (via Telegram DM, encrypted message, etc).

The Telegram Integration

Telegram's WebApp SDK gives us:

  • initData for cryptographic user verification
  • Full HTML/JS UI inside the Telegram app
  • No app store approval needed
  • 900M potential users
// Authenticate Telegram user
const tg = window.Telegram.WebApp;
tg.ready();
tg.expand();

// Send initData to backend for verification
const res = await fetch("/api/telegram/auth", {
  method: "POST",
  body: JSON.stringify({ initData: tg.initData }),
});
Enter fullscreen mode Exit fullscreen mode

Auto-Registration Flow

When a user opens the bot for the first time:

  1. Telegram sends their user ID + username
  2. Backend creates a FlatID account (email-less, linked to Telegram)
  3. Generates an Ethereum receive wallet
  4. User is ready to receive and send FLAT instantly

No KYC. No seed phrases. No wallet extensions.

Why FLAT Instead of USDC?

Feature USDC FLAT
Privacy ❌ Fully traceable ✅ BearerSwap (untraceable)
Peg USD CPI (inflation-proof)
Yield 0% 12,000%+ APY via SAVE
Wallet needed Yes (MetaMask etc) No (FlatID)
KYC Often required Never

Earning Yield: The SAVE Token

Users who want yield can buy SAVE — permanently locked FLAT that earns protocol revenue:

Yield = Protocol_Revenue / (1 - absorption_ratio)
Enter fullscreen mode Exit fullscreen mode

At 99.99% absorption, holders earn 10,000x more per token than at 0%. This isn't speculation — it's math.

Try It

Open Source

The entire protocol is verifiable on-chain:


Mathematica Inevitabilis Est.

Top comments (0)