Skip to content

Receipt signature verification

Verify a saved SignedAttestation or confirmed job snapshot:

witness verify receipt.json --network-config pinned-network.json --data document.pdf

Use --hash "$HASH" instead of --data if you already have the expected SHA-256 digest. Without either option the CLI checks the signature but does not compare the receipt to your file. --output json returns a machine-readable verdict and preserves the nonzero exit status on failure.

The verifier checks the network and key epoch, rejects duplicate and unknown signer IDs, and counts distinct valid Ed25519 signatures whose signed_at is within time_policy.max_skew_secs of the gateway timestamp. The count must meet the majority threshold. The CLI reports "existed no later than" using the latest counted signed_at, assuming at least one honest counted signer and allowing for clock error.

Unless you supply --key-history FILE, the CLI tries GET /v1/key-history even when the receipt matches the pin's epoch, so it can detect later retirement. A fetched history that does not verify against the pin is an error. If fetching fails and the receipt matches the pin's epoch, the CLI warns and falls back to that pin alone; JSON reports key_history: "unchecked". A receipt from an epoch known to be compromised requires proof bundle verification and an independently re-pinned key file.

--trust-gateway explicitly uses the gateway's chosen keys instead of a pin. It is suitable for a local demo, not independent verification.