{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.xyntherium.com/schemas/receipt.v0.json",
  "$comment": "MIT License, this schema file only. Copyright (c) 2026 AugustBrooks LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this schema file, to deal in it without restriction, subject to including this notice. THE SCHEMA IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND.",
  "title": "Xyntherium receipt, v0",
  "description": "One entry of a Xyntherium evidence ledger: what was checked and with what result, hash-chained to the entry before it. Recomputing payload_hash and entry_hash with hash_formula shows the record was not altered after it was written. A receipt does not show that the answer was right: verdicts describe the documents that were supplied, not the world.",
  "type": "object",
  "required": ["schema", "evidence_ledger_id", "request_id", "seq", "created_at", "payload", "payload_hash", "prev_hash", "entry_hash", "hash_formula", "meaning"],
  "additionalProperties": false,
  "properties": {
    "schema": { "const": "receipt.v0" },
    "evidence_ledger_id": { "type": "string", "minLength": 1 },
    "request_id": { "type": "string", "minLength": 1, "description": "The check this entry records." },
    "seq": { "type": "integer", "minimum": 1, "description": "Position in its chain, from 1." },
    "created_at": { "type": "string", "format": "date-time" },
    "payload": { "type": "object", "description": "What was checked and the result, as recorded (verdicts, versions, hashes of the inputs; no source text)." },
    "payload_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "prev_hash": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$", "description": "The previous entry's entry_hash; null for the first entry." },
    "entry_hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "hash_formula": { "type": "string" },
    "verification": {
      "type": "object",
      "description": "The checks the issuer recomputed when serving the receipt.",
      "required": ["payload_hash_matches", "entry_hash_matches", "links_to_previous"],
      "properties": {
        "payload_hash_matches": { "type": "boolean" },
        "entry_hash_matches": { "type": "boolean" },
        "links_to_previous": { "type": ["boolean", "null"] },
        "note": { "type": ["string", "null"] }
      }
    },
    "meaning": { "const": "This receipt proves the record was not altered after it was written. It does not prove the answer was right." }
  }
}
