{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://receiptprotocol.com/open-receipt/v0.2/issuance-attestation.schema.json",
  "title": "Open Receipt issuance attestation v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "version",
    "issuer",
    "sequence",
    "receipt_digest",
    "evidence_signing_key_id",
    "issued_at",
    "previous_entry_hash",
    "entry_hash",
    "log_signing_key_id",
    "signature"
  ],
  "properties": {
    "type": { "const": "open_receipt_issuance_attestation" },
    "version": { "const": 1 },
    "issuer": { "type": "string", "format": "uri", "pattern": "^https://" },
    "sequence": { "type": "integer", "minimum": 1 },
    "receipt_digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "evidence_signing_key_id": { "type": "string", "minLength": 1 },
    "issued_at": { "type": "string", "format": "date-time" },
    "previous_entry_hash": {
      "oneOf": [{ "type": "null" }, { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }]
    },
    "entry_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "log_signing_key_id": { "type": "string", "minLength": 1 },
    "signature": { "type": "string", "pattern": "^[A-Za-z0-9_-]+$" }
  }
}
