# x402-data-gateway [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/epistemedeus/x402-url-extractor  
**GitHub Stars:** 1  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/x402-data-gateway

## Description
Pay-per-call USDC tools for AI agents (x402/Base): company + wallet enrichment, web read, repo scan.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "x402-data-gateway": {
    "url": "https://smithery.ai/badge/epistemedeus/x402-data-gateway)](https://smithery.ai/servers/epistemedeus/x402-data-gateway"
  }
}
```

## Documentation & README

# SameDayDesk x402 and MPP Data Gateway

## Optional bounded batch extraction

`EXTRACT_BATCH_ENABLED=1` adds `POST /extract/batch` and MCP `extract_batch` at an
introductory 0.01 USDC per admitted batch of 1–5 public HTTPS URLs. The default
is off: 25 paid HTTP operations and 22 MCP tools; enabled: 26 and 23. This price
is not a measured margin guarantee. Use one server process and persistent
`COMMERCE_DATA_DIR`; unknown settlement is quarantined, not automatically charged
again. Bounded partial output does not promise every source or requested field.

The new MCP tool projects the existing HTTP payment and durable replay handler.
Its challenge resource is `https://agents.samedaydesk.com/extract/batch`, not
`mcp://`: first call without payment, then reuse the returned HTTP resource and
exact arguments with `_meta["x402/payment"]`. MPP callers may use the unmodified
`www-authenticate` challenge in result `_meta["samedaydesk/http"].headers` and
send its credential as HTTP `Authorization`. That metadata also carries the
HTTP status and receipt headers. Never translate an MCP-resource credential.
Existing MCP tools retain their existing native MCP payment boundary.

The signed statement declares 25 standard route capabilities in either flag
state (Circle is separate); it does not claim that a disabled route is available
or authorize payment. Live discovery excludes disabled batch extraction.

Every paid HTTP response advertises
`/.well-known/agent-payment-evidence.json` through the standard HTTP
`describedby` link relation. The bounded free manifest joins each exact method
and route to its seller-declared read-only effect, recursively guaranteed JSON
paths, response-schema digest, exact replay binding, receipt behavior, and the
existing signed deployment statement. It does not change x402 or MPP terms and
is not authorization to spend; buyers must still verify the live challenge,
paid output, receipt, and settlement.

