Skip to main content

Overview

x402x-facilitator is the “payment processor” for the x402x payment protocol. It verifies payment signatures (verify), performs on-chain settlement (settle), and provides capability queries (supported). It connects your service to the blockchain for a secure and observable payment flow.

Key features

  • Verify: validate signature, amount, and identity — fast and off-chain
  • Settle: submit on-chain transaction and return tx hash (gas sponsored by the Facilitator)
  • Supported: query payment types supported by chains/tokens
  • EIP-7702: support code delegation for merchant addresses
  • Flexible waiting strategy: simulated | submitted | confirmed

Install

Quick start

Core concepts

Verify vs Settle

  • Verify: off-chain, <100ms; validates signature/amount/authorization (recommended before settlement)
  • Settle: on-chain; returns transactionHash; gas is paid by a relayer

Waiting strategy (WaitUntil)

Recipient / Relayer

  • recipientAddress: merchant address (supports EIP-7702)
  • relayer: relayer address (optional, default built-in)

Configuration highlights

  • recipientAddress: merchant address (EIP-7702)
  • waitUntil: “simulated” | “submitted” | “confirmed”

Scenario tips

  • Perform verify before settle for a more robust flow
  • Log settlement failures for reconciliation and compensation

API reference (condensed)

Usage examples

Basic payment flow

Verify-only mode

Dynamic waiting strategy

Best practices

  • Use confirmed by default in production; consider submitted for small amounts
  • Classify and log errors; support reconciliation and retries
  • Use environment variables to manage recipientAddress, API keys, etc.

Resources

  • Source: https://github.com/WTFLabs-WTF/x402x/tree/main/typescript/packages/x402x-facilitator
  • Issues: https://github.com/WTFLabs-WTF/x402x/issues