AdmissionProof
A joiner's answer to a Challenge: "I hold this key, and I am asking to join this room, from this host, right now." The joiner signs it with its own DeviceKey, so a host that checks it with isSignedBy knows the device asking is the device that holds that key.
It binds everything a replay could vary: the room, the host's key and peer id, the joiner's own peer id, the app's deviceId, and the hostNonce from the challenge it answers. A proof captured from one admission is therefore worth nothing in another room, to another host, or under another nonce.
Its wire form is the signed bytes themselves — the layout below, then the 64-byte signature — and two proofs are equal when their wire bytes are. The arrays it hands out are copies.
Layout tag "kuilt/admit-proof", version 1, seven fields in this order:
room id (UTF-8) ‖ host key (33-byte compressed point) ‖ host peer id (UTF-8) ‖
joiner peer id (UTF-8) ‖ device id (UTF-8, empty when absent) ‖ host nonce (16 bytes) ‖
channel binding (reserved: always empty)The channel-binding field is reserved for a value tying the proof to the fabric connection it travels on, such as the hash of a TLS-terminating host's certificate. Nothing fills it yet, so sign writes it empty and decode refuses a proof where it is not. A binding would stop only an active relay on a member's own link: it would not stop a bystander taking a partitioned member's peer id under its own key, since that bystander binds its own link honestly.
The proof does not carry the joiner's key: the host learns that from the joiner's Hello and checks the proof under it with isSignedBy.
Properties
Functions
Whether the signature on wire is joiner's over the layout. false, never a throw, for a bad signature or a joiner key whose point is not on the curve.
isSignedBy, checked in scheme rather than always in KeyScheme.P256. A room passes its own DeviceKeyStore.keyScheme, so a room on the real scheme checks with ECDSA whatever was sent.