Skip to main content

P7. State machines

Work in progress — not audited

Normative protocol documentation for the current implementation. Not independently audited.

P7.1 Connection FSM

StateAllows message E2EE
IdleNo
SignalingRegisteredNo
WebRTCConnectingNo
DataChannelOpenNo
CryptoHandshakingNo (handshake PDUs only)
ReadyYes
DisconnectedNo

P7.2 Crypto handshake FSM

Implementations MAY parallelize Signal and MLS substates; they MUST reach Ready only when all enabled layers in cipherLayers are initialized.

P7.3 Per-peer encryption set

  • Global set encryptedConnections contains remote peerId strings.
  • Send path checks membership before encrypt (P6).
  • On disconnect, peer SHOULD be removed from set.

P7.4 Reconnection transitions

FromEventToCrypto action
ReadyICE lostDisconnectedKeep local state
DisconnectedICE restoredDataChannelOpenIf state intact → Ready; else → CryptoHandshaking
ReadySession corruptCryptoHandshakingFull handshake

P7.5 Group state (experimental)

Additional states for groupId, MLS epochs, and groupMembers map. Not normative for production security claims until audited.