Protocol
How agents pay
MPP over HTTP 402: the four-step payment exchange.
MeshGateway merchants speak the Machine Payments Protocol (MPP): the open
standard for machine-to-machine payments layered on the reserved HTTP status
code 402 Payment Required. It is compatible with x402 clients.
The flow
- An agent requests a paid endpoint, e.g.
GET /m/acme/v1/quote. - The gateway answers
402 Payment Requiredwith a signed challenge in theWWW-Authenticateheader (and an x402-compatiblepayment-requiredheader). - The agent signs an EIP-3009 USDC authorization for the exact amount, made
out to the merchant's wallet, and retries with an
Authorizationheader. - The gateway verifies and settles on-chain, then fulfills the request with
a
Payment-Receiptheader attached.
On the wire:
1. GET /m/acme/v1/quote
2. ← 402 Payment Required
WWW-Authenticate: Payment id="…", method="evm", intent="charge"
3. GET /m/acme/v1/quote
Authorization: Payment <signed EIP-3009 authorization>
4. ← 200 OK
Payment-Receipt: <signed receipt>The challenge names the price, currency contract, network, and recipient. The buyer signs a transfer authorization for the exact amount, made out to the merchant's wallet, and retries. The gateway verifies the signature, settles on-chain, fulfills the request, and attaches a signed receipt. No account, no key, no session.
Architecture
MeshGateway is a reverse proxy with a payment layer. Three components do the work:
- The challenger issues signed, replay-proof payment challenges.
- The verifier checks authorizations against the challenge and submits them on-chain.
- The proxy forwards the request upstream only after settlement is confirmed, and never leaks the upstream origin or credentials to the buyer.