Skip to content

Gateway

The gateway handles the public API, saves jobs in SQLite, collects signatures, and serves receipts and log proofs. It needs the signers' public keys, endpoints, and bearer tokens, not their private keys.

Startup

The gateway validates the network ID, epoch, signer keys, majority threshold, time policy, and signer bearer tokens. The signing window cannot exceed time_policy.max_skew_secs. If a history file is provided, the gateway verifies it against its operational config and requires the current epoch to match. See Run a gateway.

Jobs and log

POST /v1/attestations applies per-IP and global rate limits and bounds the number of active jobs. The gateway saves the record once per hash. Workers use expiring leases to retry interrupted jobs without assigning them new timestamps. A job is confirmed only after enough valid signatures have been checked.

The batch manager adds confirmed records to the Merkle log. It uses receipt_leaf, which commits to the full receipt record. To publish a checkpoint it requests signatures and supplies consistency proofs from the prior tree. If a signer returns 409 with a different last-signed size, the gateway builds a proof from that size and retries once.

Verification and deployment

GET /v1/network exposes public verification keys and rules without credentials. GET /v1/key-history serves the history clients verify against their pin. POST /v1/verify gives the gateway's own verdict; verify locally instead of relying on it.

The gateway uses a hardened outbound HTTP client for signer calls. Use HTTPS in production and keep signer routes on trusted paths. At the edge, protect admission, admin, metrics, and WebSocket access. /ws/events requires a token and emits only confirmed attestations.