TipStream: Telegram→EVVM micro‑tipping with async nonces, batched PYUSD on Sepolia
TipStream lets anyone send instant micro‑tips from Telegram that settle on EVVM (Sepolia). Users register an address, then send /tip or /spam; tips are signed as EIP‑712 “intents” with async nonces. A relayer batches these signed tips and calls EVVM’s execution path (EVVM.execute → adapter → TipVault). The TipVault keeps internal balances per ERC‑20 (demo: PYUSD). Recipients withdraw from Telegram (/withdraw). Why EVVM: we showcase async nonces (out‑of‑order commits) and an external executor/relayer that validates, batches, and executes on a virtual chain—no new infra or nodes.
Contracts (Solidity, Hardhat): TipVault.sol: EIP‑712 tip verification, async nonce bitmap (address→word→bit), internal balances, batch execute, withdraw. EvvmTipAdapter.sol: minimal forwarder called by EVVM.execute to invoke TipVault.executeBatch. Relayer (Node/TypeScript, ethers v6): Verifies inputs, micro‑batches tips (RELAYER_BATCH_MS), routes either direct to TipVault or via EVVM.execute(adapter, calldata). Optional HTTP queue (RELAYER_HTTP_PORT) so the bot and relayer can run as separate processes. Telegram bot (node-telegram-bot-api, ethers v6): Commands: /register, /whoami, /balance, /setkey, /withdraw, /tip 0x…, /tip @username, /spam. Signs EIP‑712 Tip messages with async nonces (timestamp-based) and posts to relayer; optional immediate relay for single-tx demos. In-memory + JSON registry for username↔address and per-user withdraw keys. Tech choices that helped: EVVM execution function cleanly separates user signing, relayer policy, and on-chain execution. Async nonces remove nonce contention, enabling parallel UX and batching. Token‑agnostic vault keeps the demo simple while remaining production‑extensible. Notable hacks: Compact nonce bitmap for O(1) replay checks. Dual queue modes (local/HTTP) for easy demo and realistic split processes. One-click spam burst (/spam) to visibly demonstrate out‑of‑order signing, then batched execution.

