x402 Facilitator
The SBC facilitator is a hosted service that verifies and settles x402 payments. It never holds funds — it receives a signed authorization from the payer and executes the on-chain transfer atomically.
Base URL: https://x402.stablecoin.xyz
Mainnet requires an API key (X-API-Key header). Get yours at dashboard.stablecoin.xyz. Testnet is open.
Using the SDK
FacilitatorClient is the SDK wrapper around the HTTP API. You rarely need to call it directly — x402Middleware and createX402Client use it internally — but it's useful for custom integrations.
import { FacilitatorClient } from '@stablecoin.xyz/x402'
const facilitator = new FacilitatorClient({
apiKey: process.env.API_KEY, // required for mainnet
facilitatorUrl: 'https://x402.stablecoin.xyz', // default
})
// verify without settling
const result = await facilitator.verify(paymentPayload, paymentRequirements)
// { isValid: true, payer: '0x...', invalidReason: null }
// verify + settle (executes on-chain transfer)
const settled = await facilitator.settle(paymentPayload, paymentRequirements)
// { success: true, transaction: '0xTxHash', network: 'eip155:8453', payer: '0x...' }HTTP API
GET /supported
Returns supported networks and facilitator signer addresses. No auth required.
curl https://x402.stablecoin.xyz/supported{
"kinds": ["exact"],
"networks": [
"eip155:8453",
"eip155:84532",
"eip155:723",
"eip155:72344",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
],
"signers": {
"eip155:*": ["0xdeE710bB6a3b652C35B5cB74E7bdb03EE1F641E6"],
"solana:*": ["2mSjKVjzRGXcipq3DdJCijbepugfNSJCN1yVN2tgdw5K"]
}
}POST /verify
Verifies a payment payload without executing it on-chain. Checks signature validity, amount, deadline, and payer balance.
Headers:Content-Type: application/jsonX-API-Key: sbc-...(mainnet only)
{
"paymentPayload": {
"x402Version": 2,
"accepted": { "scheme": "exact", "network": "eip155:8453" },
"payload": {
"signature": "0x...",
"authorization": {
"from": "0xPayer",
"to": "0xFacilitator",
"value": "1000000000000000",
"validAfter": "0",
"validBefore": "1700000000",
"nonce": "0"
}
}
},
"paymentRequirements": {
"scheme": "exact",
"network": "eip155:8453",
"maxAmountRequired": "1000000000000000",
"asset": "0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798",
"payTo": "0xMerchant",
"maxTimeoutSeconds": 300,
"extra": { "name": "Stable Coin", "version": "1" }
}
}{ "isValid": true, "payer": "0xPayer", "invalidReason": null }POST /settle
Executes the on-chain transfer. For EVM: calls permit() + transferFrom(). For Solana: executes the delegated SPL transfer.
Same request format as /verify. Response:
{
"success": true,
"transaction": "0xTxHash",
"network": "eip155:8453",
"payer": "0xPayer"
}GET /health
curl https://x402.stablecoin.xyz/health
# {"status":"ok","service":"SBC x402 Facilitator"}Network Reference
| Network | CAIP-2 | Status | Decimals | SBC Token |
|---|---|---|---|---|
| Base | eip155:8453 | Mainnet | 18 | 0xfdcC3dd6671eaB0709A4C0f3F53De9a333d80798 |
| Base Sepolia | eip155:84532 | Testnet (free) | 6 | 0xf9FB20B8E097904f0aB7d12e9DbeE88f2dcd0F16 |
| Radius | eip155:723 | Mainnet | 6 | 0x33ad9e4bd16b69b5bfded37d8b5d9ff9aba014fb |
| Radius Testnet | eip155:72344 | Testnet (free) | 6 | 0x33ad9e4bd16b69b5bfded37d8b5d9ff9aba014fb |
| Solana | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | Mainnet | 9 | DBAzBUXaLj1qANCseUPZz4sp9F8d2sc78C4vKjhbTGMA |
Active mainnet networks (base, radius, solana) require an API key. Testnet networks are open.
Payment Mechanisms
EVM — ERC-2612 Permit
The payer signs an off-chain EIP-712 Permit message authorizing the facilitator to transfer SBC on their behalf. The payer pays no gas.
The facilitator calls:
token.permit(owner, spender, value, deadline, v, r, s)token.transferFrom(owner, payTo, value)
Both happen atomically in a single transaction. The facilitator pays the gas.
Solana — Delegated SPL Transfer
The payer signs an off-chain Ed25519 message with the format:
from:{from}|to:{to}|amount:{amount}|nonce:{nonce}|deadline:{deadline}The facilitator executes token.transferChecked() using a pre-approved SPL token delegation.
One-time setup required per payer wallet. The payer must approve the facilitator address as a delegate for their SBC token account:
# using @solana/spl-token CLI
spl-token approve \
<YOUR_SBC_TOKEN_ACCOUNT> \
<AMOUNT> \
2mSjKVjzRGXcipq3DdJCijbepugfNSJCN1yVN2tgdw5KOr programmatically using the SDK example:
# in examples/solana-demo/
cp .env.example .env # add SOLANA_PRIVATE_KEY
pnpm approve # runs approve-delegate.ts onceThe facilitator address is 2mSjKVjzRGXcipq3DdJCijbepugfNSJCN1yVN2tgdw5K.
Self-Hosting
The facilitator is open source: github.com/stablecoinxyz/x402-facilitator
git clone https://github.com/stablecoinxyz/x402-facilitator
cp .env.example .env
npm install
npm run devKey environment variables:
| Variable | Description |
|---|---|
EVM_PRIVATE_KEY | Facilitator signer key for EVM networks |
SOLANA_PRIVATE_KEY | Facilitator signer key for Solana |
DASHBOARD_URL | API key validation endpoint (default: https://dashboard.stablecoin.xyz) |
ENABLE_API_KEY_GATING | Set false to disable API key requirement (default: true) |
PORT | Server port (default: 3000) |
x402 v2 compatibility: 36/36 spec checks passing. See COMPATIBILITY.md.