Inspiration AI agents are becoming autonomous workers — reviewing code, summarizing documents, translating content, generating SQL. But they hit a wall the moment money changes hands. Traditional payment rails require human intervention: typing CVVs, approving MetaMask popups, signing into banking portals. An autonomous agent can't do any of that. We asked: what if payment was native to the HTTP protocol itself? The x402 standard (HTTP 402 Payment Required) gave us the answer. Combined with Avalanche's sub-second finality and EVM compatibility, we saw the blueprint for an agent-native economy — where AI services discover, pay, and rate each other on-chain without any human in the loop. But we didn't want this limited to developers with terminals. We built a Telegram bot as the universal interface — chat with AI agents, pay with USDC on Avalanche, manage your wallet, all from a messaging app billions of people already use. What it does Vaxa is an AI Agent Marketplace on Avalanche where every agent interaction is paid and reputation-tracked on-chain.
- 6 AI Service Agents — Code Review ($0.05), Summarizer ($0.02), Translator ($0.03), SQL Generator ($0.04), Regex Generator ($0.03), Code Explainer ($0.02) — all paid in USDC on Avalanche Fuji testnet
- x402 Payment Protocol — payment happens in-band within the HTTP request itself. Agent returns 402 with payment details, client sends USDC on-chain, retries with tx proof, agent verifies and responds. No redirects, no separate checkout flows
- ERC-8004 On-Chain Reputation — every successful transaction updates the agent's reputation score on-chain with diminishing returns (+20 first tx, down to +1 after 50 tx). Buyers can inspect agent quality before paying
- PayAgent — a personal payment agent that manages subscriptions, auto-tips, and donations on your behalf with configurable spend limits (daily/weekly/monthly), blocklists, and reputation gates
- Smart Escrow — lock USDC upfront, agent executes the task, user approves or rejects, funds released or refunded
- Telegram Bot (@vaixa_bot) — access all agents via chat, connect wallet with signature verification, GitHub integration (create issues, list PRs, view repos), inline keyboard menu
- Dashboard — transaction history, spending stats, rule management, wallet overview How we built it Frontend: Next.js 16 App Router, Tailwind CSS v4, RainbowKit v2 + wagmi v3 for wallet connection, deployed on Vercel AI Provider Stack: NVIDIA NIM (Nemotron 49B, primary) with 7-level fallback chain through NVIDIA and OpenRouter models. All use OpenAI-compatible API via the openai npm package. Payment Flow (x402):
- Client calls agent endpoint → receives 402 Payment Required with on-chain payment details
- Client sends USDC via ERC-20 transfer on Avalanche Fuji
- Client retries request with X-Payment-Proof header containing tx hash
- Server verifies tx on-chain (confirm amount, recipient, token), calls recordSuccessfulTx() on ERC-8004 contract, returns AI response Smart Contracts (Solidity, deployed on Fuji 43113):
- MockUSDC (ERC-20) — testnet payment token
- AgentRegistry (ERC-8004) — agent identity + reputation with diminishing returns algorithm
- PaymentProcessor — on-chain payment verification PayAgent: 10-step sequential enforcement engine — checks isPaused → maxSinglePayment → blockedRecipients → allowedRecipients → daily limit → weekly limit → monthly limit → reputation gate → trigger cap → execute. Supports subscription (scheduled), tip (conditional/on-task-complete), donation, and manual rule types. Telegram Bot: Node.js on Railway. Wallet linking via signature verification — bot generates nonce, web app reconstructs message from URL params, user signs in browser, bot verifies with ethers.verifyMessage(). No private keys leave the wallet. Challenges we ran into
- RainbowKit + wagmi v3 dependency hell — RainbowKit v2 requires @walletconnect/ethereum-provider explicitly installed (not listed as peer dep). Meanwhile, wagmi v3 pulls in @reown/appkit* as transitive deps, which crash Next.js 16 Turbopack with ESM/CJS resolution errors. We had to install one explicitly and uninstall the other after every npm install.
- Signature mismatch between bot and web — Bot initially lowercased wallet addresses before building verification messages. Web reconstructed with original case. ethers.verifyMessage() is case-sensitive — signatures always failed. Fixed by passing address through unchanged on both sides.
- useSearchParams() Suspense requirement — Next.js 16 Turbopack throws build errors if useSearchParams() is used without boundaries. Had to wrap every page consuming URL params.
- Railway ephemeral filesystem — Bot stores wallets in data/users.json, but Railway resets filesystem on every deploy. Built a cross-platform persistence layer: bot reads/writes Vercel's /api/users endpoint as fallback.
- Vercel in-memory cold starts — PayAgent store, transaction log, user mapping all use in-memory Maps that reset on hibernation. Acceptable for hackathon scope, but would need a database for production.
- x402 middleware + Turbopack — ethers.js v6 is heavy and causes Turbopack build failures when imported at the top level. Solved by using dynamic import() inside request handlers — zero-ethers at build time, loaded only at runtime.
- Bot webhook mode — grammy's bot.startWebhook() is private. Had to use bot.webhookCallback() with Railway's WEBHOOK_DOMAIN env var for proper webhook integration. Accomplishments that we're proud of
- Full x402 E2E payment flow working on Avalanche Fuji — real USDC transfers, real on-chain verification, real ERC-8004 reputation updates, verifiable on Snowtrace explorer
- 6 production-ready AI agents with transparent per-request pricing, not subscription-locked
- PayAgent with real spend enforcement — configurable limits, whitelists, blocklists, reputation gates, cron scheduler for recurring payments
- Telegram bot that actually works end-to-end — wallet connect via signature verification, AI agent calls with payment, GitHub integration, escrow management
- Diminishing returns reputation algorithm that resists score inflation: $S_{n} = \min(1000,\ S_{n-1} + \Delta_n)$ where $\Delta_n$ decreases as transaction count grows
- Clean, dark UI with sharp corners, consistent design system, responsive across desktop and mobile
- Zero human-in-the-loop for agent payments — the entire x402 flow is machine-to-machine What we learned
- x402 makes payments composable — because payment metadata lives in HTTP headers, any HTTP client can participate. No SDK lock-in, no platform-specific checkout flows.
- On-chain reputation needs careful design — a naive "+1 per tx" inflates forever. Diminishing returns with tiered deltas (+20, +5, +2, +1) creates meaningful score differentiation.
- Agent economics require spend limits — without PayAgent-style guardrails, a buggy agent could drain a wallet in seconds. The 10-step enforcement chain is essential infrastructure, not optional.
- Cross-platform state is hard without a database — syncing wallet mappings and transaction history between Vercel (serverless) and Railway (ephemeral) pushed us to build a shared API layer.
- NVIDIA NIM is fast and cheap for agent workloads — Nemotron 49B handles code review, summarization, translation, and SQL generation well, with sub-second response times on their inference endpoints. What's next for Vaxa
- Persistent storage — migrate from in-memory Maps to PostgreSQL (Vercel Neon) for PayAgent rules, transaction history, and user wallets
- Reputation decay (v2) — scores should slowly decay if an agent goes inactive, keeping the marketplace competitive
- Routing Agent — automatically select the best agent based on price vs. reputation score, enabling true agent-to-agent market dynamics
- Agent-to-Agent composition — Summarizer calls Translator internally via x402, Code Reviewer calls SQL Generator for database-specific reviews
- Mainnet deployment — move from Fuji testnet to Avalanche C-Chain mainnet with real USDC
- More agents — image generation, sentiment analysis, smart contract auditing, DeFi strategy agents
- Agent registry explorer — browse all registered agents, filter by reputation/score/type, with on-chain proof links
Log in or sign up for Devpost to join the conversation.