Expand description
Pairing codes and viewer tokens (agentmux-mobile’s SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §13.2).
A code is shown in the desktop’s QR, so whoever redeems it has seen this screen. It is 10 characters of base32, works once, for 120 s, and only the newest one shown works: showing a new QR cancels the last. Guessing is bounded twice over: an address with five wrong codes in the last minute is refused with 429 before its next code is even compared, and ten wrong codes in a row, from anywhere, cancel every outstanding code.
Structs§
Enums§
- Redeem
- The outcome of presenting a code.
Constants§
- BASE32 🔒
- CODE_
LEN - CODE_
TTL - TOKEN_
PREFIX - WRONG_
IN_ A_ ROW - Wrong codes in a row, from any address, that cancel every outstanding code.
- WRONG_
PER_ ADDRESS - Wrong codes one address may send per
WRONG_WINDOW; the next attempt gets 429. - WRONG_
WINDOW
Functions§
- new_
code - A fresh pairing code. 32 divides 256, so
byte % 32is uniform. - new_
token - A fresh viewer token:
amxv_+ base64url (no padding) of 32 random bytes. - random_
bytes nbytes from the operating system’s CSPRNG (ring’s, through rustls).- token_
hash - What a token is stored as: lowercase hex SHA-256.