{
  "$id": "urn:mars:schema:v1:siws-challenge",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "SIWS challenge issued by MARS and signed by a Sigil wallet.",
  "properties": {
    "audience": {
      "description": "Sign-in audience.",
      "type": "string"
    },
    "chainId": {
      "description": "Sigil chain identifier.",
      "type": "string"
    },
    "expiresAtMs": {
      "description": "Challenge expiry time in Unix milliseconds.",
      "format": "int64",
      "type": "integer"
    },
    "hmrDid": {
      "description": "HMR DID expected to sign.",
      "pattern": "^did:oas:",
      "type": "string"
    },
    "issuedAtMs": {
      "description": "Challenge issue time in Unix milliseconds.",
      "format": "int64",
      "type": "integer"
    },
    "kind": {
      "description": "Protocol discriminator. Current value is `sigil.signin`.",
      "pattern": "^sigil\\.signin$",
      "type": "string"
    },
    "nonce": {
      "description": "Single-use challenge nonce.",
      "type": "string"
    },
    "origin": {
      "description": "Request origin.",
      "type": "string"
    },
    "requestId": {
      "description": "Single-use request identifier.",
      "type": "string"
    },
    "rootDid": {
      "description": "Optional authorizing HMR, MHR, or ENR root DID.",
      "type": [
        "string",
        "null"
      ]
    },
    "version": {
      "description": "SIWS wire version. Current value is `1`.",
      "format": "uint8",
      "maximum": 1,
      "minimum": 1,
      "type": "integer"
    }
  },
  "required": [
    "kind",
    "version",
    "origin",
    "audience",
    "chainId",
    "nonce",
    "requestId",
    "hmrDid",
    "issuedAtMs",
    "expiresAtMs"
  ],
  "title": "SiwsChallenge",
  "type": "object"
}
