{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://travel.agenthaven.dev/contracts/schemas/checkpoint-receipt.schema.json",
  "title": "Witness receipt (payload of a checkpoint-receipt+jwt)",
  "description": "What the witness returns for POST <witness>/checkpoints {checkpoint_jws}: it appended the checkpoint to its own append-only log and signs, with a key from <witness>/.well-known/jwks.json (kid = thumbprint), the checkpoint's height, head and the SHA-256 of its payload octets, plus where in the log it landed. The seller verifies the receipt before storing it and keeps the error instead when it does not verify. The emulator the verifier operates answers with the same shape; a SCITT receipt from a real transparency service replaces it when confirmed, with its own media type. Status: IMPLEMENTED in the verifier's emulator (served at https://provedby.dev/witness since 2026-09-11, receipts marked emulator: true) and verified by the seller and the buyer. Since 2026-09-13 a checkpoint may carry a second receipt beside this one, from a public transparency log the keeper does not operate, in COSE form (checkpoints-document.schema.json, external; external-witness.md); this receipt stays the emulator's.",
  "type": "object",
  "required": ["iss", "sub", "height", "head", "checkpoint_sha256", "log_index", "logged_at"],
  "properties": {
    "iss": { "type": "string", "format": "uri", "description": "The witness." },
    "sub": { "type": "string", "format": "uri", "description": "The ledger's base URL, as the checkpoint's iss." },
    "height": { "type": "integer" },
    "head": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "checkpoint_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 hex over the raw payload octets of the checkpoint JWS." },
    "log_index": { "type": "integer", "minimum": 0 },
    "logged_at": { "type": "string", "format": "date-time" },
    "emulator": { "type": "boolean", "description": "True when the witness is the verifier's emulator rather than a transparency service. Said on the scorecard." }
  }
}
