An open protocol for direct stablecoin payments
Peer-to-peer payments on modern chains. No facilitators needed. Full control.
Facilitators were necessary on older chain structures with slow finality and high fees. Modern cutting-edge chains with subsecond finality and low gas fees make direct payments practical.
Payments confirmed in under 1 second on modern chains like Arc
Low gas costs make micropayments viable - no facilitator markup
Modern infrastructure eliminates the need for payment facilitators
Party-to-party payments via smart contracts. No middlemen, no third-party control.
Only network gas fees. No facilitator markup eating into your payments.
Complete control for both parties. Your payments, your rules, your infrastructure.
Cryptographically verified on-chain. No trust required, just cryptographic proof.
Server generates a unique nonce and returns a 402 Payment Required response with payment options
Wallet calls executePayment() with the nonce on the payment smart contract
Smart contract emits PaymentExecuted(nonceHash) event for verification
Server verifies the on-chain event matches the nonce. Access granted instantly (<1s on Arc chain)
const nonceHash = keccak256(encodePacked(['string'], [nonce]));
Supports modern blockchains with CAIP standard compliance
The premier modern chain for x402direct
Layer 2 for Ethereum
Testnet environment
Facilitators were a solution to legacy chain limitations. Modern infrastructure makes them unnecessary.
| Feature | Traditional x402 (Facilitators) | x402direct |
|---|---|---|
| Best For | Older chains with slow finality | Modern chains |
| Payment Speed | Depends on facilitator | <1 second (Arc) ✓ |
| Fees | Facilitator processing fees | Minimal fees ✓ |
| Trust Model | Requires trust in facilitator | Trustless ✓ |
| Control | Centralized | Decentralized ✓ |
Drop-in middleware for Next.js and Express.js
import { x402PaymentMiddleware } from './lib/x402direct';
const X402_CONFIG = {
paymentOptions: [{
chainId: 'eip155:8453',
contractAddress: 'eip155:8453:0xYOUR_CONTRACT',
tokenAddress: 'eip155:8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
payeeAddress: 'eip155:8453:0xYOUR_WALLET',
amount: '1000000', // 1 USDC
budgetId: 'default',
feeTarget: 0,
}],
protectedRoutes: ['/api/premium'],
};
// That's it! Your routes are now protected.