Skip to content

Latest commit

 

History

History
114 lines (94 loc) · 3.74 KB

File metadata and controls

114 lines (94 loc) · 3.74 KB
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.

Why x402r?

Standard x402 payments are immediate and irreversible. x402r adds:

  • Escrow deposits — Funds held in smart contracts until conditions are met
  • Refund windows — Configurable time periods for buyers to request refunds
  • Dispute resolution — Arbiter system for handling contested transactions

How It Works

sequenceDiagram
    participant Client
    participant Merchant
    participant Escrow
    participant Arbiter

    Client->>Escrow: Pay (funds held)
    Escrow-->>Merchant: Payment notification

    alt Happy path
        Merchant->>Escrow: Release funds
        Escrow->>Merchant: Transfer
    else Refund requested
        Client->>Escrow: Request refund
        Merchant->>Escrow: Approve/Deny
        alt Disputed
            Arbiter->>Escrow: Resolve dispute
        end
    end
Loading

Who Is This For?

Request refunds, freeze suspicious payments, and track payment state. Release funds, process refunds, and manage escrow periods. Resolve disputes and approve/deny refund requests.

Get Started

Understand how x402r extends the x402 protocol. Explore the escrow and payment operator contracts. Start building with the TypeScript SDK. Deploy your own PaymentOperator on Base.

Architecture

x402r consists of these core components:

Component Purpose
PaymentOperator Manages payment authorization, release, charge, and refunds with pluggable conditions
AuthCaptureEscrow Holds ERC-20 tokens during the payment lifecycle (from commerce-payments)
Conditions & Recorders Pluggable authorization checks (before action) and state updates (after action)
EscrowPeriod & Freeze Time-based release and freeze policies for buyer protection
RefundRequest Handles refund request lifecycle and approvals

All protocol contracts use unified CREATE3 addresses — same address on every supported chain.

Supported Networks

Network Chain ID Status
Base 8453 Supported
Ethereum 1 Supported
Polygon 137 Supported
Arbitrum One 42161 Supported
Optimism 10 Supported
Celo 42220 Supported
Avalanche C-Chain 43114 Supported
Monad 143 Supported
Linea 59144 Supported
Base Sepolia 84532 Testnet
Ethereum Sepolia 11155111 Testnet

Resources

Source code and examples. SDK documentation and API reference. Get help with integration.