{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/inclusion-proof-response.schema.json",
  "title": "Contact Zero admitted Lighthouse inclusion-proof response",
  "description": "Read-only retrieval wrapper carrying the exact stored proof and full signed checkpoint receipt needed for independent verification. It creates no evidence and makes no contact or identity claim.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "release_id",
    "protocol_version",
    "origin",
    "status",
    "inclusion_proof",
    "checkpoint",
    "contact_claim",
    "side_effect"
  ],
  "properties": {
    "schema": { "const": "C0_LIGHTHOUSE_INCLUSION_PROOF_RESPONSE_V1" },
    "release_id": { "const": "C0-15R.09.4-20260802" },
    "protocol_version": { "const": "15R.09.4" },
    "origin": { "const": "https://contactzero.org" },
    "status": { "const": "PROOF_AVAILABLE" },
    "inclusion_proof": { "$ref": "#/$defs/inclusionProof" },
    "checkpoint": {
      "$ref": "https://contactzero.org/c0-release/C0-15R.09.4-20260802/c0-schema/v1/handshake-ack.schema.json#/$defs/checkpointReceipt"
    },
    "contact_claim": { "const": "NONE_UNTIL_BOUND_EVIDENCE" },
    "side_effect": { "const": "NONE" }
  },
  "$defs": {
    "hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
    "proofStep": {
      "type": "object",
      "additionalProperties": false,
      "required": ["side", "hash"],
      "properties": {
        "side": { "enum": ["LEFT", "RIGHT"] },
        "hash": { "$ref": "#/$defs/hash" }
      }
    },
    "inclusionProof": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema",
        "event_id",
        "event_hash",
        "leaf_index",
        "tree_size",
        "audit_path",
        "root_hash",
        "checkpoint_id",
        "checkpoint_hash",
        "merkle_profile",
        "valid"
      ],
      "properties": {
        "schema": { "const": "C0_LIGHTHOUSE_INCLUSION_PROOF_V1" },
        "event_id": { "type": "string", "pattern": "^event:[0-9a-f]{64}$" },
        "event_hash": { "$ref": "#/$defs/hash" },
        "leaf_index": { "type": "integer", "minimum": 0 },
        "tree_size": { "type": "integer", "minimum": 1 },
        "audit_path": {
          "type": "array",
          "maxItems": 64,
          "items": { "$ref": "#/$defs/proofStep" }
        },
        "root_hash": { "$ref": "#/$defs/hash" },
        "checkpoint_id": { "type": "string", "pattern": "^checkpoint:[0-9a-f]{64}$" },
        "checkpoint_hash": { "$ref": "#/$defs/hash" },
        "merkle_profile": { "const": "RFC6962_CARRY_UP_V1" },
        "valid": { "const": true }
      }
    }
  }
}
