Onchain Trust Records for the Agentic Web
AgentBadge scans any site for agent-readiness, records the result onchain on Base Sepolia, and mints a soulbound trust badge. 40+ deterministic rules, MCP-native, x402 payments.
⚙️ Onchain Workflows (3) ▾
Three onchain workflows power the trust record pipeline:
1. record-scan
Triggered after each AgentBadge scan. Calls TrustRegistry.recordScan() on Base Sepolia with the scan result, site URL, score, and rule breakdown. Creates a permanent onchain trust record.
2. mint-trust-badge
Triggered when scan score ≥ 85. Calls TrustBadge.mint() to mint a soulbound ERC-721 NFT on Base Sepolia. The badge is non-transferable and permanently linked to the scanned site.
3. audit-stream
Long-running workflow that listens for RecordScan events on TrustRegistry and streams them via SSE to the audit trail table. No page refresh needed — rows appear live.
📜 Trust Contracts (2) ▾
Two smart contracts on Base Sepolia (84532) form the onchain trust layer:
TrustRegistry.sol
Base SepoliaStores scan records onchain. Key functions:
recordScan(siteUrl, score, rulesPassed, rulesTotal)— creates a trust recordgetRecord(id)— returns scan data for verificationrecordCount()— total records onchain
Emits RecordScan event → consumed by audit-stream workflow.
TrustBadge.sol
ERC-721 SBTSoulbound (non-transferable) NFT contract. Key functions:
mint(to, siteUrl, score)— mints badge (score ≥ 85 only)tokenURI(tokenId)— onchain metadata JSON_update()— override: revert on transfer (soulbound)
Implements ERC-721 with _update override to prevent transfers.
Contract interaction flow:
AgentBadge Scan
↓ (score + rules)
Onchain Workflow: record-scan
↓
TrustRegistry.recordScan() ──→ emits RecordScan event
↓ ↓
TrustBadge.mint() (if score ≥ 85) audit-stream → SSE → browser
🔧 MCP Tools (6) ▾
Six MCP tools expose the full AgentBadge system to AI agents:
scan
Triggers an AgentBadge scan on a given URL. Returns scan ID, score, and rule breakdown. Supports dry-run mode (no onchain tx).
badge
Checks if a site has a TrustBadge NFT. Returns token ID, mint tx, and onchain metadata if badge exists.
passport
Returns the full agent-readiness passport for a site — all scan results, badges, and trust records in one call.
verify
Verifies an onchain trust record by tx hash. Returns the scan data stored onchain for independent verification.
score
Returns the agent-readiness score for a site. Fast lookup without running a full scan.
search
Search across all scanned sites. Filter by score, grade, or readiness criteria.
Agents discover these tools via the MCP server descriptor at /.well-known/mcp.json and call them directly — no UI needed.
💵 x402 Payment ($0.01/record) ▾
Agents pay for onchain records via the x402 protocol — native HTTP 402 payment:
- Agent calls the
scanMCP tool with premium flag - Server returns 402 Payment Required with x402 challenge
- Agentic Wallet skill signs an EIP-3009 USDC authorization
- Server settles payment and records the scan onchain
- Two onchain receipts: USDC transfer + TrustRegistry record
Cost breakdown: $0.01 USDC per record (gas on Base Sepolia is negligible)
Architecture
Every arrow is one verifiable transaction on Base Sepolia (84532).
Base Sepolia testnet — every arrow is one verifiable tx
⚡ AgentBadge components in this flow ▾
The AgentBadge Scan, Audit Trail + SSE, and TrustBadge mint nodes (dashed border in the diagram) are AgentBadge components:
- AgentBadge Scan — runs a 40-rule agent-readiness scan, produces a score (0-100) and structured report
- Audit Trail + SSE — live server-sent events feed streaming onchain records to the browser in real-time
- TrustBadge mint — when score ≥ 85, mints a soulbound ERC-721 trust badge on Base Sepolia
- Onchain Workflow and TrustRegistry are the onchain execution layer
📋 Step-by-step data flow ▾
- Scan — AgentBadge scans the site URL with 40 agent-readiness rules, producing a score and structured report
- Trigger — Scan result triggers an onchain workflow via webhook (write-contract MCP tool)
- Record — Workflow calls TrustRegistry.recordScan() on Base Sepolia, creating an onchain trust record
- Stream — The onchain record streams live via SSE to the audit trail table (no page refresh needed)
- Mint — If the scan score ≥ 85, a soulbound TrustBadge (ERC-721 SBT) is minted on Base Sepolia
❓ FAQ ▾
What is AgentBadge?
AgentBadge is an agent-readiness scanner with 40+ deterministic rules. It checks any website for MCP compatibility, structured data, AI policies, and more — then records the result onchain as a permanent trust record.
What is a dry-run?
A dry-run preview shows exactly what would be executed onchain (function arguments, workflow name, target contract) without actually sending a transaction. You confirm before anything goes onchain.
What is the TrustBadge?
A soulbound (non-transferable) ERC-721 NFT minted on Base Sepolia when a site scores ≥ 85 on the agent-readiness scan. It serves as a permanent onchain proof of agent-readiness.
How do agents pay?
Agents pay via x402 protocol — a 402 challenge triggers the Agentic Wallet skill to sign an EIP-3009 USDC transfer. Two onchain receipts: payment settlement + trust record.
What is MCP?
Model Context Protocol — an open standard for AI agents to discover and call tools. AgentBadge exposes 6 MCP tools (scan, badge, passport, verify, score, search) that any MCP-compatible agent can call directly.
How it works
Scan
40-rule agent-readiness scan (SSRF-guarded, free dry-run)
Confirm
Dry-run preview shows exactly what lands onchain (functionArgs), then confirm
Record
Workflow executes: TrustRegistry.recordScan onchain, tx on Basescan
Verify
Audit trail (live SSE) + verify MCP tool; agents pay via x402 (USDC)
Try it: scan → onchain record
One POST away from a permanent onchain trust record.
Agents can pay per onchain record via x402 (USDC on Base):
POST /api/keeperhub/scan/premium
Live Audit Trail
Onchain records, streamed as they happen.
No onchain records yet — run the demo above ↑
| Status | Site | Score | Tx | Recorded |
|---|
Source: TrustRegistry on Base Sepolia · each Tx links to Basescan
Stack
API Surface
Every public endpoint and MCP tool.
| Surface | Endpoint / Tool | Auth | Returns |
|---|---|---|---|
| Scan (free) | POST /api/keeperhub/scan | — | dry-run preview or onchain tx |
| Scan (premium) | POST /api/keeperhub/scan/premium | x402 · $0.01 | onchain tx (paid via USDC) |
| Audit API | GET /api/keeperhub/audit | — | events + onchain + Basescan links |
| Live stream | GET /api/keeperhub/audit/stream | — | event: audit frames (SSE) |
| MCP tools | scan · badge · passport · verify · score · search | MCP session | via AgentBadge MCP server |