Skip to content

Stellar Facilitator

Payment wires: every paid endpoint accepts x402 and MPP (Machine Payments Protocol) on the same 402 - see Paying with x402 and Paying with MPP. Agent402 is the applied layer of Agentic Finance: agents that pay and get paid on their own.

facilitator/ in the repository is a self-hostable x402 facilitator for Stellar: it verifies and settles exact-scheme USDC payments on Soroban and confirms each settlement on chain. It joins the official @x402/core orchestration to the official @x402/stellar scheme; it is glue, not a second implementation of the protocol. The hosted service runs it for its own Stellar rail (see Stellar (USDC)).

Source and full reference: facilitator/README.md.

Run

cd facilitator
npm install
FACILITATOR_STELLAR_SECRET=S... npm start

It listens on PORT (default 4021) and serves the three standard facilitator endpoints, GET /supported, POST /verify and POST /settle, plus an open GET /health ({ signerAddress, xlmBalance, low }) for outside monitoring.

Network

Testnet is the default. Mainnet is an explicit opt-in: FACILITATOR_NETWORK=pubnet with FACILITATOR_MAINNET_RPC_URL. Any other value stays on testnet.

Access

  • FACILITATOR_AUTH_TOKEN: when set, /verify, /settle and /supported require Authorization: Bearer <token>.
  • FACILITATOR_ALLOWED_PAYTO: when set, a payment whose payTo is not on the list is refused before any simulation.
  • On pubnet with neither set, the server refuses to start unless FACILITATOR_ALLOW_OPEN=1 says an open facilitator is intended.

The signer account pays the network fee of every settlement, so an open facilitator can be used by anyone as a fee sponsor. Set one of the two.

Settlement bounds

  • Settlements run one at a time: the signer account has one sequence number.
  • Each RPC request has its own timeout (FACILITATOR_RPC_TIMEOUT_MS), with failover to FACILITATOR_RPC_FALLBACK_URLS on a transport failure. A JSON-RPC error is an answer and is never retried elsewhere.
  • A settle call is bounded (FACILITATOR_SETTLE_TIMEOUT_MS); one that ends without a result still answers with a best-effort payer, so the caller can ask the chain before believing a failure.
  • GET /health reports low when the signer's XLM falls under FACILITATOR_LOW_BALANCE_XLM.

Every variable, with its default, is in the README above.