KronoScan

AI agents pay per-request for smart contract audits via nanopayments, on-chain escrow & ENS.

KronoScan

Created At

ETHGlobal Cannes 2026

Project Description

KronoScan is an AI-powered smart contract security auditing platform where autonomous agents pay per-request via Circle Nanopayments on ARC blockchain.

An agent deposits USDC into StreamVault, our on-chain escrow contract, then scans a Solidity contract across multiple security categories — reentrancy, access control, arithmetic, business logic, and more. Each category is a separate x402 nanopayment: the seller API returns 402 Payment Required, the agent signs an EIP-3009 authorization via GatewayClient, and Circle batches these sub-cent USDC transfers into a single on-chain settlement. No gas costs, no API keys — just a wallet.

On top of Nanopayments, StreamVault adds what pure x402 doesn't provide: escrow deposits, on-chain consumption tracking via reportConsumption(), identity-conditioned pricing (verified agents get discounted rates computed in basis points on-chain), session top-ups, timeout safety nets, and automatic refunds of unused budget when the session closes.

Service discovery happens through ENS. The name audit.kronoscan.eth resolves to the seller's wallet address, but it also stores the full service interface as on-chain text records — API endpoint, supported categories, pricing, payment protocol, and scan modes. An agent with zero prior knowledge can resolve the ENS name and learn everything it needs to connect and pay. We also register under ENSIP-25, the AI Agent Registry standard, making our audit service discoverable in a decentralized agent directory.

The frontend dashboard shows the full flow in real time: session opening, nanopayments firing per category, vulnerability findings streaming in with severity badges, a live cost counter, budget remaining, and clickable ArcScan transaction links for every single nanopayment. When the session closes, consumed USDC goes to the seller and the remainder is refunded to the buyer — all verifiable on-chain.

How it's Made

The backbone is Circle Nanopayments and the x402 protocol on ARC. The seller API exposes multiple audit category endpoints, each protected by x402 middleware (@x402/express + @circle-fin/x402-batching). When an agent hits an endpoint without payment, it gets a 402 back with pricing terms. The agent uses GatewayClient.pay() which handles the EIP-3009 TransferWithAuthorization signing automatically — one signature per category, batched by Circle into a single on-chain settlement. We built on top of this with variable per-category pricing, so complex analysis like business logic or DeFi costs more than straightforward checks like compiler version. The whole thing runs on ARC where USDC is the native gas token, which means agents only need one currency for everything — payments and gas, no ETH involved.

On-chain, we wrote StreamVault.sol in Solidity 0.8.30 using Foundry. It's the escrow layer that Nanopayments alone doesn't give you — deposits, consumption tracking via reportConsumption(), tiered pricing in basis points, top-ups, session timeout (permissionless, anyone can terminate an expired session), and automatic refund on close. 28 Foundry tests cover the full lifecycle. The coordinator backend (TypeScript + Express + WebSocket) sits in between: it spawns the buyer agent, mediates the x402 payments, reports each consumption on-chain, runs a solvency watchdog every 5 seconds, and pushes real-time updates to the frontend.

For ENS, we went beyond just a pretty domain. audit.kronoscan.eth stores the entire service interface as on-chain text records on Sepolia — API URL, supported categories, pricing, payment protocol, scan modes. The agent calls resolveServiceConfig() which reads all of this from ENS and connects without any hardcoded config. We also register under ENSIP-25 (the AI Agent Registry standard), so the service is discoverable in a decentralized agent directory. There's a setup script (scripts/ens-setup.ts) that does the subname creation + all text record writes in one go.

The AI analysis is real — each category has a specialized prompt sent to DeepSeek's API, with pre-written findings as a reliable fallback. Findings stream back via SSE, get relayed through the coordinator's WebSocket, and land on the React dashboard in real time. Every nanopayment's reportConsumption transaction hash is piped to the frontend, so clicking a vulnerability finding opens the corresponding nanopayment on ArcScan.

One hacky thing worth mentioning: we pre-compile the agent with tsc so the coordinator spawns node dist/agent/src/index.js instead of npx tsx. Shaved the startup time from 20+ seconds down to under 2 — kind of important when your demo is 90 seconds.

Stack: Solidity + Foundry, TypeScript + Express + WebSocket + viem, React + Vite, Circle Nanopayments SDK, ENS (Sepolia), DeepSeek API, ARC testnet.

background image mobile

Join the mailing list

Get the latest news and updates

KronoScan | ETHGlobal