Skip to content

Gateway

Choose the native Rust service or Cloudflare Worker deployment model.

Both gateway implementations share protocol behavior from gateway-core while keeping runtime-specific IO isolated.

Native gateway

crates/gateway-native is an Axum service for self-hosting. It supports the broadest route surface, facilitator and RPC clients, local development stores, SQLite order mode, notify delivery, idempotency, and reconciliation.

Local JSON or SQLite storage is suitable for development and single-instance operation. Multi-instance production requires shared transactional storage.

Cloudflare Worker

crates/gateway-worker runs at the edge with D1/KV-backed modes and explicit production gates. D1 is required where atomic claims or conditional writes are security-critical. Unsafe local or eventually consistent modes must remain blocked on public production origins.

Shared invariants

  • No payer private keys and no custody of user funds.
  • Exact context checks before facilitator calls.
  • Signed offers and receipts use an independent server signing key.
  • Webhooks are SSRF-filtered and treated as hints.
  • RPC ranges, response sizes, timeouts, and request rates are bounded.
  • Default payments stay stateless; order state is opt-in.