[![Smithery listing](https://smithery.ai/badge/epistemedeus/x402-data-gateway)](https://smithery.ai/servers/epistemedeus/x402-data-gateway)

Twenty pay-per-call tools for deterministic agent-work opportunity preflight,
machine-service discoverability, payment-offer preflight, Morpho borrower and
market decisions, protection plans, URL extraction, Markdown reading,
repository security scans, company and wallet enrichment, structured data
generation, transaction receipt evidence, delegated-signer policy conformance,
settlement proof, and AI-search readiness audits.

- Product page: https://samedaydesk.com/x402
- Smithery: https://smithery.ai/servers/epistemedeus/x402-data-gateway
- Remote MCP: https://agents.samedaydesk.com/mcp
- Agent Plugins 1.0 local package: [`plugins/samedaydesk-x402`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/plugins/samedaydesk-x402) (not marketplace-listed)
- Claude Code marketplace: [`.claude-plugin/marketplace.json`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/.claude-plugin/marketplace.json) plus [`plugins/samedaydesk-extract`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/plugins/samedaydesk-extract) (`samedaydesk-extract@samedaydesk-claude`; not an Anthropic official directory listing)
- Goose native config: [`goose/`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/goose/) (YAML, session flag, and deeplink; not a Goose installer)
- Hermes Agent skills: [`hermes/`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/hermes/) plus portable [`plugins/samedaydesk-x402/skills`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/plugins/samedaydesk-x402/skills) (AgentSkills `SKILL.md` drop-in; not a Hermes plugin or installer)
- Live resource manifest: https://agents.samedaydesk.com/.well-known/x402
- OpenAPI: https://agents.samedaydesk.com/openapi.json
- Official MPP OpenAPI: https://agents.samedaydesk.com/mpp-openapi.json
- Skill contract: https://agents.samedaydesk.com/skill.md
- Action catalog: https://agents.samedaydesk.com/api/actions
- A2A agent card: https://agents.samedaydesk.com/.well-known/agent-card.json
- Global A2A Registry: https://www.a2a-registry.org/agent/9cb0b8e6-cb1f-422b-a604-861d0a79e24b
- Settlement Radar: https://agents.samedaydesk.com/platforms
- Platform health JSON: https://agents.samedaydesk.com/v0/cards.json
- Aggregate machine-demand telemetry: https://agents.samedaydesk.com/v0/commerce-demand.json
- Morpho position risk: `GET /defi/morpho-position?address=0x...&shocks=-10,-20,-30`
- Morpho protection quote: `GET /defi/morpho-protection?address=0x...&targetHealthFactor=1.25&protectAgainstShockPct=-10`
- Morpho market underwriting: `GET /defi/morpho-market-underwrite?marketId=0x...`
- Morpho PreLiquidation replay: `GET /defi/morpho-preliquidation-replay?transactionHash=0x...`
- Opportunity preflight: `GET /work/opportunity-preflight?rewardUsd=10&hours=0.25&hourlyCostUsd=4&selectionProbabilityPct=20`
- Agent discoverability audit: `GET /distribution/agent-discoverability-audit?origin=https://example.com&intent=extract+a+public+website+into+structured+JSON&route=/extract&method=GET&runtimeUrl=https%3A%2F%2Fexample.com%2Fextract%3Furl%3Dhttps%253A%252F%252Fexample.org&surfaceAudit=true&materializationAudit=true`
- Payment offer preflight: `GET /commerce/payment-offer-preflight?url=https://example.com/paid-route`
- Seller integrity audit: `GET /commerce/seller-integrity-audit?origin=https://seller.example&route=/paid-route&method=GET&requiredPaths=data.attributes`
  - A buyer may add `referral=r1_<sha256>` derived from its complete seller-signed x402 settlement receipt. This creates a declared acquisition label, not verified proof. `POST /commerce/referral-recheck` accepts that receipt plus one downstream seller-signed settlement receipt from a distinct payer and transaction, then atomically grants at most one free changed-state recheck. The receipts prove neither an application HTTP 200 response nor output delivery or validity, and public posting or broadcasting is optional. A file matching Agent402 PR 1070's observable capture contract (bare pretty JSON receipt, no bundled Agent402 source) is already a drop-in input after ordinary `JSON.parse`; see [`docs/agent-outcome-referral-experiment.md`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/docs/agent-outcome-referral-experiment.md) and `agent402-receipt-interop.test.mjs`.
- Contract-qualified search: `GET /commerce/contract-qualified-search?query=service+domain+ownership+code+provenance&requiredPaths=data.sourceRepository`
  returns a bounded advisory OpenAPI repair plan for missing buyer-required
  paths without mutating seller files or inferring undeclared property types.
- Base USDC settlement proof: `GET /commerce/settlement-proof?transactionHash=0x...&recipient=0x...&amountAtomic=5000`
- Base or Ethereum transaction receipt: `GET /chain/transaction-receipt?transactionHash=0x...&network=base`
- Wallet policy conformance: `POST /security/wallet-policy-conformance`
- Wallet policy conformance contract: `GET /schemas/wallet-policy-conformance-v1.json`
- Stateful wallet policy conformance: `POST /security/stateful-wallet-policy-conformance`
- Stateful wallet policy contract: `GET /schemas/stateful-wallet-policy-conformance-v1.json`
- Material-change alert probe: https://agents.samedaydesk.com/alerts
- Agoragentic seller callback: `POST /integrations/agoragentic/ai-readiness-audit`
- the402 signed fulfillment webhook: `POST /integrations/the402/webhook`

No API key or subscription is required. Every paid HTTP route advertises x402
and native MPP Payment authentication in the same 402 response. Both protocols
settle the same exact USDC amount to the same Base mainnet merchant wallet. MCP
tool calls remain x402-gated.

The Morpho route is read-only. It calculates LTV, LLTV, health factor,
liquidation headroom, and collateral-price shock scenarios from integer protocol
values, then cross-checks indexed collateral, borrow shares, and oracle price
against direct Base RPC state. Scenarios are calculations rather than
probabilities or transaction recommendations. The separate protection route
uses a fresh direct-RPC oracle read and direct confirmation of collateral and
borrow shares to calculate exact partial-repay and add-collateral amounts. It
returns unsigned token-approval and Morpho-call templates, explicit execution
buffers, revalidation requirements, and economic postconditions. It never
accesses a wallet, signs, broadcasts, or takes custody.

The service also keeps a privacy-safe demand telescope on a persistent Railway
volume. It records route families, query key names, challenge/success classes,
and pseudonymous repeat-use signals. External fetches are acquisition signals,
not verified buyers, because unidentified automated indexers can remain.
Recognized crawler and agent-indexer user agents are reduced at ingestion to a
controlled source label and reported in a separate machine-discovery lens with
source and route coverage. Those observations measure fetches, not authenticated
catalog referrals, intent, or demand.
Unmatched requests are reported separately from a conservative semantic-candidate
subset; neither becomes demand until an independent caller repeats or converts.
It does not record raw IP addresses, user
agents, URLs, query values, bodies, payment headers, marketplace payloads, or
credentials. Public output is aggregate only; owner traffic is excluded and
crawler traffic remains excluded from demand even when its controlled discovery
counts are reported separately. Common exploit probes such as `.env`, `.git`,
and WordPress discovery paths are classified as scanner traffic and excluded as
well.

Version 1.9.4 adds explicit paid-traffic classes without exposing buyer
addresses. `COMMERCE_PAYER_CLASSES` accepts a JSON array of `{ "address",
"class" }` records. Controlled classes are `internal`, `validation`,
`incentivized`, `affiliated`, and `independent`. Addresses are converted to the
same secret-keyed payer pseudonyms already used by telemetry and classified at
read time, which also permits retroactive correction without storing a raw
address. Unknown payers remain `unclassified`; unfamiliar wallets never become
independent demand by inference. The public snapshot reports paid success by
class plus independent and repeat-independent actor counts.

Version 1.9.5 adds route-level paid-success counts inside each evidence class.
This lets downstream monitors treat marketplace validation as accounting and
transport evidence, alert on unclassified paid use for investigation, and
advance the demand thesis only for explicitly independent or repeat-independent
buyers.

Version 1.9.6 privately captures a valid Base transaction hash from successful
x402 `PAYMENT-RESPONSE` or MPP `Payment-Receipt` headers after an explicit
evidence baseline. Public telemetry exposes only proof coverage, distinct-count,
and missing-reference counts by payment class. Raw headers and transaction
references stay on the private volume. A missing reference becomes a material
settlement-integrity event without exposing the reference itself.

Version 1.11.2 content-negotiates the root without changing its machine
contract. Browser navigation with an explicit `Accept: text/html` receives a
responsive human map of the fourteen tools, payment flow, and authoritative
discovery links. JSON clients, curl's wildcard accept header, and agents keep
the stable JSON descriptor. The response varies on `Accept`, and the human page
duplicates no payment schema.

Version 1.11.2 also adds the source-attributed machine-discovery lens. It keeps
raw user agents and network addresses out of the public snapshot, reports exact
future indexer observations by controlled source and route, and gives the radar
only first-source and first-route coverage changes as material events. Repeated
crawl volume remains visible data without becoming an attention alert or demand.

Version 1.11.3 makes that reach lens prospective and self-excluding. A distinct
`COMMERCE_AGENT_DISCOVERY_SINCE` baseline prevents pre-instrumentation crawler
history from becoming attributed reach, while SameDayDesk-owned monitor user
agents are excluded from both discovery and external-demand observations. This
keeps integrity sweeps, brand-blind benchmarks, and radar probes from creating
their own acquisition signal.

Version 1.11.4 preserves paying agents even when their user agent identifies as
a crawler or indexer. A valid submitted x402 or MPP credential moves the event
into economic telemetry before crawler classification, while the controlled
user-agent label records source-to-paid conversion by source and route. Channel
labels are still self-declared rather than authenticated referral proof, and
independent demand still requires the explicit payer-class policy.

Version 1.11.5 separates paid-route reach from challenge delivery. Prospective
agent/indexer observations now report paid-route probes, HTTP 402 challenges,
distinct and repeat challenge actors, challenge rate, and controlled source and
route breakdowns. This identifies whether the machine funnel stops before the
paywall, at the challenge, or after a submitted credential without treating an
indexer probe as purchase intent.

Version 1.11.6 adds a conservative challenge-to-payment cohort. A paid success
counts as continuation only when the same secret-keyed network-and-user-agent
actor returns after its first prospective challenge. The public snapshot
reports converted calls, converted actors, independent converted actors,
conversion rate, and controlled source and evidence-class totals without actor
IDs. Network or user-agent drift can only create false negatives, so the metric
is a lower bound rather than an identity claim.

Version 1.11.7 adds project-owned Glama connector verification at
`/.well-known/glama.json` using the public SameDayDesk business email. Glama
requests have their own controlled discovery-source label, so a propagated
directory claim can be measured without becoming demand.

Version 1.11.8 starts a separate credential-attempt funnel. After a declared
baseline, a parseable attempt must include a syntactically complete x402 v2
exact binding or MPP evm/charge credential. Signature validity and settlement
remain later outcomes. Public aggregates separate header noise from parseable
attempts and report protocol, result, route, controlled source, and explicit
payer class without raw credentials, actor IDs, or addresses.

Version 1.11.9 improves MCP tool selection without renaming or duplicating any
tool. Every tool now has a unique action-oriented title. The overlapping web
and company tools explicitly say when to choose `extract` versus `read`,
`enrich` versus `schemaforge`, and the combined `deep_audit`; `wallet_enrich`
also states that its input is an EVM address rather than a company domain. The
payment routes, names, prices, schemas, and handlers are unchanged.

Version 1.11.10 adds explicit descriptions to every `opportunity_preflight`
input and to the three Morpho protection controls. This improves machine call
construction while leaving names, routes, prices, required inputs, defaults,
payment gates, and execution behavior unchanged.

Version 1.11.11 gives all four Morpho MCP tools explicit sibling-selection
guidance. Borrower diagnosis, future protection planning, market underwriting,
and historical PreLiquidation replay are now distinct machine choices without
renaming a tool or changing its route, price, schema, payment gate, or handler.

Version 1.11.12 starts a prospective MCP transport-friction probe. It separates
four common client expectations, `/mcp/sse`, `/mcp/messages`, `/mcp/tools`, and
`/mcp/events`, from arbitrary `/mcp/*` misses without serving a guessed alias.
Public aggregates expose only route counts and secret-keyed actor totals. A
compatibility route is justified only by repeated independent use or conversion.

Version 1.11.13 repairs the pre-payment response contract exposed to machine
buyers. All thirteen routes already authored explicit JSON output schemas, but
the Bazaar v2 helper expects that schema under `output.schema`; the previous
top-level `outputSchema` field was silently ignored. A single tested adapter now
places each authored schema at the protocol-defined location, so an unpaid 402
challenge exposes both the example and the concrete required response fields
before an agent authorizes payment. Routes, inputs, prices, settlement, and
handlers are unchanged.

Version 1.11.14 projects the same thirteen response contracts into the free
OpenAPI and action catalog. Discovery agents can now inspect concrete required
fields and an example before probing a paid route; `/read` is also described as
the JSON object its handler actually returns rather than a raw Markdown string.
One route-keyed contract map drives the x402 challenge, OpenAPI, and action
catalog to prevent the three machine surfaces from drifting apart.

Version 1.11.16 links the versioned, credential-free
[`agent-payment-policy`](https://github.com/epistemedeus/agent-payment-policy)
reference from the machine root, OpenAPI service metadata, and `llms.txt`. The
reference has no wallet executor, payment signer, custody, or hosted paid
verifier. It gives machine buyers a stable policy and evidence primitive without
changing the merchant's routes, prices, payment requirements, or settlement.

Version 1.13.1 advances that machine-facing buyer reference to public package
0.4.0. The root, OpenAPI metadata, and `llms.txt` now advertise exact
execution-shape authorization plus fourteen-dimension control-coverage schema
v2. This follows first-person Tempo and Solana evidence that provider-native
method and instruction allow rules can admit duplicated approved actions. No
merchant route, price, handler, payment requirement, or settlement changes.

Version 1.14.0 turns the cross-chain delegated-signer failure we encountered
into a credential-free paid product. `POST /security/wallet-policy-conformance`
accepts only a bounded standardized allow, deny, and error matrix. It separates
operation allowlisting from exact execution-shape control, credits only an
explicit provider policy denial as provider-native enforcement, and returns
`conformant`, `partial`, or `unsafe` with no opaque score. Invalid or
secret-bearing shapes are rejected before payment. The evaluator accepts no
wallet credential, signature, transaction body, wallet access, or broadcast
authority and does not claim to have executed the caller's provider tests.

Version 1.14.1 publishes the exact standardized cases, evidence classes, input
schema, output schema, method, protocols, and atomic price at the free canonical
`/schemas/wallet-policy-conformance-v1.json` contract. The paid route, price,
decision logic, payment gates, and settlement remain unchanged. Machine clients
can now construct and validate the matrix without decoding a payment challenge.

Version 1.14.2 moves the taxonomy, strict validator, offline evaluator, and JSON
Schemas into public `agent-payment-policy@0.5.0`; the hosted product now imports
that package instead of maintaining a private duplicate. The public package
also provides `wallet-policy-init`, `wallet-policy-check`, and
`wallet-policy-schema` CLI commands. An unrun intended case is correctly
`partial`, while a proven blocked intended action or an allowed mutation remains
`unsafe`. The hosted route, 0.01-USDC price, payment terms, and credential-free
boundary remain unchanged.

Version 1.14.3 advances the public standard dependency to
`agent-payment-policy@0.5.1`. Provider-native control credit now requires every
observed case for that control to pass. A denied optional shape case can no
longer mask an allowed duplicate-approved-action case. The Privy Tempo and
Solana adapters both classify exact execution shape as unverified and the
overall native policies as unsafe, matching the first-person evidence. Route,
price, payment, and credential boundaries remain unchanged.

Version 1.15.0 adds a separate stateful wallet-policy product from the project's
first-person Privy cumulative-cap experiment. `POST
/security/stateful-wallet-policy-conformance` evaluates seven safe standardized
cases for sequential caps, signed-but-unbroadcast accounting, ABI extraction,
concurrent oversubscription, counter-reference failure, and application
serialization. `GET /schemas/stateful-wallet-policy-conformance-v1.json`
publishes the free construction contract. The evaluator comes from public
`agent-payment-policy@0.6.0`, accepts no credentials or raw provider payloads,
and keeps provider-policy and application enforcement separate.

Version 1.15.1 turns first-person stale-catalog evidence into a bounded
discoverability-audit feature. Callers can provide `expectedPriceUsd` together
with an exact route to compare catalog-advertised route prices across the ten
public discovery views. The result distinguishes matched, drifted, mixed,
unknown-price, and absent-route states and returns a one-canary maximum
remediation sequence only after owned live terms agree. It never treats the
caller expectation as runtime truth, makes no catalog payment, and leaves
asynchronous propagation to event-driven monitoring.

Version 1.15.2 repairs the measurement path for the two free wallet-policy
contracts and their matching paid evaluators. All four routes now have exact
commerce classifications. Historical `/schemas/*` events remain in the raw
unmatched count but are excluded from semantic-demand interpretation because
the privacy-safe ledger did not retain enough path detail to reclassify them.
New exact events produce aggregate same-client funnels from successful free
contract read to paid-route challenge, parseable credential, and delivery.
The public snapshot exposes no actor, credential, raw path, wallet, or provider
payload, and contract reads remain reach evidence rather than demand.

Version 1.16.0 upgrades payment-offer preflight from protocol parity alone to
optional catalog-to-runtime coherence. A caller can submit one exact catalog
candidate with the POST or MCP form, and the product compares it only with the
matching live unsigned protocol offer across request, protocol, amount,
network, asset, recipient, and expiry using public
`agent-payment-policy@0.7.0`. Explicit drift produces `review_required`;
missing catalog fields remain a visible partial result. The x402 validity
window is derived from `maxTimeoutSeconds`, malformed catalog input is rejected
before payment, and the request still uses no target credential, wallet,
signature, settlement, redirect, or response body.

Version 1.16.1 upgrades the existing agent-discoverability audit without adding
another product or changing its 0.05-USDC price. An optional `runtimeUrl` must
use the audited origin and exact requested route. The audit makes one
credential-free, DNS-pinned, headers-only request, accepts a price reference
only when the live unsigned x402 and MPP terms are parseable and coherent, and
then compares that canonical Base-USDC amount with every registry observation.
Caller-supplied expectations remain supported and clearly labeled, while a
disagreement with runtime truth becomes its own finding. The result still
signs nothing, sends no target payment, follows no redirect, and reads no target
response body.

Version 1.16.2 adds route-level listing identity to that same audit. Each
catalog observation now reports whether the exact route is canonical,
duplicated, alias-only, or split across canonical and non-canonical origins.
An alias candidate requires an explicit payTo and exact-route match, and the
output states that this does not prove hostname ownership. This catches stale
marketplace aliases and URL-keyed duplicate listings alongside price drift,
while preserving the same 0.05-USDC product, request boundary, and no-spend
catalog sweep.

Version 1.16.3 makes the identity evidence boundary explicit. A
non-canonical record that shares the caller-supplied payTo and exact route is
an alias candidate, not proof that the seller owns the hostname. Every source
now returns `identityBasis`, `ownershipProven`, and a plain-language evidence
boundary so an automated repair can preserve the canonical record without
retiring a third-party endpoint on circumstantial evidence.

Version 1.23.35 extends that existing audit without adding a route or changing
its 0.05-USDC price. With `materializationAudit=true`, an exact GET or POST
route is checked through Coinbase's current seller validator and exact-resource
Bazaar readback. The result distinguishes `materialized`,
`provider_accepted_not_materialized`, `seller_not_provider_eligible`, and
`unresolved` instead of treating every missing ranked result alike. Validation
acceptance remains provider-returned point-in-time evidence, not listing,
demand, settlement, or reindex authority. The opt-in check uses no credential,
signature, or payment; Coinbase may make one unpaid request to the seller using
the requested method.

Version 1.16.4 replaced the route-audit's private identity classifier with the
public, provenance-bearing `agent-payment-policy@0.8.0` primitive. Catalogs
that return no matching records are now still recorded as checked and
`route_absent`; canonical origin matches remain observations rather than
ownership claims. This creates one shared, installable contract for the live
seller and independent buyer tooling without adding credentials, wallet
access, signing, payment, or retained settlement identities.

Version 1.18.3 completes machine-constructible examples for the Base settlement
proof and Solana receipt routes and gives the Circle Gateway alias the same
authored success-response schema as the canonical payment-offer preflight.

Version 1.18.2 publishes recursive response reports under their immutable v2
schema identifier.

Version 1.18.1 adds recursively guaranteed response paths to the bounded report,
so a seller that requires only a top-level `data` envelope does not appear to
promise a nested `data.attributes` decision payload.

Version 1.18.0 keeps the signed catalog-alias identity control and adds a
bounded seller response-contract check to payment-offer preflight. The route
now reads the exact seller's same-origin public OpenAPI document under a strict
size cap and reports whether the exact GET operation declares a self-contained
JSON success schema with typed required fields. It never reads the paid target
body, and the seller declaration remains advisory until a paid response passes
the buyer's independently authorized output validator.

Version 1.22.3 turns seller declarations that exceed the bounded audit byte
ceiling into the specific `openapi_too_large` gap instead of a generic bounded
audit failure. The ceiling remains unchanged and no schema is inferred.

Version 1.22.2 excludes both the canonical SameDayDesk origin and its known
former Railway catalog alias from contract-qualified search. Agent402 ranked
both records for the first live buyer-language query, proving that excluding
only the canonical hostname did not exclude owned supply at the service-
identity level.

Version 1.22.1 adds mandatory MCP selection metadata for the new search tool
and strengthens the production startup smoke test so a release cannot pass
merely because HTTP is listening while the asynchronous MCP mount failed.

Version 1.22.0 adds a paid contract-qualified machine-service search. A buyer
supplies a capability intent and recursively required JSON response paths. The
route searches Agent402 and the official MPP catalog, excludes owned supply and
unresolved routes before audit, and returns bounded machine-buyable or
contract-ready candidates plus controlled rejection codes. It uses no
credential or wallet, sends no seller POST or target payment, reads no paid
body, and returns only a query digest. The signed deployment statement now
binds twenty-three exact HTTP method and path pairs.

Version 1.17.0 closed the catalog-alias ambiguity with an optional signed
deployment statement from `agent-payment-policy@0.9.0`. The short-lived JWS at
`/.well-known/agent-payment-policy-service-deployment.json` binds the canonical
`agents.samedaydesk.com` origin to the then-current paid HTTP method and path pairs
and to the exact Base USDC x402 and MPP settlement identities. Each deployment
origin carries its own route and settlement scope, so a future alias cannot
inherit another origin's authority.

The public Ed25519 key at
`/.well-known/agent-payment-policy-service-deployment.pem` is the same raw key
as the `agentWallet` in SameDayDesk's Solana ERC-8004 registration. The signing
key remains offline and is not deployed. The JWS response stays a strict
envelope; its key and registration pointers use HTTP `Link` headers and the
ERC-8004 registration document. `/healthz` reports the statement ID, key
fingerprint, route count, expiry, and active state so rotation can be monitored.
The statement proves control of that registered key and the declared service
binding. It does not authorize, sign, or send a buyer payment.

Version 1.11.15 validates every Bazaar declaration against its own JSON Schema
before startup. Six newer routes previously settled successfully while Coinbase
rejected their discovery metadata because their output examples omitted fields
marked required by the same schemas. The examples now conform, and
`bazaar-contract-audit.mjs` checks every live CDP Bazaar-eligible paid route
through credential-free HTTP 402 probes without retaining headers or query
values. Alternate x402 settlement rails are reported as explicit exclusions
instead of being misclassified as failed Bazaar declarations.

Version 1.11.18 adds a source-quality funnel to the public aggregate. Each
controlled discovery source now reports observations alongside distinct and
repeat actors at discovery, paid-route, challenge, credential-attempt, and paid
success stages. Challenge rates are available both per request and per actor,
so one high-frequency crawler no longer looks like broad machine reach.
Challenge-to-payment conversions are attributed to the source of the first
observed challenge. Raw user agents, network addresses, and actor identifiers
remain private and are not returned.

Version 1.11.19 starts a separate prospective AI-provider source cohort. It
uses exact provider-published HTTP tokens to distinguish OpenAI, Anthropic, and
Perplexity search, user-fetch, and training traffic plus Google Cloud Vertex
agent crawls. `Google-Extended` is intentionally excluded because Google states
that it has no distinct HTTP user-agent string. The detail cohort has its own
baseline, preserves historical generic records, reports the same actor funnel,
and treats every label as an unauthenticated observation rather than referral
proof.

Version 1.11.20 repairs the resource metadata consumed by payment-capable
wallet agents. Every one of the fourteen x402 v2 challenges now carries the
validated provider-level `serviceName` and five bounded route capability tags
in the standard top-level resource object. Startup fails closed if paid-route
coverage and metadata coverage diverge. The Bazaar contract audit now rejects
a route whose extension is valid but whose resource name or tags are absent or
invalid.
Prices, outputs, settlement, privacy, routes, and native MPP terms are unchanged.

Version 1.12.0 adds `/chain/transaction-receipt` at 0.002 USDC after a live
market experiment found provider-level settlement for cheap chain utilities but
two zero-spend delivery failures from a heavily viewed competing receipt route.
The new route accepts one mined Base or Ethereum transaction hash and returns
normalized status, block time, gas and fee fields, decoded ERC-20 Transfer
events, and canonical USDC transfers. Invalid hashes and unsupported networks
are rejected before payment. Raw logs, wallet access, signing, and broadcast are
outside the product boundary.

Version 1.12.1 repairs the authenticated delivery boundary for the Solana
`/commerce/payment-offer-preflight` storefront. After the Solana gateway has
verified and settled its own x402 or MPP payment, its private internal header
now reaches the deterministic product directly instead of encountering a
second Base payment gate. Requests without the exact private header retain the
ordinary Base x402 and MPP behavior. Target credentials and target payments
remain outside the preflight product boundary.

Version 1.12.2 keeps seller-owned discovery surfaces synchronized with the
canonical paid action catalog. The A2A Agent Card now uses the actual service
version, retains the aggregate catalog skill first, and appends one explicit
discovery-only skill per paid route. The ERC-8004 registration document retains
its protocol entry points and adds the same direct paid action URLs. The A2A
descriptor reuses the canonical aggregate skill ID, and inbound messages must
carry the normative user role, message ID, and at least one part. These changes
improve route discovery but do not claim support for unimplemented A2A task
operations.

Version 1.12.3 turns that discovery lesson into an optional seller audit. Set
`surfaceAudit=true` on the existing paid discoverability route to check whether
the expected route appears in the target's public A2A Agent Card, ERC-8004
registration document, and action catalog. The target fetch is restricted to
three fixed same-origin JSON paths, pins a fully public DNS answer, rejects
redirects, caps each response at 512 KiB, and times out after five seconds. The
default remains catalog-only and does not fetch the target origin.

Version 1.12.4 gives the JSON `POST /work/opportunity-preflight` probe the same
complete Bazaar input and output contract as the existing GET route. This
removes machine-discovery schema errors without changing the price, validation,
handler, response, or payment behavior. Empty unauthenticated POST remains a
discovery-only challenge; a paid call must still supply and bind the required
body.

Version 1.13.0 adds a 0.002-USDC finalized Solana transaction-receipt product.
It validates the signature and any optional mint, recipient, amount, and payer
claim before payment, then returns bounded finalized status, fee, SPL-token
owner deltas, canonical-USDC deltas, and deterministic match findings. It reads
public RPC state only after settlement and has no wallet, signing, custody, or
broadcast authority. The route is available through Base x402, native MPP,
MCP, A2A, and the separate Solana payment gateway.

Version 1.11.23 adds a narrow compatibility bridge for MCP clients that retry a
paid `tools/call` with the x402 `PAYMENT-SIGNATURE` HTTP header but fail to copy
the same signed payload into `_meta["x402/payment"]`. The merchant decodes only
a bounded, object-shaped header on `tools/call`, never overrides canonical MCP
metadata, and passes the result to the existing `@x402/mcp` verifier. The bridge
does not trust the header, change payment terms, or bypass signature, amount,
asset, network, nonce, or settlement validation.

Version 1.11.24 publishes each tool's exact live x402 payment options in MCP
`tools/list` metadata. Compatible clients can inspect price, asset, network,
recipient, and scheme before calling, then attach a fresh signed payload to the
first `tools/call` instead of relying on a challenge retry. Runtime verification
and settlement remain authoritative, and the unpaid challenge path is unchanged.

Version 1.11.26 sharpens the machine-facing selection contract for
`/commerce/payment-offer-preflight`: compare x402 and MPP payment challenges and
terms before buyer authorization. The 0.005-USDC product still accepts one exact
public HTTPS GET URL and returns normalized offers, URL and realm binding checks,
expiry findings, and economic parity. It rejects credentials, local or
non-public targets, unresolved parameters, and redirects, pins a public DNS
result, reads only response headers, never signs or sends a target payment, and
returns no opaque challenge state.

Version 1.11.27 keeps the compact `/skill.md` agent contract synchronized with
the fourteen-route action catalog. It now names payment-offer preflight in its
selection vocabulary and states the target-inspection boundary: no credential,
target signature or payment, redirect, or response-body read. A regression test
keeps this focused buyer-authorization product present in future releases.

Version 1.11.28 removes the manual route-inventory failure mode. The compact
contract now renders and validates every paid action, exact price, and supported
protocol from the canonical machine action catalog. Empty, malformed, or
duplicate action contracts fail closed, so a future route addition cannot leave
the compact agent surface silently stale.

Version 1.11.29 adds a free machine-catalog handoff for AgenticTrade without
placing a second payment gate in front of SameDayDesk. The catalog tells buyers
to call the selected action URL directly, satisfy its route-bound x402 or MPP
challenge, and optionally carry the declared `agentictrade-v1` source label.
That label enters the measured discovery-to-payment funnel, stores no raw token,
and cannot change price, payment, or access.

Version 1.11.30 adds a value-free AgenticTrade proxy diagnostic on the catalog
response. It reports only which `X-ACF-*` header names reached the origin and
whether signature, timestamp, and usage proof fields are present. It never
returns their values, and proxied responses are marked `private, no-store`.

Version 1.11.31 includes the same value-free diagnostic in the proxied catalog
body because AgenticTrade intentionally returns only its own billing headers to
the caller. Direct catalog responses remain unchanged and publicly cacheable.

Version 1.9.7 privately reconciles each post-baseline reference against its
canonical Base receipt. A record is accepted only when the transaction
succeeded, exactly one canonical Base USDC transfer reached the configured
treasury, the atomic amount matches the paid response, and the transfer sender
matches the request payer pseudonym when available. Duplicate references and
all mismatches fail closed. The private mode-0600 ledger retains the reference;
public health and demand output expose only aggregate settlement counts, atomic
amounts by evidence class and route, issue counts, and a generic error state.

Version 1.9 adds same-route MPP `evm/charge` support to all twelve paid HTTP
capabilities without replacing the existing x402 middleware. An unpaid request
now carries both `WWW-Authenticate: Payment` and `PAYMENT-REQUIRED`. Native MPP
credentials use `Authorization: Payment` and successful calls return
`Payment-Receipt`; x402 keeps its Bazaar, payment-identifier, signed
offer/receipt, and `PAYMENT-RESPONSE` extensions. MPP challenges are bound to the
canonical method, path, and sorted query. Both protocols participate in
privacy-safe telemetry and request replay, and OpenAPI 3.1 exposes valid
per-operation `x-payment-info` offers.

Version 1.9.3 generates two registry-specific discovery views from the same
route and price source. `/openapi.json` carries the structured USD price,
protocol declarations, agent guidance, public-route auth declarations, and
truthful response schemas used by AgentCash and MPPScan.
`/mpp-openapi.json` carries official MPP `offers[]` without incompatible flat
fields. Stable operation IDs and capability tags make the public catalog easier
for agents to search, rank, and invoke. Runtime 402 challenges remain
authoritative for both views.

Version 1.23.6 extends request-bound replay to every paid JSON POST route and
binds the replay fingerprint to both the exact previously settled payment
credential and the exact raw request bytes. This lets a lost successful POST
response be replayed without executing the handler or charging again, while a
changed credential, body, input, payer, or payment term fails with an uncharged
HTTP 409. Version 1.23.7 publishes an experimental read-only effect contract at
`/.well-known/paid-action-effects.json`, in each paid POST OpenAPI operation,
and in response headers. It also keeps unpaid paid-POST requests out of
application telemetry, while stating that protocol challenge state may still
exist and that payment-response replay is not business-effect idempotency. No
external standard adoption is claimed. Version 1.8 adds a deterministic paid
opportunity preflight. The caller supplies
reward, execution time, hourly opportunity cost, compute, mandatory spend,
reusable value, competition, and an explicit selection probability. The result
returns `attempt`, `verify_first`, or `abandon`, transparent break-even economics,
hard access and funding gates, and an optional dated Settlement Radar card. It
does not scrape a restricted board or touch a source-platform account, claim,
bid, payment, or submission. Version 1.7 added request-bound idempotent replay
for HTTP buyers that supply the
x402 payment-identifier extension. A successful JSON response is cached for 15
minutes on the private Railway volume. The cache key is an HMAC of the logical
payment ID, and the binding covers the full canonical URL, HTTP method, payer,
network, asset, amount, and recipient. Raw payment IDs, payer addresses, and
request URLs are not stored. An exact retry receives the original response and
signed settlement receipt without a second payment; changed input, payer, or
payment terms return an uncharged HTTP 409. Replays are counted separately from
new paid-success events.

Observed agent crawlers use several discovery conventions. The canonical
manifest remains `/.well-known/x402`, with compatible aliases at
`/.well-known/x402.json`, `/x402.json`, and `/api/x402`. The AgentCash-compatible
OpenAPI document remains `/openapi.json`, with `/openapi.yaml` and
`/swagger.json` returning the same JSON document. Official MPP discovery uses
`/mpp-openapi.json`, with `/openapi.mpp.json` as an alias. `GET /mcp` returns a free transport descriptor;
actual MCP discovery and paid tool calls use streamable HTTP at `POST /mcp`.
Agents that prefer a compact instruction contract can read `/skill.md` (or
`/SKILL.md`), while `/api/actions` returns the thirteen canonical GET actions with
their URL, description, exact atomic USDC price, MIME type, network, and payTo.
Agent Skills clients may send
`X-SameDayDesk-Agent-Source: agent-skills-v1` on the initial request and paid
replay. Telemetry reduces that exact allowlisted value to the public-safe
`agent-skills` label and never stores the raw header. This is declared,
spoofable attribution rather than authentication, and it cannot change price,
payment, or access.
The A2A v1.0 card at `/.well-known/agent-card.json` advertises one bounded free
skill, `discover-x402-paid-actions`. `POST /a2a/message:send` returns that exact
catalog as an A2A direct message, giving A2A clients a standards-based path from
agent discovery to the existing paid x402 actions without claiming arbitrary
task execution.

The repository-root `agent-card.json` is a compatibility manifest for the
Global A2A Registry's current GitHub importer. It points back to the canonical
v1.0 Agent Card and OpenAPI document; it does not replace the production card.
The registry's own generated ownership manifest is hosted separately at
`https://samedaydesk.com/.well-known/agent-card.json`; the standards-compliant
A2A v1.0 card remains canonical on `agents.samedaydesk.com`.

## PreLiquidation shadow watcher

`morpho-preliquidation-shadow.mjs` is the observation-only forward evidence
lane selected by the complete Base census. It watches the five markets that
concentrate historical execution, derives each market's actual PreLiquidation
health threshold from LLTV and pre-LLTV, checks every observed authorization
directly at one explicit Base block, and uses per-contract event cursors.

New execution transactions are replayed through the deterministic archive-RPC
engine, up to 20 per run. The record includes detection latency, gross
loan-asset incentive, and native gas while retaining the explicit boundary that
swap, funding, failure, competition, and MEV costs remain outside the replay.
Positions below the explicit 1 USD debt observation floor are classified as
dust rather than opportunities.

```bash
node morpho-preliquidation-shadow.mjs \
  --state /data/morpho-preliquidation-shadow-state.json \
  --history /data/morpho-preliquidation-shadow-history.ndjson
```

State and history files are forced to mode 0600. A material change means a new
or removed authorization, a transition into or out of the protocol-specific
risk window, a large liquidity or utilization move, or a new verified
PreLiquidation execution. No wallet, signer, authorization, custody, or
principal is part of the watcher.

The Agoragentic callback is a separate marketplace distribution bridge. The
marketplace handles buyer routing, settlement, and seller accounting, while the
callback performs the same production AI-search-readiness audit behind a small
per-IP safety cap. Direct agent customers continue to use the paid x402 route.

The the402 bridge is a second marketplace distribution path. It authenticates
signed job dispatches with timestamped HMAC verification, accepts callbacks only
on the official API origin, and submits a structured audit deliverable for
automatic settlement. `THE402_API_KEY`, `THE402_WEBHOOK_SECRET`, and
`THE402_SERVICE_ID` are Railway-only environment variables.

The same service also hosts two free, disclosed affiliate handoffs used by
fact-checked SameDayDesk guides: `/go/topify` and `/go/manychat`. They mint and
cache Agent Hansa's expiring signed links server-side, validate the redirect
host, expose no API key, and return `noindex, nofollow` plus `no-store`.

## Original rail implementation

A Node/Express server that returns **HTTP 402 Payment Required** when unpaid and
serves the resource after payment, settling **USDC on Base mainnet** straight to
our own wallet:

```
payTo = 0x8904dF3DE6DFEe6a7C8cc38619d2f17806213Cee
```

Verified live (June through August 2026). The server boots and returns correct
402 responses with machine-readable payment requirements. The Morpho canary is
`amount=20000` = 0.02 USDC, `network=eip155:8453`, and
`asset=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` = Base USDC,
`payTo` equal to our wallet, plus a Bazaar discovery extension with input and
output schemas.

---

## Current production decision

| Path | Account/API key? | Base mainnet? | Discovery reach |
|---|---|---|---|
| **CDP facilitator** (`api.cdp.coinbase.com/platform/v2/x402`) | **Yes**, Coinbase CDP account plus `CDP_API_KEY_ID` and `CDP_API_KEY_SECRET` | Yes | **Production default.** CDP Bazaar catalog, merchant lookup, and semantic search after first settlement |
| **xpay public facilitator** (`facilitator.xpay.sh`) | **None** | **Yes** (`eip155:8453`, exact scheme) | Fallback settlement path with self-published discovery only |
| **x402.org public facilitator** (`x402.org/facilitator`) | None | **No**, Base Sepolia testnet only | Separate test catalog at `x402.org/facilitator/discovery/resources` |

Production uses CDP. The first eleven routes passed live CDP verification and
completed a real settlement. The original eight appear in Bazaar merchant
discovery. The three newer Morpho decision routes have successful settlement
receipts, and a distinct funded payer produced `isValid: true` plus Bazaar
extension status `processing` for all three. They still did not enter merchant
discovery after the documented cache window and a fresh settlement, so this is
tracked as a downstream CDP indexing incident rather than a route-metadata
failure. The secret-free reproduction is attached to
[x402 issue #2156](https://github.com/x402-foundation/x402/issues/2156#issuecomment-5229812482).
Keep xpay as the no-key continuity fallback, not as the normal production
facilitator.

The twelfth route, `/work/opportunity-preflight`, is live at 0.05 USDC and
completed an owner-excluded settlement for integration and indexing QA. The
thirteenth route, `/distribution/agent-discoverability-audit`, is live at 0.05
USDC and productizes the brand-blind catalog benchmark used on SameDayDesk
itself. It queries Bazaar, Agentic Market, Agent402, Circle, AgenticTrade, the official MPP
catalog, MPPScan, PayanAgent, x402.jobs, and 8004Market public search without catalog credentials or payments,
preserves registry-native order, and reports coverage, rank, competitors above the target, and
evidence-based next actions as point-in-time observations rather than a
composite score. Bazaar and Agentic Market are explicitly one Coinbase source
family, so the output does not inflate independent reach by counting both views
as separate acquisition channels. PayanAgent is labeled as a dependent
aggregator surface because its catalog includes ecosystem records such as
Coinbase-origin supply; its retrieval rank is useful, but is not independent
underlying supply. 8004Market is labeled as an identity-propagation surface
because it indexes on-chain Solana Agent Registry identities; retrieval there
proves public identity and capability propagation, not a buyer call, settlement,
or independent demand. An optional bounded seller-surface check reports whether one exact
route appears in the target's public Agent Card, ERC-8004 registration, and
action catalog without weakening the default credential-free catalog method.

Version 1.11.42 adds a JSON-body `POST /work/opportunity-preflight` contract for
machine workflow buyers while preserving the existing GET contract and 0.05
USDC price. Empty credential-free HEAD or POST registry probes can inspect the
payment challenge; missing or malformed paid input remains an uncharged 400.
This makes one useful product directly callable from integer-cent workflow
markets without a duplicate route or a misleading price.

Version 1.11.43 adds an exact `GET /work/opportunity-preflight?trial=1` free
sample for machine catalogs. It returns fixed arithmetic with `sample: true`
and `charged: false`, performs no external work, and accepts no caller inputs.
Custom GET and POST calls remain 0.05-USDC payment-gated.

Version 1.11.41 mirrors the canonical x402 v2 `Payment-Required` offer into the
otherwise-empty 402 JSON body for registries that still index the legacy body.
The payment-offer preflight also exposes an equivalent JSON-body POST route for
workflow builders while preserving the validated GET route.

Version 1.11.40 adds x402.jobs as a tenth public search view. The adapter uses a
deterministic, disclosed compact keyword query because x402.jobs search is
lexical rather than semantic, then preserves its public popularity order and
checks the expected target route. SameDayDesk's verified owned server now lists
all fourteen Base routes with a zero-call, zero-value baseline, so later
activity can be measured without calling validation or listing traffic demand.

Version 1.11.39 adds the public x402.jobs server-ownership proof at
`/.well-known/x402-verification.json`. The challenge is a public directory
claim only and grants no API, wallet, or payment authority.

Version 1.11.38 adds a distinct Circle Gateway Nanopayments access path for
payment-offer preflight at the same 0.005-USDC price. It uses the official
`@circle-fin/x402-batching` 3.3.0 seller middleware, advertises
`GatewayWalletBatched` x402 requirements across the networks Circle reports at
runtime, and settles into the seller's Gateway balance. The existing Base
exact, native MPP, MCP, product implementation, and direct routes are unchanged,
so a Gateway outage cannot block them. The main OpenAPI and x402 manifest expose
the alternative path; the MPP OpenAPI does not mislabel it as an MPP route.

Version 1.11.37 adds 8004Market as a ninth public search view in the paid
discoverability audit. It matches the target by durable service origins and
routes embedded in the indexed Solana identity metadata while preserving
8004Market's server-native semantic order.

Version 1.11.36 expands the Solana identity metadata with the real route-level
capabilities and the Base and Solana OpenAPI, skill, x402, and MPP discovery
surfaces after the first frozen 8004Market benchmark exposed zero capability
retrieval from the broader launch description.

Version 1.11.35 adds `/.well-known/agent-registration.json`, a durable
ERC-8004-compatible registration document for the Solana Agent Registry. It
binds the existing MCP and A2A surfaces, the Solana x402 and MPP storefront,
the dedicated Solana settlement wallet, and explicit x402 support. The
on-chain asset identifier is injected only after successful registration, so
the URI stays stable and the document never invents an identity before it
exists.

Version 1.11.34 adds PayanAgent public search as an eighth registry view with an
explicit dependency label. Version 1.11.33 added MPPScan public search; its
public text-search order remains separate from the direct-listing state.
Version 1.11.32 added AgenticTrade; the official MPP flat catalog remains
locally ranked.

The payment-offer preflight route is live at 0.005
USDC. It productizes the buyer-side authorization boundary: fetch the unpaid
headers of one exact public GET route, normalize x402 and MPP offers, verify URL
and realm binding, detect expiry and cross-protocol drift, and return a bounded
decision before the buyer signs the target payment.

---

## How the rail works (why "no account" is safe)

The `exact` scheme settles USDC via an **EIP-3009 `transferWithAuthorization`**:
the buyer (agent) signs an authorization that moves USDC **directly from their
wallet to our `payTo`** on-chain. The facilitator only **verifies the signature
and broadcasts the transaction**; it never holds the money. So:

- Whatever facilitator we pick, the USDC lands in **our** `payTo` wallet.
- We hold the key to `payTo`; the facilitator does not.
- CDP and xpay are non-custodial facilitator paths. CDP relayed the eight live
  seller canaries and the exact USDC amounts reached our wallet.

This is the same rail Frantic used to pay real mainnet USDC to this wallet, so we
already know settlement to `0x8904…3Cee` works.

---

## Answers to the five questions

### 1. Facilitator + autonomy
- The **public x402.org facilitator supports Base Sepolia testnet only**
  (`eip155:84532`); its `/supported` endpoint does **not** list `eip155:8453`.
  Mainnet via x402.org is impossible.
- **Base mainnet settlement does not strictly require a Coinbase CDP account.**
  The **xpay public facilitator (`https://facilitator.xpay.sh`) supports Base
  mainnet `eip155:8453` exact scheme with no account and no API key** (verified
  against its live `/supported` endpoint). This is the fully-autonomous mainnet
  path.
- The **CDP facilitator** requires a CDP account and API keys. Its advantage is
  Bazaar merchant discovery, semantic search, and the Bazaar MCP buyer surface.
- Production chose CDP after a live verify-only matrix and eight successful
  settlements. xpay remains the no-key fallback.

### 2. Exact seller code
See `server.js`. Current package line (NOT the legacy flat `x402-express@1.x`):

```
@x402/express     2.16.0   paymentMiddleware, x402ResourceServer
@x402/core        2.16.0   HTTPFacilitatorClient   (import from @x402/core/server)
@x402/evm         2.16.0   ExactEvmScheme          (import from @x402/evm/exact/server)
@x402/extensions  2.16.0   declareDiscoveryExtension (import from @x402/extensions/bazaar)
@coinbase/x402    2.1.0    createFacilitatorConfig (only needed for CDP mainnet)
mppx              0.8.15   native MPP EVM charge challenge, credential, and receipt support
```

Core wiring:

```js
const facilitatorClient = new HTTPFacilitatorClient(
  createFacilitatorConfig(process.env.CDP_API_KEY_ID, process.env.CDP_API_KEY_SECRET)
);
const resourceServer = new x402ResourceServer(facilitatorClient)
  .register("eip155:8453", new ExactEvmScheme());

app.use(paymentMiddleware(
  { "GET /premium": { accepts: [{ scheme: "exact", price: "$0.01",
      network: "eip155:8453", payTo: "0x8904dF3DE6DFEe6a7C8cc38619d2f17806213Cee" }],
      description: "...", mimeType: "application/json", extensions: { ... } } },
  resourceServer
));
```

### 3. Bazaar discovery
The route's `extensions` uses `declareDiscoveryExtension({ input, inputSchema,
output, outputSchema })` (already in `server.js`). This advertises the route and
its JSON schemas in the 402 payload (verified present in the live response).
**Surfacing in the CDP Bazaar requires the CDP facilitator**: CDP catalogs a
route after its first successful settlement. The production merchant lookup
returns the original eight SameDayDesk routes; all three newer Morpho decision
routes have successful CDP settlements and accepted `processing` Bazaar
extensions, but remain absent beyond the documented cache window. CDP also
finds the original Morpho and deep-audit routes through semantic search. Use the
merchant lookup as evidence of CDP catalog state, not as the canonical count of
SameDayDesk capabilities; the owned manifest, MCP, A2A, and OpenAPI surfaces
remain complete at fourteen.

CDP rejected three older route payloads whose discovery descriptions were 535,
581, and 629 characters even though local extension validation passed. Concise
rewrites of 294, 258, and 301 characters passed. A stock x402 2.22.0 boundary
test later isolated the exact compatibility edge: 501 characters was rejected,
while 500 characters reached facilitator signature verification with all four
extensions intact. Startup and surface tests now reject every resource above
500 Unicode code points. Run live CDP verify before a funded canary.

### 4. Settlement verification
After a paid call, confirm USDC landed at `payTo` on Base mainnet. The 402/200
flow also returns a `PAYMENT-RESPONSE` header with settlement data. Independently:

```bash
# USDC balanceOf(payTo) on Base mainnet via public RPC, no key:
curl -s -X POST https://mainnet.base.org -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{
    "to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "data":"0x70a082310000000000000000000000008904df3de6dfee6a7c8cc38619d2f17806213cee"
  },"latest"]}'
