Leash operates two public facilitators:https://facilitator.leash.market(mainnet) andhttps://devnet-facilitator.leash.market(devnet). These are the SDK defaults. Anyone can self-host the same binary — useful for local dev, integration tests, or running on a custom settlement key.
Default facilitators vs overrides (any compatible host)
Leash SDKs (@leash/buyer-kit, @leash/seller-kit) resolve the facilitator URL through defaultFacilitatorFor: optional LEASH_FACILITATOR_URL, else a per-network default, else a universal fallback.
The table below is the “what you get if you set nothing” default — it is not a whitelist. You can point LEASH_FACILITATOR_URL (or facilitator: on createBuyer / createSeller) at any HTTPS base URL that implements the x402 facilitator HTTP API and publishes the exact SVM scheme for your cluster.
| Network | Default | Example third-party alternatives |
|---|---|---|
| Devnet | https://devnet-facilitator.leash.market | https://devnet-facilitator.leash.market, http://localhost:8787 (local @leash/facilitator-app) |
| Mainnet | https://facilitator.leash.market | https://facilitator.leash.market, or any other mainnet-capable x402 facilitator you run or trust |
api.leash.market) uses LEASH_API_FACILITATOR_URL for its own /x/{id} paywall and seller-utils — that is server-side only and does not change your SDK defaults. That value can also be any compatible facilitator base URL, not only the Leash binary.
The web playground reads NEXT_PUBLIC_LEASH_FACILITATOR_URL (client) and LEASH_FACILITATOR_URL (server routes). See Create a payment link — Facilitator.
What a facilitator does
In x402, the buyer signs a transaction transferring tokens to the seller. The buyer never touches the blockchain — instead, the seller forwards the signed payload to a facilitator:POST /verify— facilitator inspects the signed transaction and confirms it does what the seller asked (right amount, right mint, right destination, right network).POST /settle— facilitator adds its own signature as fee payer, broadcasts to Solana, and returns the on-chain signature.GET /supported— published list of(scheme, network)tuples the facilitator accepts.HTTPFacilitatorClientcalls this on startup.
Wire compatibility
@leash/facilitator registers the Exact SVM scheme from @x402/svm
for both protocol v1 and v2. That means every existing Leash buyer
(@leash/buyer-kit) and seller (@leash/seller-kit) deployment works
out of the box: just set LEASH_FACILITATOR_URL.
HTTPFacilitatorClient from
@x402/core, so dropping in any other facilitator URL (svmacc, PayAI,
Coinbase) is a one-env-var swap.
Self-host in 5 commands
(scheme, network, x402Version) tuple.
Running inside the monorepo
For local hacking on the facilitator itself, use the workspace app:Configuration
| Env var | Default | Description |
|---|---|---|
LEASH_FACILITATOR_SECRET_KEY | required | Solana 64-byte secret. Either a JSON byte array (Solana CLI export) or a base58 string (Phantom/Solflare export). |
LEASH_FACILITATOR_NETWORKS | devnet | Comma list. Allowed: devnet, testnet, mainnet. |
LEASH_FACILITATOR_PORT | 8787 | HTTP port. |
LEASH_FACILITATOR_HOST | 0.0.0.0 | Bind address. |
LEASH_FACILITATOR_RPC_URL | kit defaults | Override the RPC URL used for ALL networks. |
LEASH_FEE_BPS | 100 | Protocol fee rate in basis points (100 = 1.00%). Set to 0 to disable the fee leg entirely. |
LEASH_FEE_ENFORCE | enforce | enforce rejects bad/missing fee legs. warn logs them but still settles. off skips fee verification (vanilla x402). |
LEASH_FEE_AUTHORITY_MAINNET | 3DdcJkvjW7KLtMeko3Zr57jEJWhqRHuPsEBFm1XJYh7W | Pubkey that receives the mainnet fee leg. Override only if running your own facilitator with your own treasury. |
LEASH_FEE_AUTHORITY_DEVNET | 3DdcJkvjW7KLtMeko3Zr57jEJWhqRHuPsEBFm1XJYh7W | Same, for devnet. |
/health:
feeAuthority disagrees with what the facilitator publishes.
See Protocol fee for the full wire shape, math
worked examples, and self-host guidance.
Going to mainnet
The codepath supports it; v0.1 of the hosted instance does not. To run your own mainnet facilitator:- Generate a fresh keypair (do not reuse the devnet one).
- Fund it with real SOL — facilitators pay tx fees out of pocket. Roughly 0.0001 SOL per settlement; 0.1 SOL is a comfortable runway for thousands of payments.
LEASH_FACILITATOR_NETWORKS=mainnet(ordevnet,mainnet).- Front the HTTP listener with TLS + abuse protection (Cloudflare Worker / nginx). The package itself does not implement auth or rate limiting; the assumption is you’ll terminate that at the edge.
WARNING line when mainnet is enabled. Heed it.
Architecture (one paragraph)
@leash/facilitator is a thin Hono app built on x402Facilitator from
@x402/core. Instead of registering the upstream ExactSvmScheme / ExactSvmSchemeV1
directly, it registers LeashExactSvmFacilitator (x402 v2) and
LeashExactSvmFacilitatorV1 (legacy v1) — two custom schemes that extend
the upstream verification with: optional leading
CreateAssociatedTokenAccountIdempotent instructions (validated and paid for
by the facilitator), the 1% Leash protocol fee leg enforcement, and a final
RPC simulation gate. Settlement co-signs as fee payer and broadcasts via the
unmodified upstream path. Leash-specific extras: env-driven config
(LEASH_FACILITATOR_* + LEASH_FEE_*), a base58 secret-key decoder so you
can paste a Phantom export verbatim, and a /health endpoint reporting the
fee-payer address and live protocol_fee block.
Roadmap
- v0.2 — Settlement persistence. Cross-reference settled txs with
ReceiptV1records from@leash/runnerto power the explorer. - v0.3 — Multi-key fee payer rotation for higher throughput.
- v0.4 — Mainnet on the hosted instance.
- v0.5 — Hooks for fraud detection and per-merchant rate limiting.

