跳到主要內容

What Is x402? How HTTP 402 Is Making Peer-to-Peer Web Payments a Reality

One-line conclusion: x402 is an open payment standard launched by Coinbase in 2025 that resurrects the long-dormant HTTP 402 "Payment Required" status code, enabling websites to complete peer-to-peer cryptocurrency payments directly within the HTTP request-response cycle — no accounts, no intermediaries, no payment gateways required.

HTTP 402: The Status Code That Waited 25 Years for Its Moment

If you know your HTTP status codes, you're probably familiar with 200 (OK), 404 (Not Found), and 500 (Server Error). But did you know there's a 402 status code?

Back in the 1990s, the HTTP/1.0 specification reserved 402 Payment Required for digital cash and micropayment scenarios — a way for servers to tell clients: "Pay up before you access this resource." For 25 years, it remained virtually unused. The reason? Infrastructure wasn't ready. Payments were slow, expensive, and required accounts, sessions, and intermediaries.

Now, that forgotten status code has finally found its purpose.

x402 protocol logo The official x402 logo. x402 repurposes the HTTP 402 status code for native web payments.

What Exactly Is x402?

x402 is an open, neutral, HTTP-based payment standard launched by Coinbase in 2025. It repurposes the long-unused HTTP 402 "Payment Required" status code to enable peer-to-peer payments directly within the HTTP request-response cycle — no middlemen required.

Supported payment methods include:

  • Cryptocurrencies: USDC (stablecoin) and similar assets
  • Fiat currency: traditional options like credit cards
Per the official x402 specification (x402.org), the core philosophy is: "Payment shouldn't be a disruptive pop-up flow that takes you away from the page — it should be part of the request-response cycle, just like HTTP itself."

AWS has demonstrated how financial institutions can integrate x402 with autonomous AI agents, enabling agents to access premium APIs and data services with instant on-chain settlement, no account setup or intermediary required. Source: AWS Industry Blog


The Three-Phase Payment Flow: How x402 Works

x402's core is a clean three-phase flow built entirely on standard HTTP:

Phase 1: Request and Quote

The client sends a standard HTTP request to the server. If the resource requires payment, the server responds with HTTP 402 instead of 200 OK, along with a JSON quote:

```json

{

"price": "0.01",

"currency": "USDC",

"network": "Base",

"wallet": "0x1234...5678",

"description": "Premium weather data API"

}

```

The quote includes: price (typically in stablecoins like USDC), supported blockchain network (e.g., Base), and a destination wallet address.

Phase 2: Authorization and Verification

The client's cryptocurrency wallet generates a signed payment using the EIP-3009 standard (`transferWithAuthorization`). The client resubmits the HTTP request with the signed payment data in an HTTP header (like `X-PAYMENT` or `PAYMENT-SIGNATURE`). A verification service (or the server itself) validates the signature and confirms the payment parameters match the original quote.

Phase 3: Settlement and Resource Delivery

Once validated, the signed transaction is submitted to the blockchain for settlement. After on-chain confirmation, the server returns HTTP 200 with the requested resource, plus the transaction hash in the `X-PAYMENT-RESPONSE` header for verification.

x402 payment flow diagram The x402 payment flow: from HTTP request to 402 response to payment to 200 OK delivery.

Key Design Features

  • HTTP-native — built directly into HTTP, no extra protocols needed
  • Stateless — no accounts, sessions, API keys, or persistent credentials
  • Cryptographically verifiable — all payment authorizations are signed and on-chain verifiable
  • Instant settlement — stablecoins and fast L2 blockchains enable near-instant verification
  • Backend-agnostic — any server that can return HTTP 402 can adopt the protocol

Technical Standards

  • RFC 9110 — HTTP Semantics and Content
  • EIP-3009 — Permit extensions for ERC-20 tokens
  • EIP-712 — Typed structured data hashing and signing

Use Cases: What x402 Unlocks

x402 enables instant, programmable transactions for scenarios where traditional payment systems fall short:

1. Micropayments

Traditional payment systems struggle with tiny transactions — credit card fees can exceed the transaction value. x402 makes sub-cent transactions (like $0.001) economically viable, ideal for high-volume, low-value exchanges.

2. AI Agent Payments

This is x402's most revolutionary application. Autonomous AI agents can negotiate and execute payments without human intervention. Imagine your AI assistant paying for a research paper, calling a premium API, or renting cloud GPU time — all autonomously.

3. Pay-per-API-Call

Replace traditional API keys and subscription tiers with per-call billing. Developers can design APIs that charge per request — users pay for exactly what they use, no signup required.

4. Machine-to-Machine (M2M) Transactions

IoT devices transacting directly with each other: an electric car paying a charging station, a smart meter paying its water bill, sensor networks paying for data access.

5. Pay-as-You-Go Access

Cloud resources, media content, database queries — all billed by actual usage rather than fixed monthly plans.

6. Autonomous Subscriptions

Software agents handling recurring payments automatically. No manual credit card entry, no expired cards, no payment interruptions.


Advantages and Challenges

x402's Strengths

  • No intermediaries: peer-to-peer, no Stripe or PayPal taking a cut
  • No accounts required: no signup, no login, no personal data
  • Cryptographically secure: all transactions signed and verifiable
  • HTTP-compatible: works with any existing HTTP server
  • Micropayment-friendly: enables transactions traditional processors can't handle
  • Cross-border: cryptocurrency knows no borders — no forex fees, no international wire delays

Current Challenges

  • Wallet adoption: users need an EIP-3009-compatible crypto wallet
  • Blockchain dependency: relies on network speed and availability (though L2s like Base help enormously)
  • Low mainstream awareness: x402 launched in 2025 and is still early in adoption
  • Regulatory uncertainty: varying attitudes toward crypto payments across jurisdictions
Coinbase logo Coinbase developed and champions the x402 standard. As one of the world's largest cryptocurrency exchanges, Coinbase has integrated x402 into its developer platform.

x402 vs Traditional Payments

Speed: Traditional: minutes to days | x402: seconds (blockchain confirmation) Fees: Traditional: 2-5% + fixed fee | x402: minimal (network gas fees) Cross-border: Traditional: high fees, 3-5 days | x402: instant, low cost Identity: Traditional: KYC/accounts required | x402: none needed Refunds: Traditional: reversible/disputable | x402: irreversible (but programmable refunds possible) Best fit: Traditional: medium-large retail | x402: micropayments, machine payments Integration: Traditional: payment gateway SDKs | x402: one HTTP status code

Conclusion: Why x402 Could Change the Internet Economy

x402 isn't just a new payment method — it's a fundamental shift in thinking about money as an HTTP-native capability. When paying becomes as simple as making an HTTP request, the entire web economy changes.

Picture a world where your AI agent pays for information on your behalf, your IoT devices settle their own bills, and your API earns revenue per-call without any subscription plumbing. That's the future x402 promises.

Yes, challenges remain — wallet adoption and regulatory clarity top the list. But as an open standard redefining native web payments, x402 marks a significant step toward mainstream Web3 adoption.

For developers, now is the time to start exploring x402. The next revolution in how the web handles money may begin with a single HTTP status code.


Frequently Asked Questions (FAQ)

Q: What is x402?

A: x402 is an open payment standard launched by Coinbase in 2025 that repurposes the HTTP 402 "Payment Required" status code to enable peer-to-peer cryptocurrency payments directly within the HTTP request-response cycle — no accounts, intermediaries, or external payment gateways needed.

Q: What was HTTP 402 originally for?

A: HTTP 402 was defined in the HTTP/1.0 specification in the 1990s as "Payment Required," originally conceived for digital cash and micropayment scenarios. Due to infrastructure limitations (slow, expensive payments requiring intermediaries), it remained virtually unused for 25 years.

Q: What payment methods does x402 support?

A: x402 primarily supports USDC and other stablecoins, along with other cryptocurrencies and traditional fiat payment methods like credit cards. Transactions typically settle on fast Layer 2 blockchains like Base.

Q: Do users need a crypto wallet?

A: Yes. Users need an EIP-3009-compatible cryptocurrency wallet (like Coinbase Wallet or MetaMask) to sign payment authorizations. This is currently one of the main adoption barriers.

Q: How does the x402 payment flow work?

A: It's a three-phase process: (1) Client requests → server returns HTTP 402 with a price quote; (2) Client's wallet signs the payment → resubmits request; (3) Blockchain confirms → server returns HTTP 200 with the resource. All within a single HTTP interaction.

Q: Is x402 easy for developers to integrate?

A: Very. x402 requires no SDK or payment gateway — the server just needs to return HTTP 402 responses and verify EIP-3009 signatures. Coinbase provides Node.js middleware and other reference implementations.

Q: What are the transaction fees?

A: Minimal. x402 settles on blockchain networks, so fees are primarily network gas costs, typically a few cents or less. Compared to traditional payment processing at 2-5%, x402 is especially attractive for micropayments.

Q: Is x402 secure?

A: Yes. x402 uses EIP-3009 and EIP-712 standards for cryptographic signature verification, with all payment authorizations verifiable on-chain. Security relies on blockchain consensus and elliptic curve cryptography, not on third-party payment gateway security.


Tags: `x402` `HTTP 402` `Payment Required` `Coinbase` `USDC` `micropayments` `Web3` `blockchain payments` `open standard` `AI agent payments` `M2M transactions` `instant payments`

留言