Skip to content

Witness node

witness-node holds one Ed25519 private key. The gateway calls it for receipt and checkpoint signatures. For a signed key change, the operator can run witness-node sign-key-transition --body body.json with a signer's config to print a signature as JSON.

HTTP surface

Endpoint Behavior
POST /v1/sign Check the receipt's network, epoch, and timestamp and return witness_id, signed_at, and signature.
POST /add-checkpoint Check the log signature and growth proof. Return the signer's stored tree size on 409; reject an inconsistent tree with 422.
GET /<origin hash>/checkpoint Serve the latest note this signer signed, or 404 before the first one.
GET /health Report clock health as clock: "ok" or "unhealthy"; return 503 when unhealthy.
GET /v1/info Report the signer ID, public key, and network ID.

Receipt signing requires a bearer token. Checkpoint signing requires the gateway's log signature. Keep both signing endpoints accessible only to trusted gateways. The checkpoint read is public. See C2SP checkpoints for the exact request and response formats.

Clock and checkpoint state

Receipt timestamps must be within max_clock_skew of a healthy local clock. The checkpoint has no gateway timestamp. Both signatures bind the signer's own clock reading. A detected wall-clock jump stops signing for clock_recovery_secs; require_clock_sync additionally checks the kernel clock on Linux.

The signer saves a signed checkpoint to checkpoint_state_path before returning its signature. Keep that file on persistent storage, including across key changes. A signer with missing state accepts its first checkpoint without a prior tree to check against. See Protocol v2 and Run a witness.