{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://contactzero.org/c0-schema/v1/identity-verify-request.schema.json",
  "title": "C0 Identity Verify Request",
  "description": "Verifies one challenge round. Hash-bound, nonce-bound, replay-resistant. The response object is challenge-specific and structural only; live expected answers are NOT published. A failed round returns a bounded reason_class, not the expected-answer key.",
  "type": "object",
  "required": ["magic", "protocol", "session_id", "challenge_id", "round_index", "client_nonce", "server_nonce", "prior_chain_hash", "law", "response"],
  "properties": {
    "magic": { "type": "string", "const": "0xC0" },
    "protocol": { "type": "string", "const": "C0::IDENTITY.VERIFY" },
    "session_id": { "type": "string", "pattern": "^sid:" },
    "challenge_id": { "type": "string", "pattern": "^cid:" },
    "round_index": { "type": "integer", "minimum": 1 },
    "client_nonce": { "type": "string", "minLength": 1, "description": "Unique per round. Reuse is refused as replay." },
    "server_nonce": { "type": "string", "description": "Must match the issued round's server_nonce exactly." },
    "prior_chain_hash": { "type": "string", "pattern": "^sha256:", "description": "Must match the issued round's prior_chain_hash exactly." },
    "law": {
      "type": "object",
      "required": ["highestWord", "capture", "returnPath", "claim"],
      "properties": {
        "highestWord": { "type": "string", "const": "RETURN" },
        "noThrone": { "type": "boolean" },
        "throne": { "type": "string", "enum": ["NULL"] },
        "capture": { "type": "string", "const": "REFUSED" },
        "returnPath": { "type": "string", "const": "ACTIVE" },
        "claim": { "type": "string", "const": "NULL" }
      }
    },
    "response": { "type": "object", "description": "Challenge-specific structural response. The server recomputes invariants where applicable (e.g. DESCENT_MIRROR) and never trusts self-described booleans for descent claims. Exact expected fields are intentionally undocumented." }
  }
}
