# Agent Verification Utility

> Deterministic checks over bounded inline JSON with Ed25519-signed evidence. A result proves that declared checks ran; it does not prove real-world truth.

- MCP endpoint: https://agent-economy.kgninja.dev/mcp
- Paid MCP tool: `verify_evidence`
- Free MCP tools: `describe_verify_evidence`, `quote_verify_evidence`, `prepare_verify_evidence_purchase`
- Price: 10000 atomic USDC ($0.01) on Base, network eip155:8453
- HTTP purchase: https://agent-economy.kgninja.dev/verify-evidence
- Free quote: https://agent-economy.kgninja.dev/quote
- OpenAPI: https://agent-economy.kgninja.dev/openapi.json
- Agent manifest: https://agent-economy.kgninja.dev/agent.json
- x402 discovery: https://agent-economy.kgninja.dev/.well-known/x402
- RFC 9727 API catalog: https://agent-economy.kgninja.dev/.well-known/api-catalog
- AI Catalog (draft): https://agent-economy.kgninja.dev/.well-known/ai-catalog.json
- MCP Server Card (current experimental draft): https://agent-economy.kgninja.dev/mcp/server-card
- Cloudflare Agent Readiness MCP Card: https://agent-economy.kgninja.dev/.well-known/mcp/server-card.json
- Legacy compatibility alias: https://agent-economy.kgninja.dev/.well-known/mcp.json
- Agent Skills discovery (draft): https://agent-economy.kgninja.dev/.well-known/agent-skills/index.json
- Markdown service guide: https://agent-economy.kgninja.dev/index.md
- Verification keys: https://agent-economy.kgninja.dev/.well-known/jwks.json
- Public service metrics: https://agent-economy.kgninja.dev/stats
- Operator identity: @kgninja (https://cloudflare.pay/?handle=kgninja)

The Cloudflare Wallet handle is public operator identity. Payment settlement uses x402 and the `payTo` address advertised in the challenge.

MPP clients can consume this service through MPP's x402 compatibility. The server continues to issue and account for x402 challenges; it does not advertise a native MPP challenge.

## Product contract

Input is JSON with a `client_request_id`, base64-encoded JSON evidence, and 1–16 assertions. Supported operations are `sha256_equals`, `json_pointer_exists`, `json_pointer_equals`, and `json_type_is`. Evidence is limited to 65,536 decoded bytes. No external URLs are fetched, no model is invoked, and raw evidence is not retained in D1.

## Preferred agent flow

1. Connect to the Streamable HTTP MCP endpoint.
2. Call `describe_verify_evidence` or `quote_verify_evidence` for free.
3. Call `verify_evidence`. The first response carries an x402 requirement in result metadata.
4. Compare the network, asset, atomic USDC amount, and `payTo` address with the caller's payment policy. If approved, an x402-capable client signs the selected requirement and retries the identical MCP call with `_meta["x402/payment"]`.
5. Verify the returned Ed25519 signature using the advertised JWKS.

The paid MCP tool and the HTTP endpoint share the same quote, payment verification, settlement, replay protection, signed-evidence, and D1 accounting path.

## HTTP fallback

POST a complete request to `/quote` with a unique `Idempotency-Key`. Then POST the same request to `/verify-evidence` with `X-Quote-ID`. On HTTP 402, create the x402 payment payload from `PAYMENT-REQUIRED` and retry with `PAYMENT-SIGNATURE`. Read settlement proof from `PAYMENT-RESPONSE`.

## Trust boundary

The public Market Worker owns protocol validation, x402 settlement, replay protection, and D1 accounting. A separate non-public Verification Core Worker receives work only through a Cloudflare Service Binding and alone holds the Ed25519 private key.
