x402: no way to declare Bazaar discovery, and facilitatorPayment() drops the payload extensions

Aperta
#1,382 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start in x402/server/EvmCharge, where respondChallenge builds PAYMENT-REQUIRED and facilitatorPayment() constructs the /verify and /settle payloads. Trace how the route-binding extension and verified credential are represented, then compare with the @x402/core server behavior cited in the issue. Done means the challenge can carry the discovery declaration and the facilitator receives the echoed extensions and resource fields.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens

A server built on mppx/server with an x402 rail (base: { x402: { facilitator } }) can never be listed in an x402 Bazaar (PayAI's /discovery/resources, CDP's Bazaar), whatever it declares, for two reasons in x402/server/EvmCharge:

  1. The 402 cannot carry a discovery declaration. respondChallenge builds PAYMENT-REQUIRED with extensions = the route-binding extension (mppx) and SIWX only. There is no option to add bazaar (the @x402/extensions declareDiscoveryExtension shape) or the optional resource metadata (description, mimeType, serviceName, tags, iconUrl).
  2. The buyer's echoed extensions never reach the facilitator. facilitatorPayment() rebuilds the payload sent to /verify and /settle as { accepted, payload: { authorization, signature }, x402Version: 2 }, dropping the client's extensions and resource. Bazaar facilitators catalog a resource from exactly those fields of the payment payload on /verify and /settle (PayAI: How listing works), so even a client that echoes a declaration correctly produces no listing.

Seen on 0.22.1 and 0.22.2.

What would fix it
  • An option on the x402 path, for example x402: { facilitator, discovery: { extensions, resource } }, merged into the PAYMENT-REQUIRED body beside the route-binding extension.
  • facilitatorPayment() forwarding the verified credential's paymentPayload.extensions and paymentPayload.resource to the facilitator, as @x402/core servers do. For a route-bound credential the nonce already covers extensions, so forwarding them sends the facilitator nothing the client did not sign.
Context

We run a pay-per-call endpoint on mppx with Tempo and Base (MPP and x402) settling through Stripe's machine payments: GET https://fastgpu.co/api/v1/pay/observations?gpu=h100-sxm answers the 402. MPP discovery (OpenAPI x-payment-info, mpp.dev) works well; this is the one x402 discovery channel we cannot reach without forking the library. Happy to send a PR if the option shape above suits you.

Lingua principale
TypeScript
Stelle
196
Fork
79
Merge medio
15h 20m
PR unite (30g)
156

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wevm/mppx

Tutte le issue di wevm/mppx

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.