docs: the record of more than one group from the same people (nip17-multiple-ceremonies, Phase 7)

Built except for the device run. The plan keeps its phases as written,
with a table of where the build differs. A ceremony from before names were
carried is matched under its room's name, now pinned in a test; the check
on a real upgraded device has not been done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-11-22 22:59:13 +02:00
1 parent 729efdaca6
commit 03e2d10def
3 files changed
+40 -2

No files matched your search

@@ -330,6 +330,22 @@ class RobustRoomKeyCeremonyTest {
assertTrue(started.content.startsWith("started a shared key ceremony."), started.content)
}
/**
* A ceremony from a build before ceremonies carried names has none on its row. It
* was named by its room when it opened, so that is the name a repeated ask is
* matched against, and a device upgraded mid-ceremony folds into it rather than
* opening a second. docs/nip17-multiple-ceremonies.md, Phase 7.
*/
@Test
fun `a ceremony from before names were carried is named by its room`() = runBlocking {
val room = robustRoom()
val old = openCeremony(room).let { it.copy(subject = null).also { row -> db.dkgSessionDao().upsert(row) } }
assertEquals(old.id, openCeremony(room).id, "the same ask, under the room's name")
assertEquals(old.id, openCeremony(room, subject = "robust group").id)
assertNotEquals(old.id, openCeremony(room, subject = "Agora").id, "another name is another group")
}
/**
* A collapsed ceremony leaves the group with no key and a room they can still
* talk in, which is exactly the group that should be able to try again. Failed
+1 -1
View File
@@ -20,7 +20,7 @@ the [retired](./retired/) notes now.
| [confederation-upstream.md](./confederation-upstream.md) | the work below Giza that unblocks the confederation's Parts B and C: a phased plan, not built, across secp256k1-zkp, secp256k1-kmp and bitcoin-kmp. Covers why the one-process DKG and signing cannot simply be exposed step by step (the coordinator derives everyone's key state, acknowledgment is signed before the share is stored, nonce randomness is derived from the session id), why every DKG step can stay stateless, the storage contract a device follows, and Prefractal as an all-groups-must-sign path that needs no upstream work |
| [automatic-key-ceremony.md](./automatic-key-ceremony.md) | joining is the only approval: a phased plan, built but for its device session, that makes a key ceremony run by itself after a member joins. Covers why contributing and confirming were never decisions a person could add to, the resume sweep that replaces the tap, the coordinator's follow-up steps and the one key state a device can sign without asking, and why abandon stays |
| [ceremony-creation.md](./ceremony-creation.md) | one place to start a key ceremony — how joining a subgroup's ceremony opened a second one for the parent room, the screen that showed a ceremony and offered to start one in the same button, and the removal of the nip30303 documents, whose kinds collided with the ceremony's, leaving the member chronicle with nothing to carry and nothing to say |
| [nip17-multiple-ceremonies.md](./nip17-multiple-ceremonies.md) | the same people making more than one group: a phased plan, not built. Today a second group over the same members lands in the first one's NIP-17 room, finds its finished ceremony and hands that back. Covers why the NIP-17 room is where a group's ceremony is held rather than the group, the fold that blocks a second ceremony and the one that should replace it, why a second ceremony must carry its own name, why the room is not renamed, why one host key per member across ceremonies needs a test before anything relies on it, and the half-dozen reads of "the room's ceremony" that pick the newest |
| [nip17-multiple-ceremonies.md](./nip17-multiple-ceremonies.md) | the same people making more than one group: a phased plan, built except for its device run. A second group over the same members used to land in the first one's NIP-17 room, find its finished ceremony and hand that back; now each group is its own named ceremony in that room, and the room's details list them. Covers why the NIP-17 room is where a group's ceremony is held rather than the group, the fold that blocks a second ceremony and the one that should replace it, why a second ceremony must carry its own name, why the room is not renamed, why one host key per member across ceremonies needs a test before anything relies on it, and the half-dozen reads of "the room's ceremony" that pick the newest |
| [frost-batch-signing.md](./frost-batch-signing.md) | signing several events in one ceremony — why one nonce can never cover two messages, and the phased schema, wire and UI work that follows from it |
| [frost-session-resend.md](./frost-session-resend.md) | asking the members who never got a signing proposal to look again — why a proposer can repeat only what it wrote, why a member's availability signal needs no repeating, and the one half that has to come from the silent member's own device |
| [frost-share-refresh.md](./frost-share-refresh.md) | giving every member a new share of the same group key, phased and built behind a flag that is off in release — why enrollment cannot rotate a share, the zero-sum refresh that can, what a rotation protects against and the two things it never can, and re-enrollment as the repair that brings back the members a refresh left out |
+23 -1
View File
@@ -11,7 +11,29 @@ Read [shared-key-ceremony.md](./shared-key-ceremony.md) first, especially
case: a parent's Marmot room already hosts any number of subgroup ceremonies,
and the code that made that work is the model for most of this plan.
**Not built.** Written against the code as it stood at `3b0b3c9a`.
**Built** except for the device run, one commit per phase on
`claude/nip17-multiple-chilldkg-6903b0` (`dd812950` to the commit carrying
this record), against the code as it stood at `3b0b3c9a`.
`TwoGroupsFromTheSamePeopleJvmTest` runs the whole thing across three
in-memory devices with real ChillDKG and real FROST: Ekklesia, then Agora at a
different quorum, both made at once, and one abandoned while the other
finishes. The phases below are kept as written, because they hold the
reasoning. Where the build differs from the plan:
| what the plan said | what it turned out to be |
|---|---|
| Phase 1 requires a name before the fold is checked | after it. A nameless ask while the room's first ceremony is still running is the repeat `making the same group twice` pins, and has to fold, not throw. The name is required only when nothing folds and the room already holds a group |
| Phase 2's card uses a `<plurals>` entry | two strings, one for a single group and one for several. The app's catalogue has no plurals, and adding the first one for one card was not worth it |
| Phase 3's `Loaded` gains a `name` field | the view model holds `name` beside `threshold`, as the quorum already was. The field is always shown, filled with the room's name for its first group, so a user can rename even the first. The groups already made are named in a sentence, using the creation screen's wording, not drawn as a list |
| Phase 3 deletes the DAO query behind `getLatestSessionForChatRoom` | `getLatestOwnSessionForChatRoom` and `observeLatestSessionFor` are deleted. `getLatestSessionFor`, `getLatestSessionForChatRoom` and `observeLatestSessionForChatRoom` stay, used only by the DAO's own tests. `CeremonyLookupsJvmTest` now expects no app code to call any of them |
| Phase 3's `completedKey` answers when the room holds exactly one completed own ceremony | it counts the ones this device can sign with. A room with one finished key and a second ceremony still running answers the finished one, where the old code answered null whenever the newest ceremony was unfinished |
| Phase 4 names the group on an own ceremony's lines | on every named ceremony's lines, subgroups included. "The group has a shared key", said in a parent's room about its subgroup, was already wrong before this |
| Phase 5's rows open the Marmot room | they open its details, as the admin-room card they replace did. The status icon is `Decorative`, because the row's supporting text states the status |
| Phase 6 signs in `#Ekklesia` and `#Agora` | each derived room id resolves, through `completedKey`, to its own ceremony on every device, and the NIP-17 room to neither. Creating the rooms is recorded through a stand-in `createMarmotGroup`, as `KeyStateSignsItselfJvmTest` does, so nothing is signed inside a Marmot room |
| Phase 7's upgrade-in-place check | the rule it rests on is pinned in `RobustRoomKeyCeremonyTest`: a ceremony row with no name is matched under its room's name. The check on a real upgraded device has not been done |
**Not done:** the device run in Phase 7. Nothing here has run on a phone or
on real relays, including a device upgraded mid-ceremony.
The headline: **a NIP-17 room is where a group's ceremony is held. It is not
the group.** The room's id is derived from its members