Skip to main content

Module rotation

Module rotation 

Source
Expand description

Real key rotation: random epoch keys sealed to each remaining device.

Every device holds the identity seed, so a seed-derived key can never shut a revoked device out. A rotation therefore makes a fresh random epoch key and seals one copy to each remaining device’s exchange key (X25519, derived from its node key). The sealed copies travel in the roster (Roster::chain). A device that is not a recipient, revoked or restored from the seed alone, cannot open the new key; a restored device is let back in by an Admission from a device that holds the key.

Rules (all checked on every device, so they converge):

  • A DeviceKey is signed by the device’s own node key, so no other device (even one holding the user key) can swap in its own exchange key.
  • A Rotation is signed by its creator’s node key. It is valid when the creator has an active cert and is a member of the parent rotation, and its epoch is the parent’s plus one. A root (no parent) is valid when its creator is a member of it. A revoked creator’s rotations count only when an active device built on them, so a chain started by a device revoked later lives on, and whatever a revoked device makes on its own drops out.
  • Once a device holds a key from a root it keeps that root (KeyChain::root); a later root from someone holding only the seed is ignored. Two devices can each start a root before they know of each other; a root whose creator is a member of the chain a device follows is trusted, and the earliest trusted root wins. A device in both chains admits the devices it approved into both, so they merge.
  • The members of a rotation are its recipients plus devices admitted to it by a member. The head is the valid rotation with the highest epoch, then one with no revoked member, then the lowest id. A head with a revoked member needs another rotation; crate::pull_from makes it.
  • A service device with sync types is never sealed the epoch key (since 0.8.3): the rotation’s creator admits it with the new rotation’s type-scoped keys for its grant (Roster::scoped_types, EpochKeys::get_scoped), so it can open only those types.

Structs§

Admission
A member’s grant of the current key (and the older ones it holds) to a device, such as one restored from the seed.
ChainView
The chain as this roster sees it: valid rotations from the root, and the head.
Device
This device’s signing and exchange secrets. The exchange secret is derived from the node key, so nothing new has to be stored.
DeviceKey
A device’s public exchange key, signed by the device’s node key.
EpochKeys
The epoch keys this device holds, by rotation id. Secret: the application stores it encrypted (EpochKeys::export) and never logs it.
KeyChain
The public part of rotation: device keys, rotations and admissions. Gossiped with the roster; holds no secret.
Rotation
A new random epoch key, sealed to each remaining device.
SealedKey
One recipient’s copy of an epoch key.
ValidRotation
A rotation that counts, with its members.

Enums§

KeyStatus
Where this device stands with rotated keys.

Functions§

peer_public
The node public key inside an Ed25519 (identity-multihash) peer id.