{
"$defs": {
"KeyStateStatus": {
"description": "The state report's answer.",
"oneOf": [
{
"const": "in_sync",
"description": "The leaf is bound and current.",
"type": "string"
},
{
"const": "send_tree",
"description": "Repeat the call with `ratchet_tree`.",
"type": "string"
},
{
"const": "rebuilding",
"description": "A rebuild is collecting reports; retry after `retry_after_ms`.",
"type": "string"
}
]
},
"LeafBindingEntryJson": {
"description": "One `LeafBinding` entry in JSON: exactly one of `leaf` (key type 1) or `key_package_ref`\n(key type 2), the join id and its engine identity.",
"properties": {
"join_id": {
"description": "The join id.",
"pattern": "^[0-9a-f]{32}$",
"type": "string"
},
"key_package_ref": {
"description": "The Add's `key_package_ref` (proposals).",
"pattern": "^[A-Za-z0-9_-]*$",
"type": [
"string",
"null"
]
},
"leaf": {
"description": "The leaf index (commit, welcome, state report reply, recorder tables).",
"format": "uint32",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"lk_identity": {
"description": "`p_` + base32 of `join_id` (not signed; clients recompute and compare).",
"pattern": "^p_[a-z2-7]{26}$",
"type": "string"
}
},
"required": [
"join_id",
"lk_identity"
],
"type": "object"
},
"LeafBindingTable": {
"description": "The DS-signed leaf ↔ join id table. `sig` = Ed25519(`sew-call-ds`,\n`\"sew call leaf binding v1\"` ‖ TLS([`LeafBindingTableTbs`])).",
"properties": {
"call_id": {
"description": "The call.",
"pattern": "^r_[a-z2-7]{26}$",
"type": "string"
},
"entries": {
"description": "Ascending by leaf or by ref; one key type per table.",
"items": {
"$ref": "#/$defs/LeafBindingEntryJson"
},
"type": "array"
},
"epoch": {
"description": "The proposal epoch (key type 2) or the new epoch (key type 1).",
"format": "uint64",
"minimum": 0,
"type": "integer"
},
"group_id": {
"description": "The group (16 bytes).",
"pattern": "^[A-Za-z0-9_-]*$",
"type": "string"
},
"sig": {
"description": "64-byte Ed25519 signature.",
"pattern": "^[A-Za-z0-9_-]*$",
"type": "string"
}
},
"required": [
"call_id",
"group_id",
"epoch",
"entries",
"sig"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "State report answer.",
"properties": {
"bindings": {
"anyOf": [
{
"$ref": "#/$defs/LeafBindingTable"
},
{
"type": "null"
}
],
"description": "The full signed table when the client's `bindings_hash` differs from the DS's."
},
"retry_after_ms": {
"description": "With `rebuilding`: the rest of the rebuild window.",
"format": "uint64",
"minimum": 0,
"type": [
"integer",
"null"
]
},
"status": {
"$ref": "#/$defs/KeyStateStatus",
"description": "`in_sync`, `send_tree` or `rebuilding`."
}
},
"required": [
"status"
],
"title": "KeyStateResponse",
"type": "object"
}