{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "recordType",
    "authorityId",
    "authorityClass",
    "round",
    "issuedAtUtc",
    "candidateId",
    "sourceCommit",
    "gitTree",
    "scopeSha256",
    "runnerSha256",
    "corpusCommitmentSha256",
    "evaluationContextSha256",
    "randomValueSha256",
    "keyType",
    "publicKeySha256",
    "signedPayloadSha256",
    "signatureBase64",
    "rawResponseBase64",
    "rawResponseSha256",
    "publicBeaconEndpoint"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0.0"
    },
    "recordType": {
      "const": "external-randomness-beacon-receipt"
    },
    "authorityId": {
      "type": "string",
      "pattern": "^randomness-authority:[0-9a-f]{64}$"
    },
    "authorityClass": {
      "const": "independent-public-randomness-beacon"
    },
    "round": {
      "type": "integer",
      "minimum": 1
    },
    "issuedAtUtc": {
      "type": "string",
      "format": "date-time"
    },
    "candidateId": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "sourceCommit": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "gitTree": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "scopeSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "runnerSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "corpusCommitmentSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "evaluationContextSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "randomValueSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "keyType": {
      "const": "Ed25519"
    },
    "publicKeySha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "signedPayloadSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "signatureBase64": {
      "type": "string",
      "pattern": "^[A-Za-z0-9+/]{86}==$"
    },
    "rawResponseBase64": {
      "type": "string",
      "minLength": 4,
      "maxLength": 1048576
    },
    "rawResponseSha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "publicBeaconEndpoint": {
      "type": "string",
      "pattern": "^https://[a-z0-9.-]+/[A-Za-z0-9._/-]+$"
    }
  }
}
