Expand description
The pairing token: the single string an operator carries from a client into a server.
Sendspin’s “Pairing Token” section defines a token as a fixed SP: prefix, one version
character and a body:
token = "SP:" || version || body
body = base32(payload), padding stripped, every `2` transliterated to `9`The body is RFC 4648 §6 base32 with the = padding stripped. Transliterating 2 to 9
keeps the whole token inside the QR code alphanumeric set (0-9, A-Z, :), so a token
survives a QR scan and a manual copy identically. Decoding reverses the transform and is
lenient about how the operator supplied the string - surrounding whitespace, case and a
missing SP: prefix - and strict about everything else.
Two versions exist:
- version
0carriesclient_key || pairing_psk, 64 payload bytes: a raw Curve25519 public key followed by the client’s pairing PSK.encode_v0builds it. - version
1carries the 24-byte dynamic pairing code of theqr_codeemission format.encode_v1builds it.
A token is a credential: anyone holding it can pair a server with the client. Nothing here is
behind a feature gate - a token is text, not a PAKE - and neither Debug output nor an
error message ever contains payload bytes; both report lengths instead.
The spec’s reference vectors are asserted in tests/pairing_token.rs.
Structs§
- Token
- A decoded pairing token.
Constants§
- VERSION_
1_ PAYLOAD_ LEN - Version 1’s payload length: the dynamic pairing code of the
qr_codeemission format.