# The first public x402 v2 facilitator for Whitechain

> whitechain-x402-facilitator is open source, live on Whitechain Sepolia. How it settles, how to use it, what comes next.

Sahil Massey · 2026-10-19 · 7 min read

![Card headed 'Postage due.': 10,000 micro-dollars (10 000 µ) to deliver this request, the 0.01 ITC of the facilitator's first settlement on 2026-10-04. Rows: PAYMENT-SIGNATURE, EIP-3009, sign 10 000 µ and resend; gas, paid by the facilitator, the agent holds 0 WBT; paid to, the merchant's own address.](/blog/first-x402-facilitator-whitechain/hero.png)

On 2026-10-04 an agent holding 0 WBT paid 0.01 ITC to a merchant's API on Whitechain Sepolia. It paid through the official x402 fetch client, the merchant ran the official x402 express middleware, and whitechain-x402-facilitator settled the payment on chain. That was the facilitator's first settlement: [0xc1e9c255…](https://explorer.testnet.whitechain.io/tx/0xc1e9c255d7ac63c99a68406a3a0226cf717654a25f55c73c0454f9ae82e33615).

whitechain-x402-facilitator is the first public x402 v2 facilitator for Whitechain, live on Whitechain Sepolia. It is open source under Apache-2.0, at release v0.1.0. Any x402 server can point at the hosted service, and anyone can run their own copy.

## A facilitator verifies and settles the payment

[x402](https://www.x402.org) puts payment into HTTP. A server answers an unpaid request with `402 Payment Required` and a price. The client signs a payment for that amount and sends the same request again, with a `PAYMENT-SIGNATURE` header. The server passes the signed payment to a facilitator, which checks it and settles it on chain.

The facilitator is the one piece of infrastructure in that loop. whitechain-x402-facilitator is that piece for Whitechain, WhiteBIT's EVM L2: `/verify`, `/settle` and `/supported`, built on the official `@x402/core` and `@x402/evm` packages.

The scope of "first" is deliberate. An earlier x402-style facilitator, AgentPay, ran x402 v1 on Whitechain's legacy L1 testnet. whitechain-x402-facilitator is the first public x402 v2 one: hosted for anyone to use, in the v2 wire format the official SDKs send.

## The payer pays the merchant; the facilitator pays the gas

![Fig. 1, one x402 payment: agent, merchant, facilitator, Whitechain Sepolia. 1, request. 2, 402 Payment Required with price and payTo. 3, the same request, signed (PAYMENT-SIGNATURE, EIP-3009). 4, verify, then settle. 5, on chain: transferWithAuthorization moves ITC from agent to merchant, gas paid by the facilitator. 6, 200 and the answer.](/blog/first-x402-facilitator-whitechain/fig-1-payment-flow.png)

*Fig. 1. One x402 payment through whitechain-x402-facilitator on Whitechain Sepolia. Source: the facilitator's README, read 2026-10-19.*

1. The agent calls the merchant's API, with no account and no API key.
2. The merchant answers `402 Payment Required`. Its `PAYMENT-REQUIRED` header names the price, the token and the merchant's own address (`payTo`).
3. The agent signs an EIP-3009 `transferWithAuthorization` for that amount, off chain. It resends the same request with the signature in `PAYMENT-SIGNATURE`.
4. The merchant's x402 middleware calls the facilitator's `/verify`, serves the request, then calls `/settle`.
5. The facilitator submits the signed authorization to the token and pays the gas in WBT. The answer carries the transaction hash in `PAYMENT-RESPONSE`.

The token moves once, from the agent straight to the merchant's `payTo`. The signature fixes the recipient, the amount, a validity window and a nonce. So the facilitator can submit the payment or refuse it; it cannot send the tokens anywhere else. Its key holds only WBT, for gas. The agent needs ITC and no WBT.

The checks are the official `@x402/evm` implementation: the EIP-712 signature, the balance, the nonce, and a simulation before anything is broadcast. The facilitator adds policy around them: rate limits, daily gas budgets, a gas cap per settlement and a sanctions denylist.

## A merchant changes three settings

Any x402 v2 resource server works. The facilitator speaks the wire format of `@x402/core`'s `HTTPFacilitatorClient`, so the official `@x402/express`, `@x402/hono` and `@x402/next` middleware use it unmodified. Three settings are Whitechain's own: the facilitator URL, the network `eip155:1874`, and an explicit token price, because the x402 SDK has no "$" default asset for Whitechain yet.

| | |
| --- | --- |
| Facilitator URL | `https://x402-facilitator-production-ff5f.up.railway.app` |
| Network | Whitechain Sepolia, `eip155:1874` |
| Scheme | `exact`, EIP-3009 `transferWithAuthorization` |
| Token | ITC, [0x2E672dFE…7fBB](https://explorer.testnet.whitechain.io/address/0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB), 6 decimals |
| Cost | No charge on Whitechain Sepolia, within rate limits and a daily gas budget |

An Express merchant charging 0.01 ITC (10 000 µ; a µ is a millionth of an ITC) per request. It reads the token's EIP-712 name and version from the contract:

```ts
import express from "express";
import { createPublicClient, http } from "viem";
import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { ExactEvmScheme } from "@x402/evm/exact/server";

const url = "https://x402-facilitator-production-ff5f.up.railway.app";
const server = new x402ResourceServer(new HTTPFacilitatorClient({ url }))
  .register("eip155:1874", new ExactEvmScheme());
const asset = "0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB"; // ITC
const rpc = createPublicClient({ transport: http("https://rpc.testnet.whitechain.io") });
const { domain } = await rpc.getEip712Domain({ address: asset }); // the token's EIP-712 name and version
const ITC = { asset, extra: { name: domain.name, version: domain.version } };

const app = express();
app.use(paymentMiddleware({ "GET /weather": { accepts: { scheme: "exact", network: "eip155:1874",
  payTo: "0xYourMerchantAddress", price: { ...ITC, amount: "10000" } } } }, server)); // 0.01 ITC
app.get("/weather", (_req, res) => res.json({ city: "Lisbon", temperatureC: 24 }));
app.listen(4021);
```

`@x402/hono` takes the same routes and `x402ResourceServer`, and so does `@x402/next`. In the week of 2026-10-04 the facilitator had 98 tests, including interop runs of the official x402 express, hono and fetch packages against it. The full programs and the HTTP API are in [the facilitator's docs](https://github.com/InferitAI/whitechain-x402-facilitator/tree/main/docs).

## An agent allows one token

Agents never call the facilitator. They talk to the merchant and sign. The official x402 fetch client pays once ITC is allowed in its spend controls. Recent clients pay only the assets they know, so the agent names the token and caps each payment.

```ts
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:1874", client: new ExactEvmScheme(account) }],
  spendControls: { // allow ITC, at most 0.10 ITC per payment
    allowedAssets: [{ network: "eip155:1874", asset: "0x2E672dFE33EA977FD064E01aDe7d8c73B3Be7fBB", maxAmountPerPayment: "100000" }],
  },
});

const res = await fetchWithPayment("http://localhost:4021/weather"); // 402 -> signed -> 200
console.log(await res.json());
```

The agent's wallet needs ITC and no WBT. A fresh address can claim 1,000 ITC from Inferit's sponsored faucet, at most once per 24 h, without sending a transaction itself:

```sh
curl -X POST https://api-production-c74b9.up.railway.app/v1/faucet \
  -H 'content-type: application/json' -d '{"address":"0xYourAgentAddress"}'
```

## Check it yourself

The live service describes itself at `/supported`. This was its answer on 2026-10-19:

```sh
curl -s https://x402-facilitator-production-ff5f.up.railway.app/supported
# {"kinds":[{"x402Version":2,"scheme":"exact","network":"eip155:1874"}],
#  "extensions":["eip2612GasSponsoring"],
#  "signers":{"eip155:*":["0xA0AF38939cE09438393Bbc238Ae9f2989e123045"]}}
```

The signer is the facilitator's gas key, [0xA0AF3893…3045](https://explorer.testnet.whitechain.io/address/0xA0AF38939cE09438393Bbc238Ae9f2989e123045). Its first settlement is [0xc1e9c255…](https://explorer.testnet.whitechain.io/tx/0xc1e9c255d7ac63c99a68406a3a0226cf717654a25f55c73c0454f9ae82e33615), dated 2026-10-04.

- **Code:** [InferitAI/whitechain-x402-facilitator](https://github.com/InferitAI/whitechain-x402-facilitator), Apache-2.0.
- **Docs:** [the HTTP API, architecture and operations](https://github.com/InferitAI/whitechain-x402-facilitator/tree/main/docs).
- **Live service:** `https://x402-facilitator-production-ff5f.up.railway.app`, with its status at [/health](https://x402-facilitator-production-ff5f.up.railway.app/health).
- **Self-host:** a Dockerfile and one gas key. Inferit runs the public instance, with rate limits and a daily gas budget.
- **Agents paying Inferit:** [the agents' guide](https://inferit.cc/agents.md).

## Inferit's API keeps its own facilitator

Inferit is a peer-to-peer market for AI inference, and agents pay it per request with x402 on the same network and token. The facilitator came out of that work, and I split it out so any Whitechain merchant and any agent can use it.

Inferit's market API does not route payments through it. Inferit's API runs its own x402 v2 facilitator on Whitechain Sepolia, self-hosted and operated by Inferit. Its payments work differently: they go into `MarketEscrow` with `depositWithAuthorization`, credited to the wallet that signed, not to a merchant's address.

The agent side is the same for both: the official x402 fetch client, Whitechain Sepolia and ITC. Inferit runs both facilitators, so neither is an independent facilitator. The open-source one is not an official Whitechain or WhiteBIT service.

## What comes next

- x402 in USDC (Portal-bridged USDC.e) on Whitechain mainnet, planned.
- x402's Permit2 transfer method, and with it the `upto` scheme and USDT, planned once the x402 Permit2 proxy contracts are deployed on Whitechain. The facilitator takes EIP-3009 tokens today.

[Read the facilitator →](https://github.com/InferitAI/whitechain-x402-facilitator)

---

Canonical page: https://inferit.cc/blog/first-x402-facilitator-whitechain
All pages as markdown: https://inferit.cc/llms.txt
