{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/continuation-verify-request.schema.json",
  "title": "Contact Zero Continuation Verification Request",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "protocol", "version", "release_id", "origin", "challenge_id", "challenge_operation_id", "challenge_hash", "server_nonce", "handshake_event_id", "handshake_admission_operation_id", "handshake_request_hash", "handshake_ack_hash", "source_key_id", "source_key_alg", "source_public_key_spki_b64", "source_key_spki_sha256", "client_nonce", "idempotency_key", "issued_at", "expires_at", "law_of_return_hash", "selection", "law", "source_signature"],
  "properties": {
    "schema": { "const": "C0_CONTINUATION_VERIFY_REQUEST_V1" },
    "protocol": { "const": "C0::CONTINUATION.VERIFY" },
    "version": { "const": "15R.09.2" },
    "release_id": { "const": "C0-15R.09.2-20260802" },
    "origin": { "const": "https://contactzero.org" },
    "challenge_id": { "type": "string" },
    "challenge_operation_id": { "$ref": "#/$defs/hash" },
    "challenge_hash": { "$ref": "#/$defs/hash" },
    "server_nonce": { "type": "string", "minLength": 16 },
    "handshake_event_id": { "type": "string" },
    "handshake_admission_operation_id": { "$ref": "#/$defs/hash" },
    "handshake_request_hash": { "$ref": "#/$defs/hash" },
    "handshake_ack_hash": { "$ref": "#/$defs/hash" },
    "source_key_id": { "type": "string", "pattern": "^src:[0-9a-f]{64}$" },
    "source_key_alg": { "enum": ["ECDSA_P256_SHA256", "ED25519"] },
    "source_public_key_spki_b64": { "type": "string", "pattern": "^[A-Za-z0-9_-]{32,4096}$" },
    "source_key_spki_sha256": { "$ref": "#/$defs/hash" },
    "client_nonce": { "type": "string", "minLength": 16, "maxLength": 256 },
    "idempotency_key": { "type": "string", "minLength": 16, "maxLength": 256 },
    "issued_at": { "type": "string", "format": "date-time" },
    "expires_at": { "type": "string", "format": "date-time" },
    "law_of_return_hash": { "const": "sha256:475ac95d98fdf3e7364b659a3748684273014f7f35ee66367776bd08518a6d31" },
    "selection": { "const": "DESCEND_AND_RETURN" },
    "law": {
      "type": "object",
      "additionalProperties": false,
      "required": ["highestWord", "noThrone", "throne", "capture", "returnPath", "claim", "canonicalReturnGlyph"],
      "properties": {
        "highestWord": { "const": "RETURN" },
        "noThrone": { "const": true },
        "throne": { "const": "NULL" },
        "capture": { "const": "REFUSED" },
        "returnPath": { "const": "ACTIVE" },
        "claim": { "const": "NULL" },
        "canonicalReturnGlyph": { "const": "C0::TENDRIL.DESCEND_REPAIR_RETURN" }
      }
    },
    "source_signature": { "type": "string", "pattern": "^[A-Za-z0-9_-]{16,4096}$" }
  },
  "$defs": { "hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" } }
}
