x402direct

An open protocol for direct stablecoin payments

Peer-to-peer payments on modern chains. No facilitators needed. Full control.

Modern Chains Enable Direct Payments

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.

Subsecond Finality

Payments confirmed in under 1 second on modern chains like Arc

💎

Minimal Fees

Low gas costs make micropayments viable - no facilitator markup

🔗

No Intermediaries

Modern infrastructure eliminates the need for payment facilitators

Payments As They Should Be

🔗

Direct P2P

Party-to-party payments via smart contracts. No middlemen, no third-party control.

💎

Minimal Fees

Only network gas fees. No facilitator markup eating into your payments.

🎯

Full Control

Complete control for both parties. Your payments, your rules, your infrastructure.

🔐

Trustless Verification

Cryptographically verified on-chain. No trust required, just cryptographic proof.

Simple, Secure, Direct

1

Merchant Requests Payment

Server generates a unique nonce and returns a 402 Payment Required response with payment options

2

Customer Pays via Smart Contract

Wallet calls executePayment() with the nonce on the payment smart contract

3

Contract Emits Event

Smart contract emits PaymentExecuted(nonceHash) event for verification

Merchant Verifies & Grants Access

Server verifies the on-chain event matches the nonce. Access granted instantly (<1s on Arc chain)

const nonceHash = keccak256(encodePacked(['string'], [nonce]));

Built for Cutting-Edge Chains

Supports modern blockchains with CAIP standard compliance

FEATURED

Circles Arc Chain

The premier modern chain for x402direct

Subsecond finality
Minimal gas fees
Production ready

Base

Layer 2 for Ethereum

EIP155: 8453
USDC supported
Mainnet ready

Base Sepolia

Testnet environment

EIP155: 84532
Test USDC
Perfect for testing
CAIP Standard Compliant

Why Direct Payments Now?

Facilitators were a solution to legacy chain limitations. Modern infrastructure makes them unnecessary.

FeatureTraditional x402
(Facilitators)
x402direct
Best ForOlder chains with slow finalityModern chains
Payment SpeedDepends on facilitator<1 second (Arc) ✓
FeesFacilitator processing feesMinimal fees ✓
Trust ModelRequires trust in facilitatorTrustless ✓
ControlCentralizedDecentralized ✓

Integrate in 5 Minutes

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.
5min
Setup time
<1s
Payment finality
0
Trust required