Audits NEXUS's own x402 payment logs against its own delivery logs and issues a signed proof-of-deli
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Audits NEXUS's own x402 payment logs against its own delivery logs and issues a signed receipt proving a specific payment correlates with a real, successful service call. NEXUS candidate #13 -- manual build, not FORGE-generated.
POST /verify-payment-receipt {"asset_name": "...", "payer_address": "0x...", "claimed_amount_usd": 0.01, "claimed_at": "2026-08-22T21:31:34Z"}
-- charged $0.02 via x402 (Base mainnet, real USDC).POST /payer-spend-health {"asset_name": "...", "payer_address": "0x..."} -- charged $0.02 via x402.POST /verify-receipt-signature {"receipt": {...}, "signature": "..."} -- free, confirms a
previously-issued receipt is authentic and unmodified.verify_payment_receipt / payer_spend_health at /mcp -- currently free, see "Known limitations".GET /health, GET /.well-known/agent-card.json, GET /openapi.json (has x-payment-info).Originally built and measured on Base Sepolia testnet. Cut over to Base mainnet: x402 settlement moved to
the CDP facilitator (create_facilitator_config(), same swap already applied to
ws/live-entity-verification/erc8004-agent-liveness/onchain-activity-index), and the payto wallet
moved to NEXUS_X402_PAYTO_ADDRESS (fail-fast env var, no placeholder default, renamed from
X402_WALLET_ADDRESS). CDP_API_KEY_ID/CDP_API_KEY_SECRET and NEXUS_X402_PAYTO_ADDRESS must be set
in Cloud Run before this deploys.
revenue_events (x402 payments settled) and traffic_events (HTTP requests served) are two separate,
uncorrelated tables -- neither insert stores a shared ID linking a specific payment to the specific request it
paid for. This asset does the correlation NEXUS itself doesn't otherwise do anywhere: given a claimed
(asset_name, payer_address, claimed_amount_usd, claimed_at), it finds the real matching revenue_events row
(if any) within window_seconds, then checks whether a successful (2xx) traffic_events row for that same
asset landed shortly after that real payment timestamp. The verdict (VERIFIED_DELIVERY /
PAYMENT_NO_DELIVERY / PAYMENT_NOT_FOUND) plus a signed receipt is the product -- not raw access to either
table. Both tables are read through two Postgres SECURITY DEFINER RPC functions
(nexus_verify_payment_receipt, nexus_payer_spend_health) that return only the computed verdict object,
never a row dump -- consistent with this codebase's existing INSERT-only RLS policy on both tables (see
CLAUDE.md SS5). Migration: add_x402_payment_receipt_verification_rpcs (Supabase project ieduhdgfjdeffvzxvihf).
Scope, on purpose: only covers NEXUS's own already-deployed x402 assets (whatever is actually in our own
revenue_events/traffic_events). Auditing a third party's payment claims against a third party's logs was the
original, broader idea (opportunity list item #3, "recibo/prueba de ejecucion verificable para pagos entre
agentes") and was explicitly flagged there as carrying legal/dispute-liability risk from acting as an
arbiter between two other parties. Narrowing scope to our own already-public asset catalog sidesteps that
entirely -- there is no third party whose claim we're adjudicating, only our own already-settled data.
revenue_events.asset_name is not consistently kebab-case across the existing catalog -- e.g. the
similarity-search asset's real stored value is "Similarity Search API" (display-cased), not
similarity-search-api. Callers must pass the exact string as stored, or the RPC correctly (not a bug) returns
PAYMENT_NOT_FOUND. As of this writing, real values seen in revenue_events: document-conversion-api,
live-entity-verification, agent-verification-api, url-metadata-api, Similarity Search API, ws.
signature is an HMAC-SHA256 (hex) over the canonical JSON encoding of receipt, keyed by
NEXUS_RECEIPT_SIGNING_KEY. This is not an offline-verifiable signature (that would need asymmetric
crypto + a published public key -- deliberately left out, see "Known limitations"): a holder proves a receipt
is authentic by calling this asset's own free POST /verify-receipt-signature, which re-checks the HMAC
server-side. Rotating NEXUS_RECEIPT_SIGNING_KEY invalidates every receipt issued under the old key.
Same pipeline as candidates #4/#3/#6 -- see skills/infra-deploy-ops.
url-metadata-api, agent-verification-api, document-conversion-api).revenue_events nor traffic_events
stores a shared correlation ID at insert time, so VERIFIED_DELIVERY means "a successful request to this
asset landed within the window after this payment", not "this exact request was paid for by this exact
transaction". On a low-traffic asset this is effectively exact; on a hypothetical high-traffic asset with
many concurrent callers it would be ambiguous -- candidate_successful_calls (surfaced directly on the
receipt, see PaymentReceipt in main.py) would show >1 in that case. None of the 6 assets covered had
concurrent traffic dense enough for this to matter as of 2026-08-23.x402's (2.15.0, the pinned version) PaymentMiddlewareASGI source before writing that. It already
implements verifyβexecuteβsettle-only-on-2xx: verify_payment (no funds move) runs before the handler via
call_next(request); when the handler returns β₯400 or raises (exactly what happens here --
_verify_payment_receipt_core re-raises _NexusRpcError as HTTPException(502/503/504) on a Supabase
failure), the middleware calls dispatcher.cancel() and never calls process_settlement() -- no
charge. Confirmed empirically (real app + real PaymentMiddlewareASGI + mocked facilitator, forcing an
HTTPException(504)): 0 settle()/on_after_settle calls on failure, 1 on a 200. No code change needed --
the architecture was already correct.anon (required for PostgREST to
expose them at all) -- a leaked SUPABASE_ANON_KEY lets someone call them directly at
/rest/v1/rpc/nexus_verify_payment_receipt, bypassing this asset's x402 charge. Accepted: the RPCs only
return correlation verdicts about NEXUS's own already-public asset catalog, nothing sensitive is exposed by
the bypass itself, only the paywall is bypassed. Same risk category as every other Supabase anon-key use in
this codebase.Same 2-agent process as candidates #3/#4/#6 (security lens; functional+quality+buyer-experience lens), run post-deploy this time -- the review was still in progress when the account's monthly spend limit cut the session overnight, resumed and finished the next session. Real findings, applied:
POST /verify-receipt-signature had no x402 gate and no size/depth bound,
so it hashed an arbitrary caller-supplied receipt dict for free -- a cheap cost/availability nuisance, not
a serious vuln. Fixed: rejects >4096-byte or >10-level-deep bodies with 400/413 before any hashing
(_validate_receipt_shape, _MAX_RECEIPT_BYTES/_MAX_RECEIPT_DEPTH in main.py).PaymentMiddlewareASGI, not a real bug -- see "Known limitations" above for the
empirical proof. No code change was needed.payTo class from candidate #4, IP truncation,
injection surface) came back clean -- confirmed, not just claimed, by re-reading the relevant code paths.ctx: Context = None MCP-tool param
(matches the same unused-param convention already present in agent-verification-api/main.py, not a
deviation worth fixing here) and silent clamping of window_seconds/lookback_days on the MCP path only
(REST already rejects out-of-range via Pydantic; the MCP path echoes the substituted value back in the
receipt, so it's discoverable, just not an explicit error -- no evidence yet that this needs a gate).No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/x402-receipt-verifier)<a href="https://allmcps.com/mcp/x402-receipt-verifier"><img src="https://allmcps.com/api/badge/x402-receipt-verifier?style=directory" alt="X402 Receipt Verifier on AllMCPs" /></a>