{
  "@context": {
    "IsccNote": "http://purl.org/iscc/terms/#IsccNote",
    "iscc_code": "@id",
    "datahash": "http://purl.org/iscc/terms/#datahash",
    "nonce": "http://purl.org/iscc/terms/#nonce",
    "timestamp": "http://purl.org/iscc/terms/#timestamp",
    "signature": "http://purl.org/iscc/terms/#signature",
    "units": "http://purl.org/iscc/terms/#units",
    "metahash": "http://purl.org/iscc/terms/#metahash",
    "gateway": "http://purl.org/iscc/terms/#gateway"
  },
  "x-iscc-jsonld": {
    "context": "http://purl.org/iscc/context/0.7.0.jsonld",
    "type": "IsccNote",
    "upgrade": "Compact records omit @context and @type. To obtain JSON-LD, set @context to this schema's top-level @context term map (or to the versioned context URL in this extension's `context` field) and set @type to this extension's `type` value."
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://purl.org/iscc/schema/iscc-note.json",
  "title": "IsccNote",
  "type": "object",
  "description": "An ISCC Declaration record submitted to an ISCC-HUB for timestamping and registration. IsccNote is the permanent, self-describing log entry that binds an ISCC-CODE to its content hashes and a cryptographic signature. Stored in an append-only log, declarations are immutable once accepted, so the record is version-pinned and carries resolvable schema and context URLs.",
  "properties": {
    "@context": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "object"
        }
      ],
      "default": "http://purl.org/iscc/context/0.7.0.jsonld",
      "description": "The JSON-LD Context URI for ISCC metadata."
    },
    "@type": {
      "type": "string",
      "const": "IsccNote",
      "description": "The type of protocol metadata."
    },
    "$schema": {
      "type": "string",
      "format": "uri",
      "const": "http://purl.org/iscc/schema/iscc-note-0.7.0.json",
      "description": "The JSON Schema URI for ISCC Declaration metadata. See the top-level `x-iscc-jsonld` extension for the JSON-LD upgrade path."
    },
    "iscc_code": {
      "type": "string",
      "description": "The ISCC-CODE identifying the digital content being declared. Mapped to JSON-LD @id, making it the RDF subject of the declaration. Supports full-length 256-bit ISCC-CODEs.",
      "example": "ISCC:KACYPXW445FTYNJ3CYSXHAFJMA2HUWULUNRFE3BLHRSCXYH2M5AEGQY",
      "minLength": 34,
      "maxLength": 73,
      "pattern": "^ISCC:[A-Z0-9]{29,68}$"
    },
    "datahash": {
      "type": "string",
      "description": "A blake3 multihash of the digital content, hex-encoded with the `1e20` multihash prefix (blake3, 32-byte digest). Binds the declaration to the exact content bytes.",
      "example": "1e20253d0f3460085c276f038de345c8e953a306f4a07f9fa77f5af8563c3d7274c5",
      "minLength": 68,
      "maxLength": 68,
      "pattern": "^1e20[0-9a-f]{64}$",
      "x-iscc-context": "http://purl.org/iscc/terms/#datahash"
    },
    "nonce": {
      "type": "string",
      "description": "Cryptographic nonce for replay protection. A 128-bit random value encoded as lowercase hexadecimal.",
      "example": "0013a3c214c05796673503e6e549446d",
      "minLength": 32,
      "maxLength": 32,
      "pattern": "^[0-9a-f]{32}$",
      "x-iscc-context": "http://purl.org/iscc/terms/#nonce"
    },
    "timestamp": {
      "type": "string",
      "description": "RFC 3339 timestamp of declaration creation in UTC with millisecond precision. Optional on submission - an ISCC-HUB assigns the authoritative timestamp on receipt.",
      "example": "2025-08-12T14:30:00.123Z",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]+)?Z$",
      "x-iscc-context": "http://purl.org/iscc/terms/#timestamp"
    },
    "signature": {
      "type": "object",
      "description": "Cryptographic signature over the IsccNote, conforming to the [iscc-crypto](https://github.com/iscc/iscc-crypto) signing protocol. Uses EdDSA (Ed25519) with JCS canonicalization.",
      "additionalProperties": false,
      "x-iscc-context": "http://purl.org/iscc/terms/#signature",
      "required": [
        "version",
        "proof"
      ],
      "properties": {
        "version": {
          "type": "string",
          "const": "ISCC-SIG v1.0",
          "description": "Signature suite version identifier.",
          "example": "ISCC-SIG v1.0"
        },
        "controller": {
          "type": "string",
          "format": "uri",
          "description": "URI identifying the key controller (e.g., a DID or CID document URL).",
          "example": "did:web:example.com"
        },
        "keyid": {
          "type": "string",
          "description": "Key identifier within the controller document."
        },
        "pubkey": {
          "type": "string",
          "description": "Ed25519 public key in multibase format (z + base58btc(0xED01 + 32-byte key)) as specified in [W3C Multikey](https://www.w3.org/TR/cid/#Multikey). Optional - omitted in PROOF_ONLY signatures, where the verifier obtains the key out-of-band.",
          "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
          "minLength": 48,
          "maxLength": 48,
          "example": "z6MkmeDbeC5BecFmVnTHA5PWEBaVUrGLdB3weGE2KYnXfHso"
        },
        "proof": {
          "type": "string",
          "description": "EdDSA signature in multibase format (z + base58btc(64-byte signature)) conforming to [eddsa-jcs-2022](https://www.w3.org/TR/vc-di-eddsa/#eddsa-jcs-2022). Base58btc encoding of a 64-byte signature ranges from 65 to 89 characters, since leading zero bytes shorten the encoding.",
          "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$",
          "minLength": 65,
          "maxLength": 89,
          "example": "z5j9nrpPw3oYSAN4XbCvk2sUtkwrueTD6V2Y35gS1KFTode2ED2YQWokPmoXw6QBYtYEFxtAQfzBhdNyr8PMwP79G"
        }
      }
    },
    "units": {
      "type": "array",
      "description": "The individual full-length ISCC-UNITs that compose the declared ISCC-CODE, enabling similarity matching against the declaration. One to four 256-bit ISCC-UNITs.",
      "minItems": 1,
      "maxItems": 4,
      "items": {
        "type": "string",
        "minLength": 21,
        "maxLength": 73,
        "pattern": "^ISCC:[A-Z0-9]{16,68}$"
      },
      "example": [
        "ISCC:IADSKPIPGRQAQXBHN4BY3Y2FZDUVHIYG6SQH7H5HP5NPQVR4HVZHJRI"
      ],
      "x-iscc-context": "http://purl.org/iscc/terms/#units"
    },
    "metahash": {
      "type": "string",
      "description": "A blake3 multihash of the seed metadata, hex-encoded with the `1e20` multihash prefix (blake3, 32-byte digest). Same format as `datahash`.",
      "example": "1e208bad08ad56b5517e09bc8bc5e2281b2d8f21d096939a310f539cf5007d443772",
      "minLength": 68,
      "maxLength": 68,
      "pattern": "^1e20[0-9a-f]{64}$",
      "x-iscc-context": "http://purl.org/iscc/terms/#metahash"
    },
    "gateway": {
      "type": "string",
      "description": "An HTTP(S) URL or RFC 6570 URI template of a gateway that serves metadata for the declared ISCC. Used by ISCC resolvers to discover content metadata.",
      "example": "https://gateway.example.com/declaration/{iscc_id}",
      "minLength": 8,
      "maxLength": 2048,
      "pattern": "^https?://[^\\s]+$",
      "x-iscc-context": "http://purl.org/iscc/terms/#gateway"
    }
  },
  "required": [
    "$schema",
    "iscc_code",
    "datahash",
    "nonce",
    "signature"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "$schema": "http://purl.org/iscc/schema/iscc-note-0.7.0.json",
      "iscc_code": "ISCC:KACYPXW445FTYNJ3CYSXHAFJMA2HUWULUNRFE3BLHRSCXYH2M5AEGQY",
      "datahash": "1e20253d0f3460085c276f038de345c8e953a306f4a07f9fa77f5af8563c3d7274c5",
      "nonce": "0013a3c214c05796673503e6e549446d",
      "signature": {
        "version": "ISCC-SIG v1.0",
        "controller": "did:web:example.com",
        "pubkey": "z6MkmeDbeC5BecFmVnTHA5PWEBaVUrGLdB3weGE2KYnXfHso",
        "proof": "z5j9nrpPw3oYSAN4XbCvk2sUtkwrueTD6V2Y35gS1KFTode2ED2YQWokPmoXw6QBYtYEFxtAQfzBhdNyr8PMwP79G"
      }
    },
    {
      "$schema": "http://purl.org/iscc/schema/iscc-note-0.7.0.json",
      "iscc_code": "ISCC:KACYPXW445FTYNJ3CYSXHAFJMA2HUWULUNRFE3BLHRSCXYH2M5AEGQY",
      "datahash": "1e20253d0f3460085c276f038de345c8e953a306f4a07f9fa77f5af8563c3d7274c5",
      "nonce": "0013a3c214c05796673503e6e549446d",
      "timestamp": "2025-08-12T14:30:00.123Z",
      "signature": {
        "version": "ISCC-SIG v1.0",
        "controller": "did:web:example.com",
        "keyid": "key-1",
        "pubkey": "z6MkmeDbeC5BecFmVnTHA5PWEBaVUrGLdB3weGE2KYnXfHso",
        "proof": "z5j9nrpPw3oYSAN4XbCvk2sUtkwrueTD6V2Y35gS1KFTode2ED2YQWokPmoXw6QBYtYEFxtAQfzBhdNyr8PMwP79G"
      },
      "units": [
        "ISCC:IADSKPIPGRQAQXBHN4BY3Y2FZDUVHIYG6SQH7H5HP5NPQVR4HVZHJRI",
        "ISCC:GADUCK27AIQUBLC3ALIINORUJ6JEC4GHRWXSXLIO5VLKRE65RM6A5RI",
        "ISCC:AADWN77F727NXSUSUVDFOUS64JFPMZ4GAR5NJ3O5P563LTMXWS5XNSQ"
      ],
      "metahash": "1e208bad08ad56b5517e09bc8bc5e2281b2d8f21d096939a310f539cf5007d443772",
      "gateway": "https://gateway.example.com/declaration/{iscc_id}"
    }
  ]
}