security
Noise XK Handshake Authorization
Noise XK Handshake Authorization
With no server to ask "is this caller allowed?", the question has to be answered by the connection itself. Noise XK is a handshake pattern where the initiator already knows the responder's static public key, and the responder learns the initiator's static key during the handshake, encrypted. No certificates, no certificate authority.
initiator (knows responder key from roster) responder
→ ephemeral
← ephemeral
→ initiator static key (encrypted) → look it up in the local roster
not found: stop here, never enter transport mode
⇄ transport frames
The roster check sits between "I now know who you claim to be, and you proved it" and "I will read what you say". There is no code path that parses a command and then rejects it.
Two details that matter in practice. The layering: the networking code can take the check as an injected predicate over raw key bytes, so it enforces the gate without knowing how rosters are stored. And with several addresses for one peer, the handshake belongs inside the address loop, because the first address that accepts TCP can be a different machine.
Authentication at the handshake isn't the end. Objects named inside later messages still need an ownership check against the authenticated key, or one legitimate peer can act on another's data.
Trade-offs. Keys must be distributed beforehand, which is what pairing or a signed roster is for. Revocation is only as fast as each machine's roster update. TLS with client certificates can do similar things but brings a PKI along.
Used in: Ferry