{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "One ILLI device. The rkey is the device id: the SHA-256 of the unit's UDS-derived public key (the first key of its DICE chain, registered with the Newnal RKP server at manufacture), 64 lowercase hex characters, so the same unit keeps the same id across factory resets; not a manufacturing serial number. The pending onboarding code lives only in the Service Agent Node database.",
      "key": "any",
      "record": {
        "properties": {
          "deviceId": {
            "description": "SHA-256 of the unit's UDS-derived public key, lowercase hex (64 characters). Stable across factory resets. Also the onboarding-code binding and, in production, bound to the unit's RKP attestation-key certificate.",
            "maxLength": 64,
            "type": "string"
          },
          "firmwareVersion": {
            "description": "Version of the ILLI unit's OS image (the firmware build), reported by the device itself; not verified. Trusted software state comes from the key attestation.",
            "maxLength": 32,
            "type": "string"
          },
          "home": {
            "description": "homeId the device is bound to while status is active.",
            "format": "tid",
            "type": "string"
          },
          "linkedAt": {
            "format": "datetime",
            "type": "string"
          },
          "model": {
            "maxLength": 64,
            "type": "string"
          },
          "partner": {
            "description": "Partner brand the unit was sold under. Reserved for multi-tenancy.",
            "maxLength": 64,
            "type": "string"
          },
          "registeredAt": {
            "format": "datetime",
            "type": "string"
          },
          "status": {
            "knownValues": [
              "registered",
              "active",
              "unlinked",
              "retired"
            ],
            "type": "string"
          },
          "unlinkedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "deviceId",
          "model",
          "status",
          "registeredAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "ai.newnal.illi.service.device",
  "lexicon": 1
}
