Skip to content

Fix to listing on CDP bazaar indexing#269

Merged
Huygon764 merged 4 commits into
mainfrom
develop
May 18, 2026
Merged

Fix to listing on CDP bazaar indexing#269
Huygon764 merged 4 commits into
mainfrom
develop

Conversation

@Huygon764
Copy link
Copy Markdown
Contributor

No description provided.

gianalarcon and others added 4 commits May 18, 2026 15:12
* docs: add llms.txt intro page for AI agents (#256)

Add a GitBook-friendly page introducing PolyPay's llms.txt support so
non-technical readers can discover the feature and link AI agents to
the live playbook.

- New page docs/llms-txt-for-agents.md covering what llms.txt is, the
  live endpoint, the five integration flows it documents, two ways to
  wire an agent up, and compatibility notes.
- Add the page to docs/SUMMARY.md between x402 and Architecture.
- Fix stale api.polypay.xyz references in docs/x402-deposits.md to the
  real api.polypay.pro host.

* feat(x402): add Coinbase CDP bazaar deposit route for agentic.market listing (#260)

Adds a second x402 deposit endpoint /x402/bazaar/deposit/:multisig that
routes through Coinbase CDP facilitator instead of PayAI, so the resource
gets indexed in CDP discovery and surfaces on agentic.market.

The default /x402/deposit/:multisig path keeps using PayAI (better rate
limits, simpler auth) — no UI change. CDP path activates implicitly when
CDP_API_KEY_ID is set; otherwise it returns a clear config error.

CDP requires Ed25519 JWT signed per-request (2-min TTL), so the service
now lazy-imports @coinbase/x402 createAuthHeader to produce the
Authorization header. Payment requirements for the CDP path also embed a
declareDiscoveryExtension-shaped extensions.bazaar block (strict JSON
Schema), without which CDP would settle but not index.

Includes scripts/bazaar-bootstrap.ts to produce the first real settlement
that triggers CDP indexing — bootstrap must run against a deployed
backend (the resource URL ends up in the catalog).

Refs #259

---------

Co-authored-by: BoHsuu <115441679+Huygon764@users.noreply.github.com>
…dexed (#266)

After the initial bazaar listing rollout, CDP /discovery/merchant?payTo=<addr>
still returned not_found even after a successful mainnet settlement. The
hand-rolled extensions.bazaar block diverged from
@x402/extensions/bazaar.declareDiscoveryExtension in three ways that broke
CDP's strict JSON Schema validation:

- info.input declared a pathParams field the SDK schema does not allow
- schema.required was ['type', 'method'] instead of ['type', 'bodyType', 'body']
- schema.body was a generic { type: 'object' } instead of the body schema

Verified the new shape is byte-identical to the SDK output via stable-key
JSON compare and validateDiscoveryExtension() passes on both. Also log the
EXTENSION-RESPONSES header from CDP settle so silent rejections surface
without another 10-min indexing wait.

Bootstrap script now loads packages/backend/.env via dotenv so we can
invoke it without inline env vars on every run.

Refs #259
#267)

The previous fix tried to populate `paymentRequirements.extensions.bazaar`
for the CDP path. That field is x402 protocol v2; PolyPay still sends
`x402Version: 1` to the facilitator, so CDP silently drops the v2
extension (verified: EXTENSION-RESPONSES header on settle returned
base64('{}') and `/discovery/merchant?payTo=<addr>` stayed not_found
after a successful mainnet settlement).

CDP indexes v1 routes when `paymentRequirements.accepts[*].outputSchema`
has `input.discoverable: true`. This matches what the x402-express
middleware emits for v1 sellers, and is the same shape PayAI already
accepts (PolyPay is already listed in facilitator.payai.network/discovery
via this exact field). Both v1 and v2 entries are still being indexed in
the CDP catalog today (verified directly).

Now both PayAI and CDP paths share the same outputSchema. Drops the
unused `buildCdpBazaarExtension` helper.

Refs #259
CDP Bazaar requires paymentPayload.resource — not just
paymentRequirements.resource — to know which URL to catalog. Quote
from docs.cdp.coinbase.com/x402/bazaar:

  "If your service does not appear in CDP Bazaar discovery, ensure at
  least one successful settlement has completed through the CDP
  Facilitator with paymentPayload.resource set."

The x402 v1 PaymentPayload spec has no resource field, so we only
inject it on the CDP path; PayAI keeps the strict-spec payload shape.

Verified by: 2 successful Base Sepolia settlements with the previous
outputSchema fix completed, but /discovery/merchant?payTo=<addr>
stayed not_found 15+ minutes later. Catalog total kept growing during
that window, so the indexer pipeline was active — only our entries
were dropped, consistent with the missing paymentPayload.resource.

Refs #259
@Huygon764 Huygon764 merged commit 0247a93 into main May 18, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants