iwakura docs notes same-user-device-sync.md
4.5 kB 93 lines
Markdown

Same-user device synchronization #

  • Status: account-local conversation provisioning, approved readable archive
    transfer, and an initial safe-preference snapshot implemented; ongoing
    preference conflict resolution remains deferred
  • Recorded: 2026-09-23
  • Provenance: proposed by Maxine during the multi-device implementation pass

Motivation #

Two endpoints validly belonging to the same atproto DID may want to synchronize
state that is not part of any conversation:

  • application preferences and configuration;
  • contacts, muted users, and local presentation state;
  • conversation discovery and local indexes; and
  • possibly readable message history when provisioning a new device.

This is distinct from adding the endpoint to each conversation's BeeKEM group.
It should therefore be modeled as an explicit same-user synchronization
capability rather than hidden inside ordinary group membership.

Proposed separation #

Use at least two capability tiers:

  1. Account-local state sync. Preferences and other deliberately synchronized
    configuration. This can likely use a dedicated per-user device group or an
    authenticated direct device-to-device channel.
  2. Private archive transfer. Readable historical messages or old key
    material. This is a high-impact provisioning operation and must require
    stronger, explicit authorization from an existing device.

Merely presenting two currently valid iroh-with-atp records for the same DID
is sufficient evidence of common account identity, but should not by itself
authorize export of historical plaintext or old conversation secrets. A
repository or DID-controller compromise could otherwise silently turn into a
complete archive compromise.

Preserving “history begins at join” #

Conversation-level BeeKEM semantics should continue to grant a new endpoint
only future group state. There are two materially different forms of history
sync:

  • Replicating old encrypted events without old secrets preserves the join
    boundary; the new device can retain and forward them but cannot read them.
  • An existing device may explicitly export a readable local archive over a
    separately authorized provisioning channel. This is an archive copy, not a
    retroactive BeeKEM membership grant, and its provenance should remain visible
    to the receiving client.

Avoid transferring old BeeKEM secrets merely to make history import convenient.
That would weaken forward-secrecy boundaries and make later compromise of a new
device expose earlier conversation history.

Authorization requirements #

A private archive transfer requires all of the following:

  • mutual live iroh-with-atp validation with both endpoints resolving to the
    same canonical DID;
  • an explicit one-time pairing or provisioning grant approved by an existing
    device;
  • binding that grant to both EndpointIDs, a purpose, an expiry, and a replay
    nonce;
  • encrypted transfer directly between the paired endpoints; and
  • clear local revocation and audit state.

ADR 0055 chooses signed, gap-oriented archive records over an authenticated
same-user operation stream. The records copy readable application content but
never old BeeKEM keyrings. The same logical archive is intended to support a
later separately encrypted Spaces backup.

Implemented foundation #

ADR 0026 implements explicit same-user browser provisioning. It synchronizes a
bounded local conversation manifest and adds the new endpoint to each BeeKEM
group through ordinary endpointAdd invitations. ADR 0055 adds an expiring,
source-signed archive grant and exact-event readable-history requests. Imported
records are source-attested and encrypted under receiver-local archive keys;
they never become historical BeeKEM state. Pairing also copies selected
behavioral preferences and merges blocked DIDs. Ongoing preference replication,
including conflict-aware unblocking, still needs a conflict model.

Pairing progress is now a durable per-source journal containing the approved
control transcript and per-root completion. Reopening the browser resumes a
valid grant without repeating approval; an already linked source can renew an
expired grant automatically. Reconnecting devices compare canonical events
against local decryptability and imported archives, then request only genuine
readability gaps from every reachable linked source. The device settings page
combines repository declarations, remembered links, live sessions, pending
recovery, and conversation membership into one local roster.