Payments protocol for internet resources, built on HTTP
Top 47.4% on sourcepulse
x402 is an open, internet-native payments protocol designed to replace flawed, high-friction payment systems like credit cards. It enables seamless, low-fee digital payments for web resources, targeting developers building applications for humans and AI agents. The protocol leverages HTTP status codes and headers for integration, aiming for a 10x improvement over existing online payment methods.
How It Works
x402 utilizes the HTTP 402 Payment Required
status code to signal that a payment is needed for a resource. Servers respond with PaymentRequirements
, detailing accepted schemes, networks, and amounts. Clients then construct a PaymentPayload
within the X-PAYMENT
header, specifying their chosen payment method. Facilitator servers can be used by resource servers to verify and settle payments on-chain without direct blockchain interaction, abstracting away complexities like gas fees for clients and resource servers.
Quick Start & Requirements
pnpm install
and pnpm build
in the typescript
directory.pnpm dev
after setting the payment address in .env
.pnpm dev
after setting the payment private key in .env
.Highlighted Details
exact
for EVM chains as the initial scheme./verify
, /settle
, and /supported
endpoints.Maintenance & Community
The project is maintained by Coinbase. Further community engagement details, such as Discord/Slack channels or a roadmap, are not explicitly detailed in the README.
Licensing & Compatibility
The project is licensed under the MIT License, permitting commercial use and integration with closed-source applications.
Limitations & Caveats
The protocol is described as "V1 Protocol," suggesting potential for future breaking changes. While the exact
scheme for EVM chains is detailed, support for other schemes and networks is still under development. The README does not specify testing for non-EVM chains or alternative client/server implementations beyond the provided examples.
2 days ago
1 week