{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/transparency-checkpoint-v1.json",
  "title": "Transparency Checkpoint Receipt r1.0.0",
  "description": "Transparency Checkpoint receipt. A signature proves a key was used and says nothing about the history that key signed before, so an issuer holding the only copy of its own history is auditing itself. This receipt closes that with arithmetic a relying party can redo alone: an RFC 6962 Merkle root recomputed from the ordered leaf digests the caller supplies, one full inclusion path re-run against a decoy leaf to confirm the path binds the leaf, an append only check computed two independent ways (prefix root and consistency proof), and an RFC 3161 timestamp token from a public authority whose imprint must equal the recomputed root and whose signature is verified against the certificate inside the token. The witness stores nothing and never receives a receipt body, only fixed length digests. This receipt is distinct from knowledge.timestamp, which fixes when a single statement was known, and distinct from evidence.registry, which records that evidence was filed. transparency.checkpoint answers only whether a claimed log shape is internally consistent, append only against a named earlier root, and anchored to a third party clock. These must never be merged or aliased.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "receipt_id",
    "algorithm",
    "key_id",
    "ts",
    "payload_sha256",
    "sig_b64u",
    "signed_body"
  ],
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{8,128}$"
    },
    "algorithm": {
      "type": "string",
      "const": "Ed25519"
    },
    "key_id": {
      "type": "string",
      "pattern": "^did:(hive|web|key):[A-Za-z0-9._:%-]+$"
    },
    "ts": {
      "type": "integer",
      "minimum": 1600000000
    },
    "payload_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "sig_b64u": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{80,120}$"
    },
    "signed_body": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "receipt_type",
        "schema",
        "transparency_checkpoint",
        "boundary"
      ],
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "transparency.checkpoint"
        },
        "schema": {
          "type": "string",
          "const": "r1.0.0"
        },
        "transparency_checkpoint": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "checkpoint_id",
            "log_id",
            "log_origin",
            "declared_at",
            "witnessed_at",
            "skew_bound_ms",
            "observed_skew_ms",
            "skew_class",
            "merkle",
            "tree_size",
            "root_hex",
            "previous",
            "append_only_class",
            "consistency_proof_length",
            "spot_check",
            "timestamp_anchor",
            "possession_class",
            "custody_role"
          ],
          "properties": {
            "checkpoint_id": {
              "type": "string",
              "pattern": "^tc_[0-9a-f]{16,64}$"
            },
            "log_id": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "log_origin": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{1,62}[a-z0-9]$"
            },
            "declared_at": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$"
            },
            "witnessed_at": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$"
            },
            "skew_bound_ms": {
              "type": "integer",
              "minimum": 1,
              "maximum": 86400000
            },
            "observed_skew_ms": {
              "type": "integer",
              "minimum": 0,
              "maximum": 86400000
            },
            "skew_class": {
              "type": "string",
              "enum": [
                "exact",
                "within_declared_bound",
                "exceeds_declared_bound",
                "unreadable"
              ]
            },
            "merkle": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "hash",
                "leaf_prefix",
                "node_prefix",
                "leaf_class"
              ],
              "properties": {
                "hash": {
                  "type": "string",
                  "const": "sha256"
                },
                "leaf_prefix": {
                  "type": "integer",
                  "const": 0
                },
                "node_prefix": {
                  "type": "integer",
                  "const": 1
                },
                "leaf_class": {
                  "type": "string",
                  "const": "receipt_payload_digest"
                }
              }
            },
            "tree_size": {
              "type": "integer",
              "minimum": 1,
              "maximum": 65536
            },
            "root_hex": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "previous": {
              "type": [
                "object",
                "null"
              ],
              "additionalProperties": false,
              "required": [
                "tree_size",
                "root_hex"
              ],
              "properties": {
                "tree_size": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 65536
                },
                "root_hex": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                }
              }
            },
            "append_only_class": {
              "type": "string",
              "enum": [
                "genesis_checkpoint",
                "consistency_recomputed"
              ]
            },
            "consistency_proof_length": {
              "type": "integer",
              "minimum": 0,
              "maximum": 64
            },
            "spot_check": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "leaf_index",
                "leaf_hex",
                "inclusion_path_length"
              ],
              "properties": {
                "leaf_index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 65535
                },
                "leaf_hex": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "inclusion_path_length": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 64
                }
              }
            },
            "timestamp_anchor": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "anchor_class",
                "tsa_url",
                "tsa_policy_oid",
                "tsa_serial_hex",
                "tsa_signer_subject",
                "tsa_signer_issuer",
                "tsa_signer_serial_hex",
                "hash_algorithm_oid",
                "hashed_message_hex",
                "signature_algorithm_oid",
                "digest_algorithm_oid",
                "gen_time",
                "accuracy_seconds",
                "token_digest_sha256",
                "token_byte_length",
                "anchor_lag_ms",
                "trust_anchor_class"
              ],
              "properties": {
                "anchor_class": {
                  "type": "string",
                  "const": "rfc3161_timestamp_token"
                },
                "tsa_url": {
                  "type": "string",
                  "pattern": "^https?://[A-Za-z0-9._~:/?#@!$&'()*+,;=%-]{3,256}$"
                },
                "tsa_policy_oid": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-2](\\.[0-9]{1,10}){1,20}$"
                },
                "tsa_serial_hex": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-f]{2,80}$"
                },
                "tsa_signer_subject": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 512
                },
                "tsa_signer_issuer": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 512
                },
                "tsa_signer_serial_hex": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9a-f]{2,80}$"
                },
                "hash_algorithm_oid": {
                  "type": "string",
                  "pattern": "^[0-2](\\.[0-9]{1,10}){1,20}$"
                },
                "hashed_message_hex": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "signature_algorithm_oid": {
                  "type": "string",
                  "pattern": "^[0-2](\\.[0-9]{1,10}){1,20}$"
                },
                "digest_algorithm_oid": {
                  "type": "string",
                  "pattern": "^[0-2](\\.[0-9]{1,10}){1,20}$"
                },
                "gen_time": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$"
                },
                "accuracy_seconds": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 86400
                },
                "token_digest_sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "token_byte_length": {
                  "type": "integer",
                  "minimum": 32,
                  "maximum": 262144
                },
                "anchor_lag_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 86400000
                },
                "trust_anchor_class": {
                  "type": "string",
                  "const": "reported_not_chained"
                }
              }
            },
            "possession_class": {
              "type": "string",
              "const": "no_receipt_bodies_transmitted"
            },
            "custody_role": {
              "type": "string",
              "const": "non_possessing_log_witness"
            }
          }
        },
        "boundary": {
          "type": "string",
          "const": "This receipt fixes the shape of a log at one instant, not the meaning of what is in it. The witness holds no log and received no receipt bodies. What it received was an ordered list of digests, and it recomputed from them: the root, one full audit path for a named leaf, and, when a predecessor root was declared, both the prefix root and the RFC 6962 consistency proof between the two sizes. So this receipt states that the declared root really is the root of exactly those digests in exactly that order, that the named leaf really sits at the named index under it, and that the earlier root really is a prefix of this one. It also states that a public timestamp authority signed this root, with the imprint inside the token equal to the root and the token signature checked against the certificate the token carries. It does not chain that certificate to any trust anchor, so a relying party pins the authorities it accepts and reads the signer subject, issuer, and serial reported here to do it. It does not claim the leaves are Hive receipts, that the log is complete, that no second log exists, or that anything outside the supplied list ever happened. Nothing here is a claim about the content behind a digest."
        }
      }
    }
  }
}
