{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openprint.art/schemas/certificate/v1.0.json",
  "title": "Open Print 1.0 certificate",
  "description": "A uniquely identified, issuer-signed statement about a specific edition record. It is not a title, ownership record, or financial asset.",
  "type": "object",
  "required": [
    "claims",
    "integrity",
    "signature"
  ],
  "properties": {
    "claims": {
      "type": "object",
      "required": [
        "schema",
        "schemaVersion",
        "id",
        "editionId",
        "workId",
        "artworkTitle",
        "collector",
        "issuer",
        "issuedAt",
        "sequence",
        "license",
        "source",
        "notice"
      ],
      "properties": {
        "schema": {
          "const": "https://openprint.art/schemas/certificate/v1.0.json"
        },
        "schemaVersion": {
          "const": "1.0"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "editionId": {
          "type": "string",
          "minLength": 1
        },
        "workId": {
          "type": "string",
          "minLength": 1
        },
        "artworkTitle": {
          "type": "string",
          "minLength": 1
        },
        "collector": {
          "description": "Public collector information. A null displayName means the certificate contains no collector name. Private local labels never belong in this object.",
          "type": "object",
          "required": [
            "displayName"
          ],
          "properties": {
            "displayName": {
              "description": "An optional public label chosen for this certificate. Do not place email addresses or account identifiers here.",
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 120,
              "pattern": "^(?!\\s)[^\\u0000-\\u001F\\u007F]*\\S$"
            }
          },
          "additionalProperties": false
        },
        "issuer": {
          "type": "object",
          "required": [
            "id",
            "name"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "issuedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sequence": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "license": {
          "type": "object",
          "required": [
            "id",
            "summary"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "summary": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "required": [
            "gitCommit",
            "manifestDigest"
          ],
          "properties": {
            "gitCommit": {
              "type": "string",
              "minLength": 1
            },
            "manifestDigest": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "additionalProperties": false
        },
        "notice": {
          "description": "The mandatory Open Print boundary between a signed issuer statement and claims of authorship, rights, possession, ownership, or value.",
          "const": "An Open Print certificate is a signed statement by its issuer about a specific edition record. It does not by itself prove authorship, copyright, possession, legal ownership, transfer of rights, or financial value."
        }
      },
      "additionalProperties": false
    },
    "integrity": {
      "type": "object",
      "required": [
        "algorithm",
        "canonicalization",
        "digest",
        "scope"
      ],
      "properties": {
        "algorithm": {
          "const": "SHA-256"
        },
        "canonicalization": {
          "const": "open-print-c14n-1"
        },
        "digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "scope": {
          "const": "claims"
        }
      },
      "additionalProperties": false
    },
    "signature": {
      "type": "object",
      "required": [
        "algorithm",
        "keyId",
        "createdAt",
        "value",
        "scope"
      ],
      "properties": {
        "algorithm": {
          "const": "Ed25519"
        },
        "keyId": {
          "type": "string",
          "minLength": 1
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "value": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]+$"
        },
        "scope": {
          "const": "claims, integrity, and signature metadata"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
