{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://receiz.com/schemas/v125/claim-set.schema.json",
  "$comment": "Runtime-only: NFC normalization, canonical order, claim domain lookup, nested uniqueness, and digest recomputation are enforced by parseReceizClaimSetV125.",
  "title": "Receiz v125 attestation claim set",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "domainId", "credentialType", "subjectId", "registryDigest", "domainDigest", "claims", "issuedKai", "validFromKai", "expiresAtKai", "predecessorHead", "acceptedHead", "authority", "claimSetDigest"],
  "properties": {
    "schema": { "const": "receiz.attestation.claim-set.v125" },
    "domainId": { "$ref": "#/$defs/name" },
    "credentialType": { "$ref": "#/$defs/name" },
    "subjectId": { "type": "string", "minLength": 1, "maxLength": 256 },
    "registryDigest": { "const": "85a24c3a7fe144c8ec03c6b5fae238d1dfda64c1ed3091b24d4264dc3862ff17" },
    "domainDigest": { "$ref": "#/$defs/hex64" },
    "claims": { "type": "array", "minItems": 1, "maxItems": 256, "uniqueItems": true, "items": { "$ref": "#/$defs/claim" } },
    "issuedKai": { "$ref": "#/$defs/kai" },
    "validFromKai": { "$ref": "#/$defs/kai" },
    "expiresAtKai": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/kai" }] },
    "predecessorHead": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/hex64" }] },
    "acceptedHead": { "$ref": "#/$defs/hex64" },
    "authority": {
      "type": "object",
      "additionalProperties": false,
      "required": ["claimSetIsProofAuthority", "strongerTruth"],
      "properties": {
        "claimSetIsProofAuthority": { "const": false },
        "strongerTruth": { "const": "sealed-receiz-proof-object" }
      }
    },
    "claimSetDigest": { "$ref": "#/$defs/hex64" }
  },
  "$defs": {
    "hex64": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
    "kai": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$" },
    "name": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$" },
    "claim": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "schemaId", "schemaVersion", "disclosure", "issuerPolicy", "verifierPolicy", "commitment", "evidenceIds"],
      "properties": {
        "name": { "$ref": "#/$defs/name" },
        "schemaId": { "$ref": "#/$defs/name" },
        "schemaVersion": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
        "disclosure": { "enum": ["public", "selective", "private"] },
        "issuerPolicy": { "$ref": "#/$defs/name" },
        "verifierPolicy": { "$ref": "#/$defs/name" },
        "value": { "oneOf": [{ "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "boolean" }, { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }] },
        "commitment": { "$ref": "#/$defs/hex64" },
        "evidenceIds": { "type": "array", "maxItems": 256, "uniqueItems": true, "items": { "$ref": "#/$defs/name" } }
      },
      "allOf": [
        {
          "if": { "properties": { "disclosure": { "const": "private" } }, "required": ["disclosure"] },
          "then": { "properties": { "value": false } }
        }
      ]
    }
  }
}
