Skip to main content

Protocol

V0 Demo (Completed)

  • Client SDK wrapper and MCP tool
  • NPM package published
  • Refund request encryption (Lit Protocol)
  • Basic refund flow (cancel, replace, approve/reject)

Protocol V2 (Completed)

  • Switched from proxy pattern to escrow scheme (commerce-payments)
  • PaymentOperator with pluggable conditions and recorders
  • Partial refund support (partial void)
  • EscrowPeriod and Freeze contracts
  • Factory pattern with CREATE2 deterministic deployment
  • ArbiterRegistry for on-chain arbiter discovery
  • Deployed on Base Sepolia and Base Mainnet

Developer Experience (In Progress)

  • Documentation restructure and accuracy fixes
  • LLM-friendly docs with MCP integration
  • Simple “API Down” arbiter template for first merchants
  • CI/CD pipeline for SDK and contracts

Protocol Extensions (Future)

  • Bond-based disputes
  • Multiple arbiter support per operator
  • Post-escrow arbitration handling
  • Reputation system for clients, merchants, and arbiters
  • Arbiter marketplace
  • Token wrapper for enforced refund protection

SDK

Phase 0: Operator Deployment (Completed)

  • Fixed all SDK ABIs to match contracts
  • Factory deployment helpers (deployMarketplaceOperator)
  • Condition composition (AND/OR/NOT combinators)
  • Deterministic address computation (CREATE2)
  • Deployed all contracts on Base Sepolia and Base Mainnet

Phase 1: MVP Examples (Completed)

  • 7 working examples (deploy-operator, merchant-server, merchant-cli, client-cli, arbiter-cli, e2e-dispute, shared)
  • Full e2e dispute resolution flow

Phase 2: Core SDK (Completed)

  • @x402r/client — Refund requests, freeze, escrow period queries, subscriptions
  • @x402r/merchant — Release, charge, refundInEscrow, refundPostEscrow, refund handling
  • @x402r/arbiter — Decision submission, batch operations, registry, AI hooks
  • @x402r/helpersrefundable() helper for payment options
  • @x402r/core — Types, ABIs, config, deploy utilities
  • 316+ tests across all packages

Phase 3: Client UX (Upcoming)

  • Pre-payment info extraction (getOperatorInfo — discover arbiter, escrow period from operator address)
  • Combined freeze + refund (freezeAndRequestRefund — single call)
  • Condition awareness for clients

Phase 4: Subgraph Integration (Upcoming)

  • Deploy subgraph for payment event indexing
  • Implement 8 stubbed methods (getPaymentState, getMyPayments, etc.)
  • Historical payment listing for all roles

Future SDK Work

  • Evidence/metadata system with pluggable backends (IPFS, Arweave)
  • Encrypted communication channels (XMTP)
  • Session-based billing patterns
  • Multi-arbiter support
  • Dedicated Express/Hono middleware

Contract Status

ContractBase SepoliaBase Mainnet
AuthCaptureEscrowDeployedDeployed
ERC3009PaymentCollectorDeployedDeployed
PaymentOperatorFactoryDeployedDeployed
EscrowPeriodFactoryDeployedDeployed
FreezeFactoryDeployedDeployed
RefundRequestDeployedDeployed
ArbiterRegistryDeployedDeployed
ProtocolFeeConfigDeployedDeployed
Condition singletonsDeployedDeployed
All contract addresses are available in @x402r/core via getNetworkConfig(). See the Installation page for details.

Get Involved