Written against `064ca2c4`, on 2026-11-22. **Built, Phases 0 to 8**, behind
`ExperimentalFeatures.confederation` and `ExperimentalFeatures.groupInbox`, both off in release; the
device run (Phase 9) has not been done. Each phase says under it what was built and where it differs
from what it planned. Paths starting `K/` are under `composeApp/src/commonMain/kotlin/mobi/giza/compose/`.
| phase | commit | result |
|---|---|---|
| 0 | `f78bd16b`, `b2f22f2c` | the plan, and four premises as tests. The broadcast needs no coordinator; the room id is the set of its people; one group's inbox seal opens in another's. **A statement grows with the square of the groups: twelve fit, sixteen do not**, so a confederation names at most 12 groups, not 64. A welcome for a room a device holds is ignored, which Phase 8 had to handle |
| 1 | `e2de3fa8` | two coordinator behaviours pinned beside the two already pinned |
| 2 | `c3d70776` | the statements as rumors, the attestation, ceremony id and seed, admin lists version 2 -- beside version 1 |
| 3 to 5, 7 | `f64f1619` | one commit: statements sealed to every group's inbox and signed by the quorum, read by every admin of every group; the refusals; the ceremony nobody opens, its id from the proposal, its seed from everyone, its broadcast computed everywhere. Schema 48 |
| 6 | `66932a84` | the form looks for every group's inbox and stops at twelve; a heard proposal asks after every group's inbox; Try again |
| 8 | `bad5d122` | an order of who makes the room, an hour a place; a welcome from earlier in the order wins |
| 9 | this commit | the record. **No device run** |
Full `jvmTest` 1,786 at the end, all passing (from 1,776 at Phase 5), with `m3Audit`, `brandAudit`
and `walletAudit` at their budgets and `compileDebugKotlinAndroid` building. Two of the seven full runs
along the way died on a segfault in the bundled SQLite driver, inside a background write
(`UnsignedNostrEvent`, under `NostrDao.commitPublishedNostrEvent`) in a test fork running the identity
and database tests, none of which this work touches; each rerun was clean. It is the crash
[rotate-shares-single-approval.md](./rotate-shares-single-approval.md) recorded: a test leaving a
write running against an in-memory database it has closed. Not investigated here either.
### Can a group be the coordinator of the confederation's DKG?
**Yes, and it does not need to be.** In upstream's protocol (`doc/confederation-protocol.md`
§7, zkp `c68e2384`), the coordinator is defined by what it computes, not by who it is:
- **It has no key.** Nothing the coordinator sends is signed by it. Every role checks the
coordinator's broadcast against dealer records signed by host keys, and a broadcast that does
not match is a `COORDINATOR` fault. The protocol never needs to know who the coordinator is.
- **It holds no secret.** It never sees a plaintext share (§7.4: "The coordinator does not see
plaintext leaf shares").
- **Its steps are deterministic.** `ConfederationDkg.coordinatorStep1(roster, sessionSeed,
dealings)` and `coordinatorFinalize(keyState, authorizations, acknowledgments)` take no
randomness and no secret. Phase 11 of [confederation.md](./confederation.md) already has every
device run `coordinatorFinalize` itself, "so nobody can hand one over".
- **It chooses exactly one thing:** the 32-byte `session_seed`, "fresh random" at session start
(§7.1).
So "a group as coordinator" can mean two things, and only one is worth building:
| meaning | verdict |
|---|---|
| the group's FROST key signs each coordinator message: the opening, the broadcast | **no.** Every such message would be a quorum signing session, with `t_g` people asked and the ceremony waiting on them, to put a signature on a value every participant can recompute and must check anyway. The signature adds nothing a role can use |
| the group makes the coordinator's *choices*, by signing them | **yes.** Which groups, `T`, the name and the expiry are already in the proposal the proposing group signs. The session seed becomes a value derived from every participant's contribution (D9). There is nothing else to choose |
After that, nothing is left for a coordinator to do. The broadcast is computed by every device
from the dealings it holds, as the genesis certificate already is (D8). The confederation's
signing (Part C) went the same way in Phase 14: "the transcript, the certificate, every group's
partial and the signature take no secret, so every device computes them". This plan finishes
the job for the DKG.
### Can the admin pubkeys stop being an encrypted payload?
**Yes.** The admin lists are encrypted today only because one person, the coordinator, had to
read them and nobody else could be written to: no group could be encrypted to, so each
acceptance was NIP-44-sealed to the coordinator's key with an ephemeral key every signer could
recompute ([confederation.md](./confederation.md) D5), and the coordinator later disclosed one
conversation key per acceptance so every participant could open them (D7).
In the supergroup, every message is already read by exactly the admins of every participating
group, and nobody else. That is exactly the set of people the ceremony will put in one room, and
D7 already concluded that "nothing is disclosed that the room would not disclose". So the admin
list goes **in the clear inside the rumor**, and NIP-17's own layers keep it from everyone else.
What goes away:
| today | after this plan |
|---|---|
| the acceptance's content is a NIP-44 payload to the coordinator | the rumor's content is `ConfederationAdminList`'s canonical JSON |
| the `epk` tag and an ephemeral key per acceptance | gone |
| `["confederation_seal", e]` riding the FROST proposal, so each signer recomputes the ciphertext byte for byte | gone. A signer compares its own view of the admins with the plaintext it is asked to sign |
| D7: the opening discloses one conversation key per acceptance | gone. Every participant already read every acceptance |
The admin pubkeys still have to be *shared*: the roster needs them, and every participant must
be able to check every other group's segment before joining, or a group could slip an extra
role into the roster. What changes is that they are shared directly with the people who need
them, at the moment the group accepts, instead of through one person.
---
## What changes, in one table
| | today ([confederation.md](./confederation.md)) | this plan |
|---|---|---|
| who proposes | a member of A, who becomes the coordinator | group A. The member who pressed the button is only the proposer of A's signing session |
| how statements travel | public regular events, kinds 9430–9433, on relays | rumors of the same kinds, in the supergroup, each sealed by its group's quorum. Nothing about the proposal is public until the charter (9434) |
| who can take part | a group with a public kind:0 | a group with a public kind:0, **a 10044 and a 10050** (an inbox) |
| who reads the admin lists | the coordinator, then every participant through D7 | every admin of every invited group, as each group accepts |
| who sees the proposal is ready | the coordinator's device | every admin's device in every group |
| who opens the ceremony | the coordinator, by a button | nobody. Every admin is offered **Join** once every group has accepted |
| the ceremony's room | a NIP-17 room the coordinator makes | the same room, whose id every device derives from the roster's people |
| the session seed | random, from the coordinator | derived from a random contribution in every person's first message |
| the broadcast (30383) | sent by the coordinator | computed by every device; not sent |
| the confederation's Marmot room | made by the coordinator's device | made by the first role holder in a fixed order who is able to, with a fallback |
| if one person's phone is lost | the proposal lapses at expiry | nothing; any admin of any group carries on |
---
## Decisions
### D1. The supergroup is one NIP-17 conversation whose members are the groups
A NIP-17 chat is the set of the rumor's author and its `p` tags. A rumor authored by group A,
`p`-tagged with every other invited group, belongs to the conversation of all the invited groups,
and every group's reply to it, tagged the same way, lands in the same conversation. That is the
supergroup. It has no id of its own beyond the set; this plan files it under the proposal's
rumor id, which is unique.
Each message is the inbox's reply shape ([group-inbox.md](./group-inbox.md) D10), with the group
9432 rumor, content: an optional reason, plain text tags: ["p", …], ["e", <proposal rumor id>]
9433 rumor, content: an optional reason, plain text tags: ["p", …], ["e", <proposal rumor id>]
```
`ConfederationAdminList` keeps its strict decoder, at `v: 2`, with `proposal` absent on a
9430 (it is the rumor's own id, which the content cannot contain). The `group` field is kept even
though the rumor's pubkey says the same, so the list read on its own still says whose it is.
**When the lists are seen.** Each group's admins are seen by every invited group's admins at the
moment it accepts, including any group that goes on to reject. Today only the coordinator sees
them before every group has accepted. The approval screen of an acceptance says so, naming the
groups: "Accepting shows the admins of this group to the admins of Ekklesia, Agora and Polis."
A commit-then-reveal exchange would hide them until every group has accepted, at the price of a
second signing session per group; it is in the appendix, not planned.
### D5. A group's inbox is a precondition, checked at three points
[confederation.md](./confederation.md) D2 required "a public nostr profile". This plan keeps
that, for the name, and adds the inbox:
| where | check | if it fails |
|---|---|---|
| proposing, for every listed group, the proposer's own included | a valid kind:0, a valid 10044 naming one key and a valid 10050, each authored by the group's npub, fetched from relays | that group cannot be added; the picker says which is missing |
| proposing, for the proposer's own group | this device holds the inbox key A has *announced* | **Propose** is disabled: "Set up the group's inbox first" |
| answering | the same for this group, and a 10044 for every other listed group | refused (D6): the answer could not be delivered to every group |
A group that rotates its inbox key while a proposal is open (an admin change does,
[group-inbox.md](./group-inbox.md) D14) keeps reading with its old key, which is kept for
reading only. Its admins have changed, so its acceptance no longer matches its admins and the
ceremony refuses to start over it, which is today's rule ("The admins of … have changed since it
accepted"). The proposal is made again.
### D6. One signing session per statement, and every signer reads what it signs
A statement is proposed through `proposeSigningBatch`: the `N` seals (one per invited group,
own copy included), with two hidden tags in the MLS-encrypted proposal:
```
["inbox_manifest", …] group-inbox D11, unchanged: each seal's recipient, key and 10044
["confederation_rumor", <the rumor's JSON>]
["confederation_invitation", <the signed seal that delivered the proposal to this group>] answers only
```
`confederation_rumor` is in the clear, inside the room's encryption, on purpose: every member of
the group, admin or not, sees what the group is being asked to say about a confederation, which
today they see on relays. Only the other groups' lists stay with the admins.
`confederation_invitation` does for an answer what today's `confederation_proposal` tag does: a
signer does not depend on its own inbox having received the proposal. It opens the carried seal
with its own inbox key and checks A's signature on it.
`ConfederationRefusal` gains a seal arm, in the four places it already sits. The batch is routed
to it, and not to `InboxRefusal`'s reply checks, by the `confederation_rumor` tag: a batch of
kind 13s with that tag is the confederation's, and one without is a reply or a threshold-ECDH
message, as today (`GroupSealRoutingJvmTest` gains a case). A signer:
1. declines unless this device holds the group's announced inbox key ("This device can't read
what the group would be sending"). That is a share-holder who is not a current admin;
2. opens the manifest and every seal, and declines unless every seal holds the rumor in
`confederation_rumor`, byte for byte, and the seals are exactly one per listed group, each to
the key that group's carried 10044 names;
3. checks the rumor: its kind, its `p` tags exactly the other listed groups, its pubkey this
room, its `created_at` within ten minutes of now;
4. for a **9430**: `N` in `2..64`, `T` in `2..N`, the expiry in the future and at most 30 days
away, this room listed, and the content equal to the admin list this device builds from
`RoomAdmins.of` and the threshold its active share generation signs with;
5. for a **9431**: the carried invitation opens with this device's inbox key to a 9430 from its
author, that lists this room, and is not expired, withdrawn or rejected on this device; this
group has not answered; the content matches this device's own admin list, as for a 9430;
6. for a **9432**: the same invitation check, and this group has not answered;
7. for a **9433**: this room wrote the proposal, and it is not yet `ACCEPTED` on this device.
Warnings, shown and not refused, as [confederation.md](./confederation.md) D6 drew the line: a
listed group whose kind:0 cannot be found right now; a listed group this device has never seen;
an expiry within a day; and, on an acceptance, the sentence of D4 naming who will see the list.
### D7. Every admin of every group holds every statement, and computes the state
Statements arrive through the inbox pipeline (`GroupInboxManager`), which already subscribes to
wraps addressed to every group this device holds an inbox key for. A rumor of a confederation
kind is handed to `ConfederationManager` instead of being filed as an inbox message, and is
stored with the seal that delivered it, as evidence (Phase 5).
`ConfederationStatus` is unchanged in substance: `OPEN`, `ACCEPTED`, `REJECTED`, `EXPIRED`,
`WITHDRAWN`, computed from stored statements whenever it is read, with an answer counting only if
its rumor's `created_at` is by the expiry, and a rejection beating an acceptance. The rumor's
`created_at` is the group's: its quorum signed the seal over it, and every signer checked it was
now (D6, step 3).
What changes is who can compute `ACCEPTED`: every admin of every invited group, because each holds
every statement. So every one of them is shown **Join the key ceremony** at the same moment, with
no one opening it (D8).
Members who are not admins see a line in their group's room when their group signs a statement,
from the signing session, as today. They do not see other groups' statements. That is less than
the public events gave them, and the charter is still how they learn the confederation exists.
### D8. The ceremony has no coordinator
The ceremony's rounds are unchanged but for the two that had a sender with authority:
| kind | today | this plan |
|---|---|---|
| 30380 opening | the coordinator's: the 9430, every 9431, D7's keys, the session seed | **not sent.** Every device builds the same opening from the statements it holds |
| 30381 host keys | each person, one key per role | each person, one key per role, **plus** a 32-byte random `seed` and the `attestation_ref` this device built |
| 30382 dealings | each person | each person, under the derived seed (D9) |
| 30383 broadcast | the coordinator's, checked byte for byte | **not sent.** Every device runs `coordinatorStep1` over the dealings it holds |
| 30384 authorizations | each person | each person, **plus** the `operation_session_id` this device computed |
| 30385 acknowledgments | each person | unchanged |
| 30387 failure | anyone | unchanged |
**The implicit opening.** Once a device holds an `ACCEPTED` proposal it builds the plan as
`ConfederationRitualManager.planFrom` does today, from the statements instead of an opening:
```
groups = the proposal's group npubs, sorted bytewise
admin lists = the proposing group's from the 9430's content, every other group's from its 9431
**Done**, on 2026-11-22. `ConfederationWithoutCoordinatorPremiseJvmTest` keeps checks 2 to 5:
| check | result |
|---|---|
| 1. the session seed | **asked, not answered.** §7.1 asks only that a seed be fresh and never reused within a role; nothing in §7 needs it before the host keys exist, since the host keys do not take it. D9 is built as written, with the contributions as an input that can be dropped |
| 2. the broadcast | **holds.** `coordinatorStep1` gives the same bytes over the same dealings in any order, and every role going on with the broadcast it computed itself reaches the same key |
| 3. the room id | **holds.** Two people calling `createNip17ChatRoom` over the same people get the same `ChatRoom.id` |
| 4. size | **D4's ceiling is wrong.** The bytes a statement's FROST proposal carries grow with the square of the groups (each seal holds a rumor naming every group): 5 KB for 2 groups, 28 KB for 8, 44 KB for 12, **65 KB for 16**, 609 KB for 64, at five admins a group. So a confederation in the supergroup is held to **12 groups** (`ConfederationKinds.MAX_SUPERGROUP_GROUPS`), and every statement is checked against 60,000 bytes when it is proposed (`MAX_STATEMENT_BYTES`), since an admin list of 128 adds about 8 KB a seal. The one-rumor proposal of D4 is still right: two would halve the ceiling again |
| 5. group to group | **holds.** A seal from A's inbox key to B's announced key, wrapped to B's npub, is opened by B's admin with the seal's `n` tag and verifies as A's. Today it is filed as an inbox message of kind 9430; Phase 5 flips that |
| 6. two creators | **a welcome for a room id the device already holds is ignored** (`NostrDao`'s welcome branch joins only when `findChatRoomById` is null). So with two creators each device keeps whichever welcome reached it first, and the room splits. D11's tie rule needs code in the welcome path: for a confederation's room, a welcome from a creator who sorts before the one this device joined under replaces it. Phase 8 |
- `ConfederationStatements`: builds and parses the four rumors of D4, with `v: 2` content and no
`coordinator` tag. `ConfederationProposalEvent.Proposal` loses `coordinator` and gains the
proposing group's `ConfederationAdminList`.
- `ConfederationAdminList` at `v: 2`, strict, with `proposal` absent on a 9430.
- `ConfederationSupergroup`: the recipient set (every listed group), and the supergroup's key (the
proposal rumor id).
- `ConfederationAttestation`: D8's `attestation_ref` and ceremony id, D9's seed.
- `ConfederationRitualEvents`: drop `OPENING` and `BROADCAST`; 30381 gains `seed`, `attestation_ref`
and the rumor ids; 30384 gains `operation_session_id`; an `attempt` tag on every ceremony message.
- Delete `ConfederationSeal`, `ConfederationEphemeralKeyTag`, `ConfederationSealTag` and
`ConfederationCoordinatorTag`.
Storage, schema 47 → 48:
| table | change |
|---|---|
| `ConfederationEvent` | holds rumors: `rumorJson`, `sealJson` (the seal that delivered it here, as evidence), `inboxRoomId` (whose inbox opened it); `publishedAt` and `ownSessionId` go, since the inbox's publication table owes wraps |
**Phases 3, 4, 5 and 7 built, in one commit**, with schema 48 from Phase 2. They could not be split:
a statement is an unsigned rumor, so a coordinator's opening that carried statements would have held
nothing a participant could check, and the ceremony had to stop being opened in the same change that
stopped Part A being public. Where the build chose differently from the phases above:
| what the plan said | what it turned out to be |
|---|---|
| D8: ceremony id from `attestation_ref` and the attempt | **from the proposal's id and the attempt.** Built as planned, a group that told two groups different things gave their admins different ceremony ids, so each side waited in a ceremony of its own for people who never came, and the attestation check in the 30381 never ran. With the id from the proposal, every device meets in one ceremony and the first message names the group |
| D8: the room every device derives | as planned; and a device replays a ceremony's waiting messages from **any** room (`GiftWrapPayloadDao.getByKinds`), since a sender whose statements differ names other people, and so another room |
| Phase 7: `planFor(proposalId)` | `basisFor`, `planFrom(basis)` and `planOf(ceremony)`. The basis (the proposal and every acceptance, as rumors) is kept on the ceremony as `basisJson`, the renamed `openingJson` |
| Phase 7: `join` makes the room if it is not here | and the ceremony row itself: nothing is made on a device until its owner joins. Messages that came before are replayed; a missed abandonment ends a late joiner's attempt at once |
| D10: **Try again** | `join` after a failed or abandoned attempt joins the next one, so the screen needs no second button |
| Phase 2: `ConfederationEvent` loses `publishedAt` and `ownSessionId` | kept: the charter is still owed to public relays by `ConfederationPublisher`. A statement's wraps are owed through `GroupInboxPublication`, by `InboxReplies.onSigned` as for a reply |
| Phase 2: a manual migration | an `AutoMigration(47, 48)` with a spec: `@DeleteColumn` and `@RenameColumn`, and `onPostMigrate` dropping version 1's statements and every ceremony and confederation built on them |
| Phase 3: `InboxMessages.build` | `InboxReplies.sealRumor`, which `InboxReplies.build` now calls; and `InboxRefusal.readSealed`, the reply's checks for any rumor kind, which the confederation's refusal calls |
| D6: a statement's `confederation_invitation` | the seal that brought the proposal to this group, from the store; none for the proposing group's own statements |
| D6: a 9433 withdrawal | built with any group as its author, so a group that tries to withdraw another's proposal is declined by its own signers (`NOT_PROPOSER`) rather than refused by the builder |
| Phase 8: Phase 13's room | made, for now, by the first of the roster's people, sorted (`ConfederationFollowThrough.creatorOf`). The fallback and the tie are Phase 8 |
| outcome: a group with no profile on this device stops the ceremony | a note, not a problem: every device computes it now, and a lookup that has not come back on one device would have stopped only that device's join |
Tests, all passing: `ConfederationNetworkJvmTest` 7/7 on a harness of three groups of three, each
with a real inbox ceremony (`ConfederationTestGroups`, now a harness, over a `GroupInboxHarness` that
takes its dealer key and room name); `ConfederationDeclineJvmTest` 15/15 on the same;
`ConfederationCeremonyJvmTest` 13/13 and `ConfederationSigningJvmTest` 7/7 on `ConfederationPeople`
(every admin of every group with every statement filed beside its seal, from
D15), and cannot check the statements. Their group's admins have changed, so the ceremony would
refuse anyway: the proposal is made again.
- **Every admin of every group must still join** ([confederation.md](./confederation.md) D11).
- **Signing still has a proposer per attempt.** Part C's selection is fixed by whoever proposes the
attempt, and any role holder may. That is not a coordinator in the sense this plan removes, and is
left as it is.
- **Not for value.** Upstream's warning stands.
## Risks
| risk | what to do |
|---|---|
| upstream says D9's late seed does not meet §7.1 | the fallback seed without contributions: unique, known in advance, chosen by nobody (Phase 0, check 1) |
| a 64-group statement does not fit one proposal | lower the maximum `N` and say so on the picker (Phase 0, check 4) |
| an admin's device misses a wrap (the inbox's live subscription has no catch-up past its `limit`) | the proposal screen names the group whose statement this device lacks; any admin of that group can **Send again**. The answer's signing session carries the invitation, so signing never depends on it |
| two devices make the confederation's room | D11's order, delay and tie rule; Phase 0 check 6 first |
| a group's quorum equivocates | caught at the first ceremony message, by group (D3, D8) |
| a dealer equivocates | caught at the authorizations, by dealer (D8) |
| a group's inbox rotates mid-proposal | its admins changed, so the ceremony refuses, as today; the old key still reads what was sent |
| the supergroup's wraps are dropped by a group's 10050 relays | the group chose them; the inbox setup fills in relays that take gift wraps |
## Out of scope
- **Threshold ECDH members.** A group with a 10050 and no 10044, reached through
[group-threshold-ecdh.md](./group-threshold-ecdh.md). It would read each statement once `t` of its
admins have answered.
- **Running upstream's investigation locally**, now that every device holds every dealer's vector.
- **Commit-then-reveal admin lists** (appendix).
- **Moving the ceremony's messages into the supergroup** (appendix).
- **Governance of the confederation's room**, as in [confederation.md](./confederation.md).
---
## Appendix: considered and not chosen
| idea | why not |
|---|---|
| the proposing group's FROST key signs every coordinator message | a quorum asked per message, to sign values every device recomputes and checks anyway (*The two questions*) |
| keep a coordinator, but a member chosen by rule (the first admin of A, say) | it keeps the single point of failure, only moves it. Nothing the coordinator does needs one device |
| keep the public 9430–9433 and send only the admin lists through the supergroup | two transports for one statement, and the public half keeps the metadata leak. The charter is the public statement |
| public acceptances carrying a hash of the admin list, the list itself in the supergroup | transferable evidence nobody needs: every group checks its own sealed copy, and the roster catches a split (D3) |
| a 9430 and a separate 9431 from the proposer, as today | `2N` seals, more than one batch above 32 groups (D4) |
| commit-then-reveal: accept with a hash, reveal the list once every group has accepted | hides each list from a group that goes on to reject, at the price of a second signing session per group and a second wait on every quorum. Worth building if disclosure to rejecting groups matters in practice |
| the ceremony's messages in the supergroup: each admin writing as themselves to every group's inbox key | one seal per group rather than per person, and only the groups' relays to know. But it puts high-volume, person-to-person traffic into the groups' inboxes, couples the ceremony to every inbox's rotation state, and the NIP-17 room it would replace already works. Revisit if delivery to personal DM relays proves unreliable |
| the session seed from the proposal alone | unique, but fixed before anyone joins and so known to all in advance; D9 makes it unpredictable for the cost of 32 bytes in a message already sent |
---
## Order and size
| phase | rough size | depends on |
|---|---|---|
| 0 | scratch tests, this document, a question upstream | — |