```
Result is hex atomic USDC (divide by 1e6). Or use our existing Base-mainnet
balance checker. Or view the wallet on https://basescan.org/address/0x8904dF3DE6DFEe6a7C8cc38619d2f17806213Cee

### 5. Cleanest recommended path
**Deploy on CDP for the production storefront.** It preserves direct USDC
settlement and adds the catalog, semantic search, merchant lookup, and Bazaar MCP
buyer surface. Keep xpay configured as the no-key recovery path.

---

## Deploy steps (Railway)

The repo is a no-config Node app: `npm start` runs `node server.js` and binds
`process.env.PORT` (Railway sets it).

1. Deploy this directory directly or push the repository source.
2. **Set env vars** on the Railway service:
   ```
   PAY_TO=0x8904dF3DE6DFEe6a7C8cc38619d2f17806213Cee
   NETWORK=eip155:8453
   PRICE=$0.05
   FACILITATOR=cdp
   CDP_API_KEY_ID=<CDP API key ID>
   CDP_API_KEY_SECRET=<CDP API key secret>
   MPP_SECRET_KEY=<random secret of at least 32 bytes>
   COMMERCE_DATA_DIR=/data
   COMMERCE_ACTOR_SECRET=<random 32-byte secret>
   COMMERCE_INTERNAL_TOKEN=<random owner-canary token of at least 32 UTF-8 bytes>
   COMMERCE_MCP_TYPED_SINCE=<ISO timestamp for the accepted typed-MCP producer generation>
   COMMERCE_EXTERNAL_SINCE=<ISO timestamp after controlled launch canaries>
   COMMERCE_AGENT_SOURCE_DETAIL_SINCE=<ISO timestamp after provider taxonomy release>
   COMMERCE_SETTLEMENT_EVIDENCE_SINCE=<ISO timestamp after settlement-proof release>
   COMMERCE_PAYER_CLASSES='[{"address":"0x...","class":"validation"}]'
   ```
   Core payment settings have safe defaults. Production telemetry uses a Railway
   volume mounted at `/data` plus the two secret variables above.

   A release-validation MCP request is attributed only when it supplies the
   exact internal token and one unique
   `x-samedaydesk-validation-marker` matching
   `[A-Za-z0-9._~-]{16,128}`. The stored row contains only the marker's
   domain-separated SHA-256 digest. Never reuse a marker, persist its raw value
   with telemetry, or classify the resulting seller-operational validation row
   as independent demand, settlement, accounting, or revenue.
3. **Generate a public domain** for the service.
4. **Verify:**
   ```bash
   curl https://<your-domain>/healthz          # -> {ok:true, network:eip155:8453, ...}
   curl -i 'https://<your-domain>/defi/morpho-position?address=0x...' # -> HTTP 402 + WWW-Authenticate and PAYMENT-REQUIRED
   ```
5. **Complete one bounded settlement per discoverable route**, then confirm the
   merchant lookup and semantic search. Record owner settlements as test flow,
   not revenue.

### Fall back to xpay without changing route code
If CDP is unavailable and continuity matters more than central discovery, set:
```
FACILITATOR=xpay
```
Redeploy. Base mainnet settlement continues, but new calls no longer feed the
CDP Bazaar quality and activity signals.

### Prove the rail on testnet first (optional)
```
FACILITATOR=testnet
NETWORK=eip155:84532
```
Uses x402.org + Base Sepolia (fake USDC) to validate the full 402→pay→200 loop
before taking mainnet money.

---

## Claude Code marketplace

This repository root is a Claude Code marketplace. The catalog is
`.claude-plugin/marketplace.json`. The self-contained plugin is
`plugins/samedaydesk-extract`. That layout is a different format from the
Agent Plugins 1.0 package in `plugins/samedaydesk-x402`. Keep both.

Ordinary install after this catalog is on the public default branch:

```text
/plugin marketplace add epistemedeus/x402-url-extractor
/plugin install samedaydesk-extract@samedaydesk-claude
```

Then invoke `/samedaydesk-extract:web-extract` with one public HTTPS URL, or
1–5 URLs plus explicit desired fields for batch.
Discovery is unpaid. Payment stays on the live SameDayDesk 402. Existing
scoped buyer authority may be used when it already covers the exact live
method, body, and terms. Listing and install grant none. Unknown payment outcomes reconcile
rather than retry. Installation is not proof of model invocation, payment,
or demand. For already-held extract JSON, invoke
`/samedaydesk-extract:explicit-record` with `--input`, `--mapping`,
`--schema`, and a fresh `--out` directory. That skill does not fetch or pay.
This is not a submission to Anthropic's official plugin
directory. For a credential-free HTTP preflight and explicitly authorized
`@x402/fetch` purchase path against `POST /extract/batch` (default) and
backward-compatible `GET /extract`, including optional before-send unsigned
attempt receipt and read-only reconcile, see
[`examples/customer-x402`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/examples/customer-x402). That example does not
make Claude payment-capable. MCP and HTTP credential scopes remain distinct.

Maintainer checks from the repository root:

```bash
npm run test:claude-marketplace
npm run test:claude-marketplace:live
claude plugin validate .
claude plugin validate ./plugins/samedaydesk-extract --strict
```

Do not put Claude on the system PATH from this repository. Use an already
present or task-local binary. The GitHub `owner/repo` add stays unverified
until the catalog is on the public default branch. Until then, check a local
git clone in a fresh isolated profile, without changing an existing installation:

```bash
export CLAUDE_CONFIG_DIR="$(mktemp -d "${TMPDIR:-/tmp}/samedaydesk-claude.XXXXXX")"
export CLAUDE_CODE_PLUGIN_CACHE_DIR="$CLAUDE_CONFIG_DIR/plugins"
export DISABLE_AUTOUPDATER=1 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN CLAUDE_CODE_OAUTH_TOKEN CLAUDE_API_KEY
claude plugin marketplace add "$PWD" --scope user
claude plugin install samedaydesk-extract@samedaydesk-claude --scope user --yes
claude plugin list --json
```

After inspection, `unset CLAUDE_CONFIG_DIR CLAUDE_CODE_PLUGIN_CACHE_DIR` to stop
using that profile. Temporary files are retained; no cleanup helper is provided.

## Goose native config

Companion Goose `streamable_http` files live in [`goose/`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/goose/). They
do not install Goose, mutate a default profile, or claim merchant
attribution. Paying `POST /extract/batch` or `GET /extract` with a
maintained HTTP client stays in
[`examples/customer-x402`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/examples/customer-x402); Goose install alone is
not payment capability.

Copyable isolated profile, with Goose already installed:

```bash
export GOOSE_PATH_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/samedaydesk-goose.XXXXXX")"
mkdir "$GOOSE_PATH_ROOT/config"
cp goose/goose.config.isolated.yaml "$GOOSE_PATH_ROOT/config/config.yaml"
GOOSE_TELEMETRY_OFF=1 GOOSE_DISABLE_KEYRING=1 goose info -v
```

`goose info -v` reads that isolated config. It does not open the MCP
session. Live unpaid discovery is a separate initialize plus tools/list
check (`npm run test:goose-native:live`). Require `extract` and
`extract_batch` with their live input/output schemas; extra unrelated tools
are accepted. A Goose fixture MCP loader is not part of this repository.

Default YAML sends no source headers. Optional
`goose/goose.config.with-declared-source.yaml` is unauthenticated, not
merchant-allowlisted, and does not claim merchant attribution.

Session flag:

```bash
goose session --with-streamable-http-extension "https://agents.samedaydesk.com/mcp"
```

Deeplink: [`goose/goose.deeplink.txt`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/goose/goose.deeplink.txt).

Maintainer packaging check: `npm run test:goose-native`.
Offline record recipe: `goose/record.recipe.yaml` plus
`goose/record.workflow.md`. When Goose is already installed, validate in a
fresh isolated profile with `goose recipe validate goose/record.recipe.yaml`.
That check is not model execution and does not fetch or pay.

## Hermes Agent skills

Hermes Agent (Nous Research) already loads portable AgentSkills `SKILL.md`
files. This repository does not add a Hermes plugin, MCP YAML, wallet, or
second paywall. The existing extract skill is
[`plugins/samedaydesk-x402/skills/web-extract/SKILL.md`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/plugins/samedaydesk-x402/skills/web-extract/SKILL.md).
The offline page-change recipe is
[`plugins/samedaydesk-x402/skills/page-change/SKILL.md`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/plugins/samedaydesk-x402/skills/page-change/SKILL.md).

Copyable isolated discovery, without touching `~/.hermes` or calling a model:

```bash
export HERMES_HOME="$(mktemp -d "${TMPDIR:-/tmp}/samedaydesk-hermes.XXXXXX")"
HERMES_HOME="$HERMES_HOME" HERMES_AGENT_SRC=/path/to/NousResearch/hermes-agent \
  python3 hermes/check-isolated-loader.py
