x402 Facilitator for Open Creator Rails. Implements the ocr-permit-v1 payment scheme: accepts an EIP-2612 permit signed by the user and calls Asset.subscribe() on-chain. The Facilitator pays gas; tokens flow directly from the user's wallet to the Asset contract.
docs/architecture.md— flow, component map, non-custodial proofdocs/ocr-permit-v1.md— scheme spec: payload, subscriber ID derivation, verify/settle logicdocs/IPaymentAdapter.md— interface for adding future payment railsdocs/security.md— threat model, regulatory note, production checklist
| Method | Path | Description |
|---|---|---|
GET |
/supported |
Returns supported schemes and networks |
POST |
/verify |
Validates a payment payload off-chain |
POST |
/settle |
Broadcasts Asset.subscribe() on-chain |
GET |
/health |
Liveness check |
cp .env.example .env
# fill in .env
npm install
npm run dev| Variable | Description |
|---|---|
RPC_URL |
HTTP RPC endpoint for the target chain |
PRIVATE_KEY |
Facilitator signing key (pays gas, never payer) |
ASSET_REGISTRY_ADDRESS |
Deployed AssetRegistry contract address |
CHAIN_ID |
Chain ID (default: 84532 — Base Sepolia) |
PORT |
HTTP port (default: 3402) |
npm testSee .invariants. Key constraints:
facilitator_never_payer(FROZEN) — Facilitator address must never appear aspayerin anyAsset.subscribe()callcancel_not_called(FROZEN) — Adapter never callsAsset.cancelSubscription()