Golang implementation of an x402 payment facilitator
x402-facilitator is an early-stage Go project in the AI payments / x402 ecosystem, focused on go, golang, x402, x402-facilitator. It currently has 15 GitHub stars and 7 forks, and sits alongside related tools like x402-facilitator-sperax, facilitator, malipo, x402-discovery-index, r402, pay-kit.
x402-facilitator is a Go-based middleware that settles on-chain payments authorized via the x402 protocol.
x402 v2 treats the payment scheme (the on-chain protocol used to move funds) and the network (which chain that protocol runs on) as two independent axes. This facilitator currently supports:
| Scheme | eip155:* (EVM) |
solana:* |
sui:* |
tron:* |
|---|---|---|---|---|
exact |
✅ | 🚧 | 🚧 | 🚧 |
Networks are specified in CAIP-2
format (e.g. eip155:84532 for Base Sepolia, eip155:8453 for Base
mainnet, eip155:42161 for Arbitrum One). The exact scheme supports
both EIP-3009 transferWithAuthorization and Permit2
PermitWitnessTransferFrom payloads on EVM chains; see the --method
flag on x402-client to pick between them.
make build
docker compose up
x402-facilitator is configured via config.toml.
# Port for HTTP server (default: 9090)
port = 9090
# Payment protocol scheme. Currently only "exact" is supported; the
# value is the x402 v2 scheme identifier, not a chain name.
scheme = "exact"
# Network in CAIP-2 format. Examples:
# eip155:84532 — Base Sepolia
# eip155:8453 — Base mainnet
# eip155:42161 — Arbitrum One
network = "eip155:84532"
# RPC endpoint the facilitator uses to verify and broadcast
# transactions on the configured network.
url = "https://sepolia.base.org"
# Private key of the facilitator's fee payer (hex, no 0x prefix).
# Leave empty in the repo; inject via your deployment's secret
# management.
privateKey = ""
After starting the service, open your browser to:
/swagger/index.html
Usage:
x402-client [flags]
Flags:
-A, --amount string Amount to send
-F, --from string Sender address
-h, --help help for x402-client
-m, --method string Payment method (eip3009 or permit2) (default "eip3009")
-n, --network string CAIP-2 network to pay on (default "eip155:84532")
-P, --privkey string Sender private key
-s, --scheme string Payment scheme to use (default "exact")
-T, --to string Recipient address
-t, --token string token contract for sending (default "USDC")
-u, --url string Base URL of the facilitator server (default "http://localhost:9090")
Example:
x402-client -n eip155:84532 -s exact -t USDC -F {0xYourSenderAddress} -T {0xRecipientAddress} -P {YourPrivateKey} -A 1000
We welcome any contributions! Feel free to open issues or submit pull requests at any time.
x402 payment facilitator — verifies and settles EIP-3009 USDC micropayments on Base, Arbitrum, and Ethereum.
Self-hosted x402 payment facilitator server — verifies and settles any ERC-20 token via EIP-7702
Go middleware SDK bridging the x402 HTTP payment protocol to M-Pesa STK Push. Gate any net/http resource behind a real mobile money payment.
A searchable index of x402-enabled APIs for autonomous agents
Rust SDK for the x402 payment protocol.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
Golang SDK for A2A Protocol
Publishes localhost services to the agentic web through self-hostable, trustless relays with x402 payments.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Go implementation of the x402 payment protocol
URL shortener