Skip to content

feat: let a room's maker add relays for everyone - #194

Open
TheCryptoDonkey wants to merge 3 commits into
mainfrom
feat/room-relays
Open

TheCryptoDonkey wants to merge 3 commits into
mainfrom
feat/room-relays

Conversation

@TheCryptoDonkey

Copy link
Copy Markdown
Member

Part 2 of the 27 Sept durable-history plan: a room owns its relay list. The owner asked to add their own, more resilient relay to a room and have everyone use it.

  • src/room-relays.ts: signRoomRelays / verifyRoomRelays over kithmoot/v1/relays:<roomId>:<version>:<JSON canonical list>, authority = inviter pinned in the link. Canonical = normalised, deduplicated, sorted, at most 8. Not epoch-bound; version orders lists.
  • control.ts: { op: 'relays', relays, version, sig } on the control channel (stored chat, so late joiners read it). No host: anyone may repost, the signature is what counts.
  • Web: members verify, keep the highest version (stored per room), add the listed relays to their room relays (never remove), reconnect the live pool and update their share link. Anyone holding the record reposts it when the log's copy is 20+ days old, so it stays inside the 30-day window.
  • Relay settings: "Use these relays for everyone in this room", shown only on the device holding the root inviter key; requires applied changes; confirmation says the operators will carry the room's encrypted traffic.
  • Vectors: new roomRelays group (1 positive, 3 negative), additions only.

Tests: unit + vectors; room-relays.spec (new), relay-settings, persistent-groups, channels pass on Chromium and Firefox. Every WebKit test (including untouched specs) timed out locally, which matches the local WebKit/Playwright mismatch; CI is the WebKit check.

Not in this PR: Android support (kithmoot-android needs to read the op), keeper-signed records.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CG4pPCsd8pdySNvBpt8fTk

A room's relays were fixed by its link, so nobody could move a whole room
onto a more reliable relay. The maker can now share their room relays
from relay settings: a `relays` op on the control channel, signed by the
authority pinned in the link over the room id, a version and the list.
Every member verifies it, keeps only the highest version, and adds the
listed relays to their own for the room; nothing is taken away. Anyone
holding the record reposts it when the log's copy is 20 days old, so it
stays inside the window a newcomer reads.

Vectors: new roomRelays group (one positive, three negative).

Claude-Session: https://claude.ai/code/session_01CG4pPCsd8pdySNvBpt8fTk
A group link admits newcomers from its kind 1463 invitation alone, so
relays the maker adds for everyone must hold it too.

Claude-Session: https://claude.ai/code/session_01CG4pPCsd8pdySNvBpt8fTk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant