{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://lsdi.ufma.br/schemas/mqtt/envelope.schema.json",
  "title": "Federated MQTT Envelope",
  "type": "object",
  "required": [
    "message_id",
    "schema_version",
    "experiment_id",
    "sender_id",
    "timestamp",
    "nonce",
    "payload_hash",
    "signature",
    "payload"
  ],
  "properties": {
    "message_id": {
      "type": "string",
      "format": "uuid"
    },
    "schema_version": {
      "type": "string"
    },
    "experiment_id": {
      "type": "string"
    },
    "contract_version": {
      "type": "string"
    },
    "round_id": {
      "type": "integer",
      "minimum": 0
    },
    "sender_id": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "nonce": {
      "type": "string"
    },
    "payload_hash": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "signature": {
      "type": "string"
    },
    "payload": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