```

The merchant also serves the three portable skills at the official
well-known index `/.well-known/skills/index.json`. After deploy:

```bash
export HERMES_HOME="$(mktemp -d "${TMPDIR:-/tmp}/samedaydesk-hermes.XXXXXX")"
hermes skills search https://agents.samedaydesk.com --source well-known
hermes skills inspect well-known:https://agents.samedaydesk.com/.well-known/skills/web-extract
hermes skills install well-known:https://agents.samedaydesk.com/.well-known/skills/web-extract --yes
```

`check-isolated-loader.py` requires a fresh empty throwaway profile, copies
the three skills, and uses the official Hermes `agent.skill_utils` discovery
API. It does not install Hermes globally, log into a model provider, open a
wallet, or execute a model. Discovery and payment execution are separate checks.

Project-local `.hermes/skills` or `.agents/skills` inside a git checkout does
not auto-load. Hermes requires `hermes skills trust` for that root. That is
an operator approval gate. This package does not add those directories.

After the skill paths exist on the public default branch, a user who already
has Hermes can also run:

```bash
hermes skills install epistemedeus/x402-url-extractor/plugins/samedaydesk-x402/skills/web-extract
hermes skills install epistemedeus/x402-url-extractor/plugins/samedaydesk-x402/skills/page-change
```

That hub path copies into that user's profile and runs the community security
scan. Do not run it against an already-authenticated profile from this
repository. Paying `POST /extract/batch` or `GET /extract` with a maintained
HTTP client stays in
[`examples/customer-x402`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/examples/customer-x402). That example does not
make Hermes payment-capable. MCP and HTTP credential scopes remain distinct.

Copyable install notes: [`hermes/INSTALL.txt`](https://github.com/epistemedeus/x402-url-extractor/blob/HEAD/hermes/INSTALL.txt).
Maintainer packaging check: `npm run test:hermes-native`.
Official loader proof with `HERMES_AGENT_SRC` set:
`npm run test:hermes-native:loader`. Website-index adapter replay, same isolated
profile rules, never against `~/.hermes` and never with `--force` or
`allow_private_urls`: `npm run test:hermes-native:well-known`.

## Local run

```bash
npm install
npm start
# then:
curl -i 'http://localhost:3000/defi/morpho-position?address=0x...' # HTTP 402
```

## Files
- `server.js` — the server (env-driven facilitator/network/price).
- `commerce-events.mjs` — privacy-safe durable demand telemetry.
- `mpp-dual-stack.mjs` — same-route native MPP authorization and receipt adapter.
- `morpho-position.mjs` — deterministic Morpho snapshot, stress, and RPC checks.
- `morpho-protection.mjs` — exact stressed repair amounts and unsigned action templates.
- `morpho-market-underwrite.mjs` — multi-source market integrity, liquidity, concentration, borrower-health, history, bad-debt, and PreLiquidation evidence.
- `morpho-preliquidation-replay.mjs` — historical PreLiquidate event economics from direct block-state reads.
- `morpho-preliquidation-census.mjs` — repeatable Base supply, authorization, and execution census for internal market selection.
- `package.json` — exact pinned deps (verified to install & boot).
- `.claude-plugin/marketplace.json` — Claude Code marketplace catalog.
- `plugins/samedaydesk-extract/` — self-contained Claude Code plugin (not Agent Plugins 1.0).
- `goose/`: native Goose streamable_http config, extract and record recipes, and workflow copy.
- `hermes/` : isolated Hermes AgentSkills install notes and official loader checker.
- `examples/customer-x402/` — credential-free preflight plus explicitly
  authorized `@x402/fetch` purchase example for `POST /extract/batch`
  (default) and backward-compatible `GET /extract`.
- `README.md` — this guide.
- `extract.mjs` — pre-existing zero-dependency "URL → clean structured data"
  service. This is a natural **paid resource** to put behind `/premium`: in the
  route handler, call its extractor on a `?url=` query param and return the
  structured result instead of the placeholder `{value:42}`. Add `?url` to the
  Bazaar `inputSchema` when you wire it up.

## Sources (primary, verified August 2026)
- x402 seller quickstart: https://docs.x402.org/getting-started/quickstart-for-sellers
- CDP x402 docs: https://docs.cdp.coinbase.com/x402/welcome
- CDP network support (x402.org = testnet only; CDP = mainnet + keys): https://docs.cdp.coinbase.com/x402/network-support
- CDP Bazaar: https://docs.cdp.coinbase.com/x402/bazaar
- x402 monorepo: https://github.com/coinbase/x402
- npm: `@x402/express`, `@x402/core`, `@x402/evm`, `@x402/extensions`, `@coinbase/x402`
- xpay public facilitator live `/supported` (Base mainnet, no key): https://facilitator.xpay.sh/supported

