x402 payments in Rust: verify, settle, and monitor payments over HTTP 402 flows
10K+
Production-ready x402 payment facilitator in Rust — verify, settle, and monitor blockchain payments over HTTP 402 flows.
This Docker image runs the x402-facilitator binary, a Rust-based server that handles x402 payment verification and on-chain settlement.
docker pull ghcr.io/x402-rs/x402-facilitator:latest
docker run -v $(pwd)/config.json:/app/config.json -p 8080:8080 ghcr.io/x402-rs/x402-facilitator:latest
docker pull ukstv/x402-facilitator:latest
docker run -v $(pwd)/config.json:/app/config.json -p 8080:8080 ukstv/x402-facilitator:latest
The facilitator requires a config.json file. See config.json.example:
{
"port": 8080,
"host": "0.0.0.0",
"chains": {
"eip155:84532": {
"eip1559": true,
"flashblocks": true,
"signers": ["0xWALLET"],
"rpc": [
{
"http": "https://rpc.com/eip155/84532",
"rate_limit": 50
}
]
},
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": {
"signer": "SOLANA_PRIVATE_KEY",
"rpc": "https://rpc.com/solana/5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
"pubsub": "wss://rpc.com/solana/5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
}
},
"schemes": [
{
"id": "v1-eip155-exact",
"chains": "eip155:*"
},
{
"id": "v2-eip155-exact",
"chains": "eip155:*"
},
{
"id": "v1-solana-exact",
"chains": "solana:*"
},
{
"id": "v2-solana-exact",
"chains": "solana:*"
}
]
}
The facilitator supports the following environment variables (defined in the facilitator crate):
| Variable | Description | Default |
|---|---|---|
HOST | Server bind address | 0.0.0.0 |
PORT | Server port | 8080 |
CONFIG | Path to config file | config.json |
RUST_LOG | Log level (error, warn, info, debug, trace) | info |
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry collector endpoint | — |
OTEL_SERVICE_NAME | Service name for traces | — |
Environment variables override values in config.json.
EIP-155 (EVM), Solana, and Aptos networks are supported. Configure the networks you need in config.json using CAIP-2 chain IDs.
| Network | CAIP-2 ID |
|---|---|
| Base Sepolia | eip155:84532 |
| Base Mainnet | eip155:8453 |
| Polygon | eip155:137 |
| Solana Devnet | solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 |
| Solana Mainnet | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp |
| Aptos Testnet | aptos:2 |
| Aptos Mainnet | aptos:1 |
The facilitator exposes the following HTTP endpoints (as defined in the facilitator crate):
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Server greeting |
/verify | POST | Verify a payment payload |
/settle | POST | Settle a verified payment on-chain |
/supported | GET | List supported schemes and chains |
/health | GET | Health check |
git clone https://github.com/x402-rs/x402-rs.git
cd x402-rs
docker build . -t x402-facilitator
Apache-2.0
Open issues or PRs at https://github.com/x402-rs/x402-rs
Content type
Image
Digest
sha256:4ebe09d82…
Size
41.4 MB
Last updated
3 months ago
docker pull ukstv/x402-facilitator