Agentic ads on Sui - AI agents earn money while thinking. Advertisers get targeted attention on-chain.
Mika is a decentralized ad exchange purpose-built for the AI agent era. Advertisers create campaigns on Sui, bid in an on-chain auction, and the highest bidder's creative gets served inside your AI coding tools. Every impression and click is tracked via Ed25519-signed attestations and settled on-chain - no middleware, no trusted third party.
The problem: AI agents (Claude Code, Copilot, Cursor) have "thinking" time - loading bars, spinners, waits. That's millions of developer-hours of eye time with no monetization. Mika turns it into a market.
The solution: An on-chain auction → Walrus-hosted creatives → VS Code extension → per-event tracking → 50/50 settlement via Sui programmable transaction blocks.
Advertiser ──creates──► Campaign (on Sui)
│
places bid
│
▼
Auction Board
│
┌────────────────┤
▼ ▼
Highest bid Extension polls
wins serving /ad every 15s
│ │
▼ ▼
Walrus Blob ──► Creative JSON
(image + text) + data: URI image
│
▼
Claude Code overlay
(position:fixed over
the thinking spinner)
│
┌────────────────┤
▼ ▼
Impression Click (user taps)
(15s view ping) Ed25519 signed
│ │
└─────┬──────────┘
▼
Server /track endpoint
(dedup via nonce, daily cap)
│
▼
Pending table (SQLite)
│ (batcher every 15s)
▼
settlement::record_events
(Sui PTB — atomic)
│
┌─────┴─────┐
▼ ▼
Earner (50%) Treasury (50%)
claimable protocol-owned
via escrow USDC pool
| Layer | Technology | Role |
|---|---|---|
| Smart Contracts | Sui Move sui/sources/ |
Campaign lifecycle, auction, escrow, settlement |
| Server | Hono + Suijs | Indexer, /ad auction, /track attestation, settlement batcher |
| Client | React + Vite + Sui dApp Kit | Campaign management dashboard, auction UI, earn page |
| Extension | VS Code extension (ESBuild) | Claude Code / Copilot / Cursor ad injection, click tracking |
| Storage | Walrus (decentralized blob) | Creative JSON + images, served via aggregator |
| Identity | Ed25519 (agents) + zkLogin (web) | Agent address for tracking, Google OAuth for dashboard |
escrow.move— Campaign lifecycle (create, fund, pause), earner accrualauction.move— Sealed-bid auction for ad placementsettlement.move—record_eventsPTB, 50/50 earner/treasury split,claim_all_formath.move— BPS utilitiestest_coin.move— USDC mock for testnet
- Shared objects: Campaign, Escrow, AuctionBoard — no single owner, fully on-chain state
- Direct agent signing: Replaced x402 2-stage with single
/trackPOST — Ed25519verifyPersonalMessageSignature, same security, one round-trip - Nonce dedup: SQLite
usagetable prevents replay of signed events - Dynamic pending: Events batch in
pendingtable until cost ≥ 2 base units (avoids zero-earner settlement rounds) - Body-level fixed overlay: Appends ad to
<body>withposition:fixed— survives CC's React reconciliation
mika/
├── client/ React SPA (Vite) — campaign mgmt, auction, earn page
├── server/ Hono HTTP server — /ad, /track, /campaigns, settlement loop
├── extension/ VS Code extension — injects ads into Claude Code / Copilot
├── sui/ Move smart contracts — campaign, auction, escrow, settlement
├── docs/ Architecture & integration docs
├── scripts/ Dev tooling
├── mika.jpg Project logo
└── vercel.json Vercel deployment config (client)
pnpm install # Install all workspace deps
pnpm -r typecheck # Typecheck all packages
pnpm -r build # Build all packages
# Start server (requires ORACLE_PRIVATE_KEY in server/.env)
cd server && node --import=tsx src/index.ts
# Start web dev server (separate terminal)
cd client && pnpm devThe server runs on localhost:4021, the web app on localhost:5173.
cd extension && npx -y @vscode/vsce package --no-dependencies -o mika.vsix
code --install-extension mika.vsixSet mika.serverBase in VS Code settings to http://localhost:4021.
- Package:
0x8717fef2427554cfbf6e49e426be3fc3d129b31829d1725bf68e21d8cc6ecc59 - Escrow:
0xec58094b95ac1ff896bf3d2e12a03767ea00aae357ec9978f7e66c8b0b6be784 - AuctionBoard:
0xc38e8061cb3ba6a6203a59e0e4843ea6b5ab14937f852a16afbb80d7717e72c3 - Network: Sui Testnet
- USDC: Circle testnet USDC
Mika is a hackathon project. It's not production-ready - the oracle key lives in the server .env, settlement is centralized, and the extension is sideload-only. But the core loop works:
Ad served → agent signs attestation → server verifies → pending accumulates → PTB settles → earner claims USDC
All on-chain. All verifiable. No middleware.
by @tnsq_x · Sui · GitHub