# x402 vs MPP: the same paid request, traced both ways

> x402 and MPP both turn HTTP 402 into a payment. We paid one API with each and traced it: the headers, who sends the transaction, and what the trace shows.

Source: https://hashspan.dev/learn/x402-vs-mpp

By Selim Aytaç, maintainer · Published Oct 21, 2026

## Short answer

Both protocols answer an unpaid request with 402 and a price, take a payment proof on the retry, and return a receipt. They differ in the headers and in who puts the payment on chain. With x402's exact scheme, the agent signs and a facilitator sends the transaction. With MPP's Tempo charge, the agent signs and the server broadcasts it (pull), or the agent sends it itself (push). In a trace, only push has a send span.

## x402 and MPP at a glance

For readers who don't need the code:

| Question | x402 | MPP (Machine Payments Protocol) |
|---|---|---|
| Who develops it | The [x402 Foundation](https://github.com/x402-foundation/x402), as an open standard | Tempo and Stripe, as an open standard submitted to the IETF ([governance](https://mpp.dev/governance)) |
| How it pays | Tokens on blockchains, such as USDC | Stablecoins on Tempo, cards through Stripe, and other methods |
| Who puts the payment through | A facilitator, which also pays the network fee | The service, or the agent itself |
| Can one service accept both? | Yes, with MPP's tools (mppx), for x402's basic payments on EVM chains | Same answer |

The rest of this page is for developers: the headers, the flows and what each looks like in a trace.

## What do x402 and MPP have in common?

Both turn [HTTP 402 Payment Required](https://hashspan.dev/learn/http-402-payment-required) into a payment flow in three steps:

1. **Challenge.** The server answers the unpaid request with 402 and what it costs.
2. **Credential.** The client pays, or signs a payment, and sends the request again with the proof.
3. **Receipt.** The server checks the payment and answers 200, with a receipt.

Both let an AI agent pay per request, with a stablecoin, and no account with the service. Cards and shop checkouts for agents work differently: see [how AI agents pay](https://hashspan.dev/learn/ai-agent-payments). To compare them on equal terms, we paid one API five times with each, on local chains, priced at 0.001 of a 6-decimal stablecoin.

## How do the headers differ?

From our run, decoded:

| Step | x402 (v2, exact) | MPP (Tempo charge) |
|---|---|---|
| Challenge | `PAYMENT-REQUIRED`: base64 JSON with `scheme`, `network` `eip155:84532`, `amount` `1000`, `payTo` | `WWW-Authenticate: Payment` with `id`, `realm`, `method` `tempo`, `intent` `charge`, `expires`, and a `request` naming `amount` `1000`, `currency` and `recipient` |
| Credential | `PAYMENT-SIGNATURE`: the signed token authorization | `Authorization: Payment` with the credential |
| Receipt | `PAYMENT-RESPONSE`: `success`, `transaction`, `network`, `payer` | `Payment-Receipt`: `status` `success`, `method`, `reference` (the transaction hash), `timestamp` |

MPP builds on an HTTP authentication scheme, `Payment`, written up as an [Internet-Draft](https://datatracker.ietf.org/doc/draft-httpauth-payment/). x402 defines its own headers in its [HTTP transport spec](https://github.com/coinbase/x402/blob/main/specs/transports-v2/http.md). MPP's challenge also carries an `id`, bound to the challenge's parameters, and here an expiry. The credential answers that one challenge.

## Who puts the payment on chain?

This is the biggest difference for an agent, because it decides who needs gas and what you see in a trace.

| Flow | The agent | The transaction is sent by |
|---|---|---|
| x402, exact scheme | signs a token transfer authorization ([EIP-3009](https://eips.ethereum.org/EIPS/eip-3009)) | the facilitator, which also pays the gas |
| MPP, pull | signs the transaction | the server, which broadcasts it |
| MPP, push | signs and sends the transaction | the agent itself |

In pull mode the transaction is still the agent's own, so its fee comes from the agent unless the server sponsors it as fee payer. In push mode, the agent waits for its own transaction before it asks again. In our run, that left the paid request itself at about 4 ms.

## What does each look like in a trace?

Figure: The same paid request three ways, as hashspan traced it. x402 exact: a payment 84532 span, settled and verified, and a confirm 84532 span for the facilitator's transaction, linked to the payment; no send span. MPP pull: a payment 4217 span with mpp.mode pull and a confirm 4217 span linked to it; no send span. MPP push: a send 4217 span for the agent's own transaction, a confirm 4217 span for the same transaction, and a payment 4217 span linked to the send. Paid request, median of 5 on local Anvil: x402 76 ms, MPP pull 18 ms, MPP push 4 ms.

The shape of the trace tells you who sent the transaction:

- **x402 and MPP pull:** a `payment` span and a `confirm` span, and no `send` span. The agent never sent a transaction.
- **MPP push:** a `send` span, as for any transfer, with the `payment` span linked to it.

Either way, the `confirm` span holds the block, the gas and the fee of the transaction that settled the payment.

## Is one faster?

Not in a way a local run can show. Median time of the paid request, over five payments each:

| Median | x402 exact | MPP pull | MPP push |
|---|---|---|---|
| Paid request | 76 ms | 18 ms | 4 ms |
| Whole payment, 402 included | 80 ms | 23 ms | 15 ms |

These are local chains that mine at once, so the numbers show the work around the payment, not a network. On a public chain, every flow waits for a block.

*How we measured: 5 paid requests per flow on 2026-10-21, local Anvil 1.8.3 (instant mining), @x402/core 2.28.0, mppx 0.13.6, @hashspan/x402 1.3.1, @hashspan/mpp 0.1.2, on one laptop. Medians of 5; not a benchmark of the protocols.*

How often the settling client checks for the receipt matters too. In our first run, the x402 facilitator kept viem's default polling for Base, once every 1,000 ms. Every x402 payment took about 1,050 ms. With polling every 50 ms, as on the MPP side, it took 80 ms.

## x402 or MPP: which should I use?

It depends on who you pay, not on speed:

- **The service decides.** An agent pays in the protocol the API asks for. MPP's docs show one endpoint [serving both](https://mpp.dev/guides/use-mpp-with-x402).
- **x402** takes ERC-20 tokens on chains with a facilitator. With EIP-3009 tokens such as USDC, the agent needs no gas, only the token.
- **MPP** offers more than one payment method, Tempo stablecoins and cards through Stripe among them, plus sessions for pay-as-you-go ([MPP payment methods](https://mpp.dev/protocol)).

An agent that meets both can trace both the same way.

## How do I trace both?

**In a hashspan trace:**
Two adapters, one set of attributes. From the run above:

  - `@hashspan/x402` on the x402 client: `payment 84532` with `blockchain.payment.protocol` `x402`, `x402.scheme` `exact`, `blockchain.payment.status` `settled`, `blockchain.payment.verified` `true`
  - `@hashspan/mpp` on the mppx client: `payment 4217` with `blockchain.payment.protocol` `mpp`, `mpp.mode` `pull` or `push`, `mpp.intent` `charge`, `mpp.challenge.id`, and the same status and verified fields
  - in push mode, `@hashspan/viem` on the agent's wallet records the `send`; give both adapters one tracker, so the payment links to it and the transaction gets one confirm span

The [x402 adapter](https://hashspan.dev/docs/adapters/x402), the [MPP adapter](https://hashspan.dev/docs/adapters/mpp) and the [payment attributes](https://hashspan.dev/docs/reference/attributes/payments) list every field.

## FAQ

### Is MPP the same as x402?

No. Both use HTTP 402, but they use different headers and different payment flows. x402 uses PAYMENT-REQUIRED, PAYMENT-SIGNATURE and PAYMENT-RESPONSE. MPP uses the Payment authentication scheme: WWW-Authenticate, Authorization and Payment-Receipt.

### Can one API accept both x402 and MPP?

Yes. MPP's docs show how to serve native MPP clients and x402 clients from the same endpoint with mppx, or add MPP to an existing x402 server.

### Which one is faster?

On our local chain, all three flows settled in tens of milliseconds, and the numbers mostly reflect our setup. On a public network, you wait for a block, and for how often the settling client checks for it. In our first run, the facilitator's default polling alone made each x402 payment take about one second.

### Do I need a different tracing setup for each?

No. hashspan has an adapter for each, @hashspan/x402 and @hashspan/mpp. Both record a payment span with the same blockchain.payment attributes, so one dashboard covers both.
