{
  "$defs": {
    "AnchorType": {
      "description": "Anchor operation type.\nPer MARS Specification Section 10.1.",
      "enum": [
        "register",
        "update",
        "revoke",
        "transfer",
        "attest"
      ],
      "type": "string"
    }
  },
  "$id": "urn:mars:schema:v1:mars-anchor",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "On-chain anchor record for a MARS entry.\nPer MARS Specification Appendix B.",
  "properties": {
    "anchorType": {
      "$ref": "#/$defs/AnchorType",
      "description": "Type of anchor operation."
    },
    "bondId": {
      "description": "Bond ID (if applicable).",
      "type": [
        "string",
        "null"
      ]
    },
    "entryDid": {
      "description": "DID of the anchored entry.",
      "type": "string"
    },
    "itemDataHash": {
      "description": "SHA-256 hash of canonicalized itemData.",
      "type": "string"
    },
    "previousAnchorHash": {
      "description": "Hash of the previous anchor (chain linking).",
      "type": [
        "string",
        "null"
      ]
    },
    "publisherDid": {
      "description": "DID of the publisher.",
      "type": "string"
    },
    "timestamp": {
      "description": "Timestamp of anchoring.",
      "format": "date-time",
      "type": "string"
    },
    "type": {
      "description": "Always \"MarsAnchor\".",
      "type": "string"
    },
    "version": {
      "description": "SemVer version string.",
      "type": "string"
    }
  },
  "required": [
    "type",
    "entryDid",
    "itemDataHash",
    "publisherDid",
    "version",
    "timestamp",
    "anchorType"
  ],
  "title": "MarsAnchor",
  "type": "object"
}
