{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://h2a-protocol.org/schemas/v0/h2a-media.profile.schema.json",
  "title": "H2A-Media Profile",
  "description": "Asset-bound media profile. Not a Core requirement — applies only when a grant lists 'h2a-media'. C2PA composition lives here for multi-part supply chains.",
  "type": "object",
  "additionalProperties": false,
  "required": ["h2a_version", "profile", "grant_id", "asset", "likeness_ref"],
  "properties": {
    "h2a_version": { "type": "string", "const": "0.1" },
    "profile": { "type": "string", "const": "h2a-media" },
    "grant_id": { "type": "string", "pattern": "^[0-9a-fA-F-]{36}$" },
    "likeness_ref": { "type": "string", "pattern": "^urn:h2a:subject:[A-Za-z0-9._-]+$" },
    "asset": {
      "type": "object",
      "additionalProperties": false,
      "required": ["asset_id", "media_type", "content_hash"],
      "properties": {
        "asset_id": { "type": "string" },
        "media_type": { "type": "string", "enum": ["audio", "video", "image", "3d"] },
        "content_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
        "c2pa_manifest_ref": { "type": "string", "description": "Pointer to the C2PA manifest, if present." }
      }
    },
    "composition": {
      "type": "array",
      "description": "Parent asset references for multi-part supply chains. Effective revocability of the composite = max horizon of all parts.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["asset_ref"],
        "properties": {
          "asset_ref": { "type": "string" },
          "grant_ref": { "type": "string", "pattern": "^[0-9a-fA-F-]{36}$" }
        }
      }
    },
    "constraints": {
      "type": "object",
      "description": "Modality-specific limits (e.g. no singing voice, no minors' likeness).",
      "additionalProperties": true
    }
  }
}
