{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.wholesaledito.store/.well-known/provenance/schema.json",
  "title": "Clickerwayne Provenance Manifest",
  "description": "Schema for a signed price manifest issued by Wholesale Dito Store. Each manifest contains a header that describes the signing key and policy, a claim object that carries the price data and is signed, and a base64 DER ECDSA signature over the canonicalized claim.",
  "type": "object",
  "required": ["header", "claim", "signature"],
  "properties": {
    "header": {
      "type": "object",
      "required": ["manifest_version", "schema_uri", "alg", "cert", "cert_info", "sig_info"],
      "properties": {
        "manifest_version": { "type": "string" },
        "schema_uri": { "type": "string", "format": "uri" },
        "alg": { "type": "string" },
        "cert": { "type": "string", "description": "Base64-encoded public key or certificate." },
        "cert_info": {
          "type": "object",
          "properties": {
            "type": { "type": "string", "enum": ["public-key-pem", "x509", "unknown"] },
            "fingerprint": { "type": ["string", "null"] },
            "encoding": { "type": "string" },
            "decode_instructions": { "type": "string" }
          }
        },
        "sig_info": {
          "type": "object",
          "properties": {
            "alg": { "type": "string" },
            "sig_format": { "type": "string" },
            "hash_algo": { "type": "string" },
            "curve": { "type": "string" },
            "canonicalization": { "type": "string" },
            "signs_what": { "type": "string" },
            "description": { "type": "string" }
          }
        },
        "revocation": {
          "type": "object",
          "properties": {
            "mechanism": { "type": "string" },
            "uri": { "type": "string", "format": "uri" },
            "description": { "type": "string" }
          }
        },
        "timestamp_authority": {
          "type": "object",
          "properties": {
            "mechanism": { "type": "string" },
            "uri": { "type": "string", "format": "uri" },
            "description": { "type": "string" }
          }
        },
        "attribution": {
          "type": "object",
          "properties": {
            "required_credit": { "type": "string" },
            "preferred_citation": { "type": "string" },
            "source_url": { "type": "string", "format": "uri" },
            "terms_uri": { "type": "string", "format": "uri" },
            "license": { "type": "string" },
            "restrictions": { "type": "array", "items": { "type": "string" } },
            "note": { "type": "string" }
          }
        }
      }
    },
    "claim": {
      "type": "object",
      "required": ["claim_generator", "format", "instance_id", "assertions"],
      "properties": {
        "claim_generator": { "type": "string" },
        "format": { "type": "string" },
        "instance_id": { "type": "string" },
        "type": { "type": "string" },
        "generated": { "type": "string" },
        "total_manifests": { "type": "integer" },
        "manifests": { "type": "array" },
        "assertions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["label", "data"],
            "properties": {
              "label": { "type": "string" },
              "data": { "type": "object" }
            }
          }
        }
      }
    },
    "signature": {
      "type": "string",
      "description": "Base64-encoded DER ECDSA P-256 signature over the canonicalized claim object."
    }
  }
}