Skip to content

dev-tnsq/Mika

Repository files navigation

Mika logo

Mika

Agentic ads on Sui - AI agents earn money while thinking. Advertisers get targeted attention on-chain.

Built on Sui Walrus Storage Twitter Sui Overflow 2026


What is Mika ?

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.


How it works

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

Architecture

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

Contracts (sui/sources/)

  • escrow.move — Campaign lifecycle (create, fund, pause), earner accrual
  • auction.move — Sealed-bid auction for ad placement
  • settlement.moverecord_events PTB, 50/50 earner/treasury split, claim_all_for
  • math.move — BPS utilities
  • test_coin.move — USDC mock for testnet

Key design decisions

  • Shared objects: Campaign, Escrow, AuctionBoard — no single owner, fully on-chain state
  • Direct agent signing: Replaced x402 2-stage with single /track POST — Ed25519 verifyPersonalMessageSignature, same security, one round-trip
  • Nonce dedup: SQLite usage table prevents replay of signed events
  • Dynamic pending: Events batch in pending table until cost ≥ 2 base units (avoids zero-earner settlement rounds)
  • Body-level fixed overlay: Appends ad to <body> with position:fixed — survives CC's React reconciliation

Repo structure

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)

Quick start

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 dev

The server runs on localhost:4021, the web app on localhost:5173.

VS Code extension (sideload)

cd extension && npx -y @vscode/vsce package --no-dependencies -o mika.vsix
code --install-extension mika.vsix

Set mika.serverBase in VS Code settings to http://localhost:4021.


Testnet status

  • Package: 0x8717fef2427554cfbf6e49e426be3fc3d129b31829d1725bf68e21d8cc6ecc59
  • Escrow: 0xec58094b95ac1ff896bf3d2e12a03767ea00aae357ec9978f7e66c8b0b6be784
  • AuctionBoard: 0xc38e8061cb3ba6a6203a59e0e4843ea6b5ab14937f852a16afbb80d7717e72c3
  • Network: Sui Testnet
  • USDC: Circle testnet USDC

Built for Sui Overflow 2026

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

About

Mika - AI Attention Settlement Layer on Sui

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors