{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://attestome.example/schemas/artifact-anchor-envelope.schema.json",
  "title": "Attestome Artifact Anchor Envelope",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "version",
    "mode",
    "scope",
    "status",
    "createdAt",
    "receipt",
    "observer",
    "signature",
    "anchor",
    "claims",
    "note",
    "envelopeDigest"
  ],
  "properties": {
    "kind": { "const": "attestome.artifact-anchor-envelope" },
    "version": { "const": "1.0" },
    "mode": { "enum": ["local", "wallet-observed"] },
    "scope": { "const": "digest-reference-only" },
    "status": { "const": "not-submitted" },
    "createdAt": { "type": "string", "format": "date-time" },
    "receipt": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kind", "version", "receiptDigest", "artifactDigest"],
      "properties": {
        "kind": { "const": "attestome.research-artifact-receipt" },
        "version": { "const": "1.0" },
        "receiptDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
        "artifactDigest": {
          "oneOf": [
            { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
            { "type": "null" }
          ]
        }
      }
    },
    "observer": {
      "type": "object",
      "additionalProperties": false,
      "required": ["address", "chainId"],
      "properties": {
        "address": {
          "oneOf": [
            { "type": "string", "pattern": "^0x[a-f0-9]{40}$" },
            { "type": "null" }
          ]
        },
        "chainId": {
          "oneOf": [
            { "type": "string", "pattern": "^0x[1-9a-f][a-f0-9]*$" },
            { "type": "null" }
          ]
        }
      }
    },
    "signature": { "const": null },
    "anchor": { "const": null },
    "claims": {
      "type": "object",
      "additionalProperties": false,
      "required": ["signed", "submitted", "confirmed"],
      "properties": {
        "signed": { "const": false },
        "submitted": { "const": false },
        "confirmed": { "const": false }
      }
    },
    "note": { "type": "string", "minLength": 1 },
    "envelopeDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
  }
}
