Repository navigation
Description
Depends on: the payment provider lifecycle contract, the move of rail handling into providers, and the
mppxupgrade.
Context & Rationale
A resource's payments list orders the candidate rails. pickProvider() chooses the first with an enabled provider; the buyer cannot choose. The payment-required outcome exposes one requirement, and _payment is a bare string assigned to the resource's first method. Although x402 and MPP both ship, enabling both on a resource still exposes only one rail.
Proposed Changes
- Give a payment-required outcome an optional list with one offer per enabled rail;
paymentkeeps the first offer. HTTP sendsPAYMENT-REQUIREDandWWW-Authenticate: Paymentin one 402. An MCP tool result carries x402'sPaymentRequiredinstructuredContentbeside MPP's_meta["org.paymentauth/payment-required"]. - Use each spec's carrier to select the rail: x402 and MPP headers on HTTP, their
_metakeys on MCP, and the x402 extension on A2A. The buyer chooses by sending the corresponding proof. - Keep
_paymenta bare string. Each advertised rail says whether the string is in its format: an x402 proof is base64, and an MPP proof is a JSON credential starting with{, orPaymentfollowed by the credential, with the scheme matched case-insensitively. Unless exactly one rail claims the string, reject the request before verification, with the challenges. - Answer a request that carries credentials for two rails with 400.
- Reject an unknown, disabled, unadvertised or mismatched method before verification.
- Honor MPP's optional
Accept-Paymentrequest header. Keep challenges matching a declared range withq>0, order them by the client's preference, and preserve server order for ties. - Bind the AP2 mandate to the selected amount, currency, rail, network, asset and destination.
- Record the selected rail in the receipt and the transaction, and name it in config validation, discovery,
doctorand errors. - Keep MPP challenges over MCP in the tool result's
_meta. MCP2026-07-28forbids emitting-32042, the code the MPP MCP draft uses for a challenge. The support record lists the deviation.
Non-goals / Invariants Preserved
- Fully additive: single-rail configs, the first-offer
paymentfield and the bare_paymentstring keep working. - No fallback to another rail after settlement dispatch, and an unresolved purchase is never paid again on another rail.
- Different amounts or assets are distinct offers. Exchange, split payment and smart routing are out of scope.
- No rail's native challenge format changes.
Impact & Value
Done when buyers can see and choose among rails for one merchant capability, the selected rail appears in the transaction terms and receipt, and authorization and replay protection bind to that offer without merchant-backend changes.
Open question
For MCP and A2A, do we extend _payment into an object with method and proof, or add a sibling field and keep the string for x402 compatibility? The object with a compatibility shim is cleaner, but it touches the frozen contract surface.
Test plan
Use two deterministic providers. Select each rail through its own carrier on HTTP, MCP and A2A. Test _payment claimed by exactly one rail, neither rail and both rails. Credentials for both rails in one request return 400. Check Accept-Payment filtering and ordering, reject a proof for the other rail's offer, and test replay. An AP2 mandate for rail A must be rejected on rail B. Each purchase gets exactly one settlement and one backend call.
Activity
Revinand commentedon Oct 21, 2026
Neither.
_paymentstays a bare string and the frozen contract does not change.Since this issue was opened, the gateway accepts each rail's spec carrier:
_meta["x402/payment"]_meta["org.paymentauth/credential"]and on MCP, the x402 extension on A2A and separate headers on HTTP. Each carrier names its rail, so the buyer selects a rail by sending that rail's proof._paymentis our own carrier. It serves clients that can fill only tool arguments and it is the only way to pay an MPP skill over A2A, since MPP defines no A2A binding. Its format names the rail: an x402 proof is base64, with no space or{; an MPP proof isPayment ...or JSON starting with{. The gateway will route it by format rather than to the resource's first rail. If no advertised rail or more than one, claims the string, it is rejected before verification.Challenges are additive as well: a 402 can carry
PAYMENT-REQUIREDandWWW-Authenticate: Paymenttogether, an MCP tool result can carry both rails' challenges and the envelope gains an optional list of offers besidepayment.A future rail with an overlapping format can use its own carrier; an optional
_paymentMethodfield can be added later without a break.