docs: the group's direct messages, built (group-threshold-ecdh, Phase 11)

The plan marked built through Phase 10, with what it said against what was
built, and its known gaps; the README row and a since note on confederation.md
D5. The device run has not been done, and the flag stays off in a release
until it has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-11-22 12:08:26 +02:00
1 parent 49fb8a92bf
commit 082d097143
3 files changed
+47 -2

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ the [retired](./retired/) notes now.
| [dependency-update.md](./dependency-update.md) | moving everything else in the catalogue to its newest stable release, phased and built but for a mac, devices and pushing the submodule branches — why the libraries go first and need no newer Kotlin, why AGP and Kotlin can only move down the whole submodule chain at once, the material3 alpha that was built for an older Compose than the app's, and what has to keep opening on a device afterwards |
| [giza-wallet-removal.md](./giza-wallet-removal.md) | taking every wallet out of Giza, phased and built but for moving off the wallet library (7b). Covers why a Giza member declines a Bennu peer's wallet proposal instead of ignoring or signing it, why the wallet's kinds are retired rather than freed, why a recovery phrase stays as a key backup that has to derive the same npub and id byte for byte, and why the threshold crypto keeps the build tied to the wallet library until the last phase |
| [group-nostr-profile-and-posts.md](./group-nostr-profile-and-posts.md) | bringing back the group's nostr profile and its posts, ported from Curare, phased and built but for its device run: why it is a port and not a revert of `b21f4c4d`, what Giza does today with a peer's kind:0 or kind:1, why relay lists stay out, why the group's lightning address is kept but never offered, why a broadcast never writes a `NostrEvent` row and sends nothing but those two kinds, and declining what no reader would show |
| [group-threshold-ecdh.md](./group-threshold-ecdh.md) | a group that sends and receives NIP-17 direct messages at its own npub, with stock NIP-17 on the wire: a phased plan, not built. The admins' shares compute ECDH together, so no device ever holds the group's key and the conversation key is the one any NIP-44 library would derive. Covers the tweak signs the npub's derivation puts into the arithmetic, the proof every partial carries, why partials go only to current admins (so a removed admin is cut off at once), why a device multiplies only by a key whose owner has signed something, why reading asks nobody and writing asks the quorum, and how it compares with a NIP-4E inbox key |
| [group-threshold-ecdh.md](./group-threshold-ecdh.md) | a group that sends and receives NIP-17 direct messages at its own npub, with stock NIP-17 on the wire: built behind `ExperimentalFeatures.groupDirectMessages` (Phases 0 to 10), not yet run on devices. The admins' shares compute ECDH together, so no device ever holds the group's key and the conversation key is the one any NIP-44 library would derive. Covers the tweak signs the npub's derivation puts into the arithmetic, the proof every partial carries, why partials go only to current admins (so a removed admin is cut off at once), why a device multiplies only by a key whose owner has signed something, why reading asks nobody and writing asks the quorum, and how it compares with a NIP-4E inbox key |
| [giza-app-icon.md](./giza-app-icon.md) | the sphinx icon on iOS, desktop and in the app, phased and built but for the checks on a mac, a phone and Windows — one master SVG and one generator for every raster, why the iOS light icon must carry no alpha channel, why its dark icon is transparent and its tinted one grayscale, the desktop installers and window that show Java's icon today, and why the mark's cutouts need no fill rule |
| [member-admin-promotion.md](./member-admin-promotion.md) | making a member an admin and back, phased and built, promotion with a share and demotion with a refresh under the experimental enrollment, under three rules: every admin holds a share, every commit in a keyed room is a proposal until the group's threshold signature is on it, and a robust group keeps at least three admins. Covers why the commit rides inside the group's signature and the rule inside the group's state, which lets every device refuse an unsigned commit with the libraries as they are, why a member's own leave stays exempt, and why a removed admin comes back as an admin when re-invited today |
| [admin-change-rotation.md](./admin-change-rotation.md) | an admin change carries its rotation with it: a phased plan, built but for its device session, in which the rotation that follows removing an admin, and the one before a first promotion, asks nobody, because the group's signature on the change already decided who is withheld, and in which admin changes and rotations take turns. Covers the five ways the two overlap today, a removed admin who keeps a live share among them, and the one check a device makes to take part unasked |
+7
View File
@@ -263,6 +263,13 @@ the group in the usual way, because NIP-44's conversation key is an ECDH between
sender's secret and the recipient's pubkey. For the same reason, nothing can be gift-wrapped
*to* a group's npub.
> **Since** [group-threshold-ecdh.md](./group-threshold-ecdh.md): a group *can* now be written
> to at its npub, through its admins' shares computing the ECDH together, where it has opened
> its messages (signed a kind 10050). That needs `t` admins' apps to answer, and a device
> multiplies only by a key whose owner signed something it can check, so it is no use to this
> seal: the coordinator's key is not one the group could compute for in a signing session.
> D5's seal stays as it is.
The acceptance uses an ephemeral sender key instead, and makes everything about the
encryption reproducible by the group's members and by nobody else:
+39 -1
View File
@@ -36,7 +36,9 @@ by its own ceremony and held whole by every admin (`group-inbox.md`, written alo
one and not merged). *Against the NIP-4E plan* below says where the two differ, and how
they fit together if both are built.
**Being built.** Phase 0 is done, and its findings changed D4 and D11. Written against `5ac4c053`, on 2026-11-22. Paths starting `K/` are
**Built, Phases 0 to 10**, behind `ExperimentalFeatures.groupDirectMessages`; the device run
(Phase 11) has not been done. *What the plan said, and what it turned out to be* is below the
phases. Written against `5ac4c053`, on 2026-11-22. Paths starting `K/` are
under `composeApp/src/commonMain/kotlin/mobi/giza/compose/`, and `B/` is bitcoin-kmp's
`src/commonMain/kotlin/fr/acinq/bitcoin/`, under
`lightning-kmp-app/experimental/lightning-kmp/experimental/bitcoin-kmp/`.
@@ -773,6 +775,42 @@ Routes and screens, each with a back button, `readableContent()`, the four state
---
## What the plan said, and what it turned out to be
Built in eleven commits on top of `5ac4c053`, one or two per phase. The tests named in each
phase exist and pass; `ThresholdEcdhPremiseJvmTest` keeps Phase 0's six checks.
| the plan said | what was built | why |
|---|---|---|
| `K/crypto/threshold/` | `K/cryptography/threshold/` | the app already had a `cryptography` package |
| D3: the `PrivateKey` constructor rejects a hash at or above `n` | it does not; `Dleq` calls `isValid()` on every hash it reads as a scalar | Phase 0, check 4 |
| D4: each partial message's payload sealed once per admin | the payload is encrypted once under a fresh key, and only that key is sealed per admin (`AdminSeal`) | Phase 0, check 6: 918 KB for twenty items and seven admins |
| D9, D11: the first partial carries the wrap as evidence | wraps and seals are named by the wrap's id; only a recipient's evidence travels | Phase 0, check 6: one wrap of a long message is most of a relay's event |
| D11: a device answers a round once | a device answers once, and sends its partial *again* to an admin whose message shows it lacks it (each item lists the partials its sender holds, `have`) | Phase 7: an admin promoted after a round combined was never answered, because nobody answers a combined round |
| D12: one `dm_manifest` tag per admin | one `dm_manifest` ciphertext and a `dm_slot` per admin, the same shape as the partials | `AdminSeal`, for the size reason above |
| D13, check 4: the approval waits, and the signing screen says it is waiting for a key | the proposal is held unfiled and handed to the signing manager again when the recipient's round combines (`GroupDmSender.retryHeld`); nothing shows on the signer's device while it is held | the arrival check needs this device's nostr key to open the manifest, and a session filed as asked could be approved before it was read |
| D13: a decline says which check failed | three reasons: `REASON` for any of D13's checks, `CANNOT_READ` for a device that is not a current admin or a batch with no manifest, `FEATURE_OFF` with the flag off. A decline published later, without the key to hand, gives the general one for an admin | `publishDecline` has no nostr key; the specific reason is in the log |
| Phase 4: `GroupDmOutbound` for a message's wraps | it also carries the group's signed 10050, owed by the proposer (`recipient` is the group) | one publisher, `GroupDmPublisher`, for everything the group's mail owes relays |
| Phase 6: the setup screen shows the relays to edit | one field, one `wss://` address per line, refused until every line is a public relay | |
| Phase 7: `DirectMessagePeerSync` fetches each correspondent's 10050 and kind 0 | not built. Evidence and relays come from what the device already holds: a seal the person sent the group, or their kind 0, 10050, 10002 or 1 in the `NostrEvent` table. The composer says when there is none | the profile sync the app already runs fills the table for anyone the device has looked at |
| Phase 7: the rate cap set from the batch size | 60 new wrap rounds per room per hour, two batches' worth | |
| Phase 8: outgoing states and Send again | built in Phase 9, with the data they read: being signed, signed and not yet sent, sent, signed but not sent, declined. Send again is offered on any admin's device for the two unsent states | only the proposer's device wraps on its own, so another admin's cannot tell sent from not |
| Phase 9: the signing screen shows the text, what it answers and the recipients | as notes under the seals, beside the confederation's (`DatabaseFrostSigningRepository.confederationNotes`) | the screen already had the slot |
| Phase 10: the wipe on seeing oneself removed | on every sweep, and whenever partials still reach the device: keys, messages, wraps and rounds, the freed pages scrubbed, and one line in the room | |
### Known gaps
- **No device run.** Phase 11's seven steps have not been done; the flag stays off in a release
until they have.
- **A held proposal is invisible.** A signer whose device is still computing a recipient's key
sees nothing until it has; in practice the partials arrive before the proposal does.
- **A device that is not the proposer cannot tell whether the message reached its recipients**,
only that the group signed it. Send again is how it makes sure.
- **The rounds move only in the foreground**, as every ritual here does.
- **A promoted admin reads the past** (D14), and narrowing that is out of scope.
---
## Risks
| risk | what to do |