| title | What is x402r? |
|---|---|
| description | x402r adds escrow deposits, refund windows, and dispute resolution to HTTP-native payments |
| icon | house |
x402r is a refundable payments protocol extension for x402. It enables secure, reversible transactions with built-in buyer protection through smart contract escrow on Base.
Standard x402 payments are immediate and irreversible. x402r adds:
- Escrow deposits: smart contracts hold funds until conditions clear
- Refund windows: configurable time periods for buyers to request refunds
- Dispute resolution: arbiter system for handling contested transactions
sequenceDiagram
participant Client
participant Merchant
participant Escrow
participant Arbiter
Client->>Escrow: Pay (funds held)
Escrow-->>Merchant: Payment notification
alt Happy path
Merchant->>Escrow: Capture funds
Escrow->>Merchant: Transfer
else Refund requested
Client->>Escrow: Request refund
Merchant->>Escrow: Approve/Deny
alt Disputed
Arbiter->>Escrow: Resolve dispute
end
end
x402r consists of these core components:
| Component | Purpose |
|---|---|
| PaymentOperator | Manages payment authorization, capture, charge, void, and refunds with pluggable conditions |
| AuthCaptureEscrow | Holds ERC-20 tokens during the payment lifecycle (from commerce-payments) |
| Conditions & Hooks | Pluggable authorization checks (before action) and state updates (after action) |
| EscrowPeriod & Freeze | Time-based capture and freeze policies for buyer protection |
| RefundRequest | Handles refund request lifecycle and approvals |
All protocol contracts use universal CREATE2 addresses, same address on every supported chain.
Today, the supported chains in @x402r/core are Base and Base Sepolia. More EVMs land as canonical base/commerce-payments@v1.0.0 coverage extends. See Network support for chain IDs and USDC token addresses.