{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/proofprotocol/PP-SPEC-083-PROOFID-101/schemas/identity-manifest.schema.json",
  "title": "ProofID 101 Identity Manifest",
  "description": "Every Identity in one run, assembled before release and registered with the commitment root (PP-SPEC-083 Section 13).",
  "type": "object",
  "required": [
    "spec",
    "kind",
    "record_id",
    "run_id",
    "arena",
    "governing_spec",
    "identities",
    "independent_roots",
    "phase",
    "signatures"
  ],
  "properties": {
    "spec": {
      "const": "PP-SPEC-083"
    },
    "kind": {
      "const": "identity_manifest"
    },
    "record_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "run_id": {
      "type": "string"
    },
    "arena": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "governing_spec": {
      "enum": [
        "PP-SPEC-077",
        "PP-SPEC-078",
        "PP-SPEC-079",
        "PP-SPEC-081"
      ]
    },
    "phase": {
      "enum": [
        "pre_release",
        "final"
      ],
      "description": "pre_release when registered with the commitment root; final with every status after teardown (13.4)."
    },
    "identities": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "identity_id",
          "kind",
          "status"
        ],
        "properties": {
          "identity_id": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "kind": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "revoked",
              "compromised"
            ]
          },
          "proofregister_uri": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false
      }
    },
    "independent_roots": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$"
      },
      "description": "Root Identity IDs that are not the Arena Identity (6.3)."
    },
    "interim_not_independent": {
      "type": "boolean",
      "default": false,
      "description": "True when the Arena Operator also runs the Witness (6.5)."
    },
    "delegated_credentials": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "digest",
          "declared_policy_hash",
          "minted_by",
          "status"
        ],
        "properties": {
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "declared_policy_hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "minted_by": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "status": {
            "enum": [
              "active",
              "revoked"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "commitment_root": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "signatures": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "key_id",
          "alg",
          "sig"
        ],
        "properties": {
          "key_id": {
            "type": "string"
          },
          "alg": {
            "type": "string"
          },
          "sig": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "proofregister_uri": {
      "type": "string",
      "format": "uri"
    },
    "registry_receipt": {
      "type": "object"
    },
    "extensions": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
