{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/render-profile-v1.json",
  "title": "Render Profile Commitment v1",
  "description": "Render Profile Commitment receipt. Pixel coordinates only mean something against the settings that produced the pixels, so this receipt commits the resolution, color space, bit depth, page box selection, and rotation together, and the service recomputes the profile digest over a canonical form of exactly those fields. A declared digest that does not recompute fails the receipt. It does not render the page and does not confirm that any raster was produced under this profile; raster_reproduced_by_service is fixed to false because the service never receives the page.",
  "type": "object",
  "required": [
    "receipt_id",
    "payload_sha256",
    "sig_b64u",
    "key_id",
    "algorithm",
    "ts",
    "signed_body"
  ],
  "additionalProperties": false,
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^r_render\\.profile_[0-9]{10,}_[0-9a-f]{12}$"
    },
    "payload_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "sig_b64u": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    },
    "key_id": {
      "type": "string",
      "pattern": "^did:(hive|web|key):[A-Za-z0-9._:%-]+$"
    },
    "algorithm": {
      "type": "string",
      "const": "Ed25519"
    },
    "ts": {
      "type": "integer",
      "minimum": 1000000000
    },
    "signed_body": {
      "type": "object",
      "required": [
        "receipt_type",
        "schema",
        "profile_id",
        "evidence_digest_sha256",
        "recorded_at",
        "verdict",
        "boundary",
        "resolution_dpi",
        "color_space",
        "bit_depth",
        "page_box",
        "rotation_degrees",
        "profile_digest_sha256"
      ],
      "additionalProperties": false,
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "render.profile"
        },
        "schema": {
          "type": "string",
          "const": "r1.0.0"
        },
        "profile_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9._:-]{1,256}$"
        },
        "evidence_digest_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "SHA-256 of the caller-held evidence bundle this receipt attests was recorded. The service never receives or inspects the underlying evidence, only its digest."
        },
        "recorded_at": {
          "type": "string",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
        },
        "verdict": {
          "type": "object",
          "description": "Service-computed honesty boundary fields. Never caller overridable; recomputed and checked at verify time.",
          "required": [
            "raster_reproduced_by_service",
            "profile_digest_recomputed",
            "profile_digest_recomputes"
          ],
          "additionalProperties": false,
          "properties": {
            "raster_reproduced_by_service": {
              "type": "boolean",
              "const": false
            },
            "profile_digest_recomputed": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$",
              "description": "Digest the service recomputed over the canonical form of the five committed profile fields."
            },
            "profile_digest_recomputes": {
              "type": "boolean"
            }
          }
        },
        "boundary": {
          "type": "string",
          "const": "Render Profile Commitment receipt. Pixel coordinates only mean something against the settings that produced the pixels, so this receipt commits the resolution, color space, bit depth, page box selection, and rotation together, and the service recomputes the profile digest over a canonical form of exactly those fields. A declared digest that does not recompute fails the receipt. It does not render the page and does not confirm that any raster was produced under this profile; raster_reproduced_by_service is fixed to false because the service never receives the page."
        },
        "resolution_dpi": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4800,
          "description": "Render resolution in dots per inch."
        },
        "color_space": {
          "type": "string",
          "enum": [
            "srgb",
            "gray",
            "cmyk",
            "linear_rgb",
            "device_gray",
            "device_rgb"
          ]
        },
        "bit_depth": {
          "type": "integer",
          "enum": [
            1,
            2,
            4,
            8,
            16
          ]
        },
        "page_box": {
          "type": "string",
          "enum": [
            "media",
            "crop",
            "bleed",
            "trim",
            "art"
          ]
        },
        "rotation_degrees": {
          "type": "integer",
          "enum": [
            0,
            90,
            180,
            270
          ]
        },
        "profile_digest_sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Digest the caller declares over the canonical form of the five profile fields."
        }
      }
    }
  }
}
