Expand description
LAN key continuity (docs/specs/SPEC_LAN_KEY_CONTINUITY_2026_10_29.md): a
pinned name whose agent now shows a different key moves to it with no
person in the loop, but only when the install that hosts the agent vouches
for the key with a certificate, and this machine already trusts that
install. Anything else stays refused.
The same certificate is what makes a name’s FIRST pin: a name with no pin is pinned only when a
trusted install vouches for the key it shows (on_first_contact); an unvouched first key is
never pinned by itself and its messages stay unproven until the person accepts it.
The sending half is issue_cert: the lookup answer for an agent carries
lan_cert, a WanKeyRecord (channel lan) signed by the install’s own
key. The receiving half is move_if_vouched, called when the name pin
and the key just shown disagree, and by the agent route of pins.adopt.
Enums§
- Path 🔒
- What made the issuing install trusted.
Constants§
- CERT_
CHANNEL 🔒 - The channel a LAN key’s certificate names.
- CERT_
MAX_ 🔒AGE_ SECS - How far from now a certificate’s time may be: it is signed when the answer is given, so an old copy is a replay.
- DIRECTORY_
WAIT 🔒 - How long a check of a message from another machine waits on the account’s directory: the sign-in token (which can sit behind a refresh that hangs) and the lookups. The sender gives up on its forward after 10 s, so a longer wait only ends in a lost message (task #2512).
- MAX_
UNVOUCHED 🔒 - At most this many unvouched keys are remembered at once; past it a key is simply looked into again.
- RECHECK_
AFTER_ 🔒SECS - An unvouched key is not looked into again for this long, so a peer that keeps showing one cannot make this machine ask the directory every time.
- REVOKED 🔒
- The refusal
instance_trustgives for an install known to be revoked: the only one that says the install itself is no longer trusted, as against a directory that could not be asked.
Statics§
Functions§
- add_
cert 🔒 - Put this install’s certificate for
public_key_b64into a lookup answer aslan_cert. - agent_
says_ 🔒hosted_ by - Whether the agent itself, under the key
key_b64, says the install behindcerthosts it: the statement the host adds to its lookup answer. A certificate alone proves only that some trusted install wrapped the key in one, which any of the account’s installs can do for a public key it merely saw. - ask_
directory 🔒 instance_trust’s asks of the account’s directory: the token, the revocation of a pinned install, the listing of an unpinned one.- audit 🔒
- One line to
logs/pin-changes.log, best effort. Fingerprints and labels only: never a key. - bind_
after_ 🔒verified - A message just verified under
agent’s pinned key (key). If the pin is bound to no install yet, bind it to the install behind the certificate the peer shows for exactly that key, when this machine trusts that install. Binding on a verified message keeps it as strong as the pin: a certificate alone proves nothing, since anyone can wrap a public key in a certificate of an install of their own. - bind_to 🔒
- Record that the install behind
certvouched for the keyagentis pinned to. Best effort: a pin left unbound is bound by the next message that verifies under it (bind_after_verified) and moves by hand until then. - bound_
install_ 🔒allows - A pin moves only on the say of the install that vouched for it, or one that install handed over to (it signed a revocation naming the new one as its successor). A pin bound to no install yet does not move on its own: it binds on the next verified message, and until then a person accepts the key.
- check_
cert 🔒 - The certificate’s own checks, none of which need the network: it is a
chain-valid certificate by some install, for this agent and channel
lanand exactly the key shown, issued close to now and after the pin it would replace. Whether the install is trusted isinstance_trust’s. - fingerprint 🔒
- A short fingerprint of a base64 key: enough to tell two keys apart on a screen, never the key. (Not a prefix of the key: it is a hash of it.)
- handed_
over 🔒 - Whether the account’s directory holds a revocation
fromsigned that namestoas its successor. - handed_
over_ 🔒asking - instance_
trust 🔒 - Whether this machine trusts the install
instance_id: pinned here for some agent already, else live in the account’s directory. An install this machine knows to be revoked is trusted by neither way, and a pin does not outlive a revocation the directory holds. - issue_
cert 🔒 - The certificate for
agent’s LAN key (public_key_b64), signed by this install now.Nonewhen this install has no WAN identity or the key is not a key. - move_
if_ 🔒vouched - Move
agent’s name pin toobserved_keyifcertvouches for it; for a name with no pin, make its first pin the same way. The UID pins beside the name pin go with the old key and are set again by the next message that verifies under the new one (lan_peer_pubkey_pin_replace). Returns what vouched, or why nothing did.byis who asked, for the audit line:"automatic"for a message that arrived, an agent’s id for the route. - moved_
off 🔒 - Whether the agent named
agentwas moved to another computer from this one (its record carries themovedmark). - on_
first_ 🔒contact - A name has no pin and shows
observed_key: pin it only if a trusted install vouches for it.truemeans carry on verifying under the (new) pin.falseleaves the name unpinned and the message unproven, and keeps the key for the pin screen, which asks the person once to accept it. - on_
mismatch 🔒 - The pin and the key just shown disagree: move the pin if the hosting install vouches for the key,
else record why it stays refused.
truemeans carry on verifying under the (moved) pin. - pin_
first 🔒 - First contact: pinned only now that a trusted install vouched, and bound to that install.
get_or_setkeeps whichever key got there first, so a concurrent first contact cannot be overwritten from an older check. - remember_
revoked 🔒 - Keep a revocation learned from the directory, so it still stands when the directory cannot be asked. The install may have no known-install row yet (a pin the user adopted never went through WAN verification), and recording a check updates a row only, so make the row first.
- retire 🔒
- Remember that
agentmoved offold_b64, so a message signed with it later is refused as retired. - retired_
reason 🔒 - Why
observed_keyis refused whenagentonce moved off it, in a sentence;Noneif it never did. - unvouched 🔒
- vouch 🔒
- with_
sender_ 🔒cert - A machine’s sender-key lookup answer with this install’s certificate for the key, as an agent’s key is answered, so a peer that trusts the install pins it at first contact (a Swarm broadcast, a quiet note) instead of waiting for the person.
- within 🔒
asking, withinwait. Past it the answer is exactly what it is when the directory cannot be asked at all (no sign-in): a pinned install is trusted as pinned (Path::PinnedInstance), claiming nothing from a lookup that did not happen, and an unpinned one is not trusted, with the reason. An install already known locally to be revoked was refused before this was asked.- write_
audit 🔒 - Append one line for
entrytopin-changes.logindir.