In a governed keyed room, with share rotation on, an admin can propose
removing another as admin -- never themselves, since the rotation that
has to follow is the remaining holders'. The demotion is a signed change
like any other, and the floor holds. A removal of a member who holds a
live share is the same.
Either one remembers who to rotate out (GovernanceProposal.thenRotateWithout,
schema v42), is marked applied when a relay accepts it, and
GovernanceFollowThrough -- a driver beside the ceremony follow-through,
with the key pair -- then proposes the rotation without them. A change
that landed while the app was closed is caught from the group's state; a
rotation that cannot start is said in the room, and offered from the
Shares section.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robust-group-admins built the same thing as this branch's Phase 1: a single
writer for Participant.adminAt, run at creation, on the Welcome, on every
commit and once at start. Its AdminFlags is kept as that writer; this
branch's MarmotInboundManager.reconcileAdmins and adminFlagChanges are
gone, and the direct-message and convenient-room creation sites and the
detail screen's catch-up call AdminFlags instead. The admin captions stay,
on top of it.
Both sides added to the room's details: the founding-admin repair and
invite beside the member menu, admin labels and governance section. The
member row keeps one label line -- Admin from adminAt, Holds a share
beside it -- and the removal message now has three cases: proposed for the
group's signature, rotation held, or sent. The rotation offer waits for
both: a rotation available, and the removal not still awaiting signatures.
addAdmins, the founding-admin repair, proposes its commit for the group's
signature in a governed room instead of committing it bare.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wallet audit fails on a retired kind's number anywhere in the app's
code, comments included; Phase 3 spelled the range out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a governed room, removing a member, inviting one and disbanding are
proposed and signed by the group instead of committed by one admin. A
removal is now one commit -- the Remove and, for an admin, their entry off
the admin list -- since a copy of the group can stage both where the
manager could not. Disbanding a room that has not yet agreed it can be
disbanded proposes that agreement first.
An admin's device folding in a member's leave sends it inside its own
envelope (30371), not bare. The commit builders live on GovernanceManager
so the DAO and the tests use the same ones.
Fixes a gate bug the inbound removal test found: a Remove's account is
now read off the group as it stood before the commit, because the copy's
view can already have the removed leaf blank.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GovernanceManager.propose builds the commit on a copy of the group whose
policy records its proposals -- so the statement is read off the very
commit -- builds the kind:445 that carries it without publishing it, and
opens a signing session over the statement whose content is that kind:445.
A GovernanceProposal (schema v41) keeps the states either side, because
this device cannot process its own commit and signing outlasts a session.
Every member's device runs the same checks as the door before its owner is
asked, and declines a statement whose commit does not say what its tags
say. When the session completes on the proposer's device, it sends the
signed statement in a carrier and raises the publish gate with the kept
state; the relay's OK on the carrier installs it. A proposal the group
moved past is marked stale and said so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each device says once per keyed room, as GovernanceSupportEvent (30372),
that it follows signed commits, and says it back whenever it hears another
member say it, so a member who never opens the room is still counted.
An admin's Require the group's signature for changes is one bare commit
adding GovernanceMarker's line, with the floor the room's quorum sets, to
the profile description: the room's last bare commit. It is refused while
any member has not said it -- they would be left in a different group by
the first change -- and while the room has fewer admins than the floor.
The room's screen says which, or that the rule is on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A keyed room whose profile description carries GovernanceMarker's line --
changes need the group's signature, and at least N admins -- is governed,
and every device reads that from the same epoch's state.
GovernanceGate is the door. At the one inbound call into the engine, a
commit sent bare into a governed room is dropped before the engine sees
it: the outer layer is peeled with the current and retained epochs' keys
and the MLS content type read from the header. A commit arrives instead
inside an envelope whose content is the proposer's own kind:445, so every
device applies the same event with the same id:
- a statement (30370), signed by the room and sent in a member's carrier
(30373), since an application message has to be its sender's;
- an own commit (30371) for D6's exemptions, sent by its committer.
The commit is run on a throwaway copy of the group under a policy that
records its proposals and committer -- no library change -- and admitted
only at the current epoch, matching its statement exactly, and leaving the
marker's floor of admins. A refusal says so in the room.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
giza brought rotation-waits-for-key-state, built in parallel from the
same base, and robust-group-admins. The first overlaps this branch, and
the two agreed on not asking the proposer. Where they met:
- The proposer's dialog is this branch's, read from the proposal's own
plan with its refusal, under giza's title and caveat; giza's dialog,
which listed stale members from the summary, went. The preview's
refusal carries rotationHold's reason, and ChatRoomDetailSharesJvmTest
asks its question of the kept dialog.
- The proposer is approved to take part only; giza also set
confirmApprovedAt, which nothing reads.
- The Shares section keeps both: giza's held button, its reason and
'Ask the group to sign', and this branch's running card and abandon.
- giza's hold tests left the new key state unsigned by not signing it.
It signs itself now, so they hold the signing messages after the
proposal (signingHeldOpen). This branch's test of two rotations opened
at once gave way to giza's, which asserts more.
jvmTest 1281/1281, compileDebugKotlinAndroid, m3Audit at its budgets,
brand and wallet audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GovernanceStatementEvent, kind 30370 (past the retired wallet kinds): one
epoch, and exactly what the commit made at it does -- who it adds, by the
KeyPackage that adds them; who it removes, by account; the whole admin
list after; and every other component it changes, by id and the hash of
its new value. Signed by the room, whose id is the key that must have
signed, so isSignedByRoom checks it with nothing looked up.
GovernanceChange.of reads a commit's proposals into those terms, refusing
anything a statement cannot describe; authorises holds a commit to its
statement, nothing more and nothing less; isExempt is D6's exemption, a
member's own leave and a committer's own key update. The signing approval
reads it in names. Pure: nothing enforces it until Phases 0 and 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every founding member of a robust group is its admin, phases 0-7
(docs/robust-group-admins.md). Two conflicts, both adjacent additions:
the detail screen's strings read outside the click handlers, and the
view model's companion constants. Both sides kept. jvmTest 1261/1261,
compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChatRoomType.minimumAdmins(t) is max(3, t): in a keyed room the admins are
the share holders, so fewer than t of them is a key that can never sign
again. AdminGovernance.adminFloor reads t off the room's completed
ceremony (the size floor alone where this device holds none), removeMember
refuses a removal that would cross it, and the member row stops offering
one. A convenient room's floor stays the library's depletion guard.
The policy half -- every receiving device refusing such a commit -- waits
on Phase 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each member row says Admin and Holds a share as two labels, read off the
group's state and the Shares roster; when they disagree a share is owed
or still to be rotated away. An admin's row has an overflow menu whose
items AdminGovernance.memberActions decides: make admin, remove as admin,
step down on your own row, remove from group. Promotion and demotion ask
first, and promotion says what it gives away.
Leave group, pressed by an admin, opens a dialog instead of a refusal:
step down and leave when another admin remains, or, for the only admin,
pick who takes over (or disband instead). stepDownAndLeave chains the
commits through MarmotEngine.afterConfirmed, which is now registered
before the commit it waits on and taken back if publishing throws.
Keyed rooms keep removal only; their admins wait on the group's signature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AdminFlags.reconcileAll runs AdminFlags.reconcile over every room this
device holds MLS state for, and the sync start calls it once, through
ChatRepository.reconcileAdminFlags, beside the ceremony resume. A room
joined before Phase 2 flags nobody on the joiner's device until some
commit arrives, and a robust group's admin room may never get one.
No stored "done" flag: a room whose rows already agree is a read and no
write, so a second start costs one decode per room. A room that will not
decode is logged and passed over.
RobustGroupAdminsJvmTest: a joiner's cleared flags are restored on both
profiles, and a second pass changes nothing. jvmTest 1250/1250,
compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarmotOutboundDao.promote and demote commit the room's admin list through
the publish gate, built from the list the group holds when the commit is
staged. AdminGovernance holds the rules once: the library's permissions,
plus that a promoted account holds a leaf, and that a keyed room's admins
are changed by none of this -- they need the group's signature and a
share of its key, which are not built.
Removing an admin now takes them off the admin list first and removes
them when that commit is confirmed, chained by MarmotEngine.afterConfirmed.
A bare Remove left their key on the list, so inviting them back made them
an admin again with nobody having said so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The member list labels admins, from the flags AdminFlags keeps. Two
cards on the error container, under the signing key and the parent:
founding members the room's policy does not list as admins, with "Make
them admins" for an admin of a current-profile room; and founding
members the founding invite never reached, with "Invite them" on the
device that holds the room at epoch 0. Founders are named through their
profiles, since an uninvited one is not in the room to read a row off.
A robust group's NIP-17 room has no admins of its own, so its details
link to the admin room its ceremony made (ChatRepository.adminRoomOf),
saying every member is an admin there.
Strings in the catalogue, sentence case; colours from the error
container roles; spacing from the scale; the actions guard a second tap.
m3Audit: all budgets met. jvmTest 1249/1249, compileDebugKotlinAndroid.
Not looked at in a running app.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarmotGroupCreation.finishFoundingInvite invites the founders a room's
founding invite never reached, in one commit, every key package first as
at creation. It acts only on a room still at epoch 0: the founding
invite is the commit that ends epoch 0, and leaving is a commit too, so
a founder without a leaf there is one nobody ever invited -- never one
who left. CeremonyFollowThrough takes it as step 4 once the room exists,
on the coordinator's device; the repository exposes it by room for the
detail screen, with the set it would invite.
Also fixes what Phase 0 found. MarmotGroupCreation invited the founders
through a room read before its routing id was recorded, so on the
current profile the engine adopted a second copy of the group under the
room id, and the copy at the real address still held only its creator:
every later invite took the founding path, with no commit and nobody
already in the room told. It now reads the room again first.
RobustGroupAdminsJvmTest: a room left without its invite is finished and
every founder joins as an admin, on both profiles; a room past its
founding invites nobody; a later member on the current profile now gets
a real commit. CeremonyFollowThroughJvmTest: step 4's outcomes.
jvmTest 1249/1249, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TYPE_ADMIN_ADDED and TYPE_ADMIN_REMOVED, derived like the membership
lines: processGroupMembershipChanges compares the group's admin set before
the commit with the one after, on every device that applies it. The prior
set comes from the group's state -- captured before the engine moves the
group on the inbound paths, and from the obligation's prior state on a
confirmed own commit -- never from the adminAt flags. An account that
left the tree gets its departure line and no admin line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing the second approval took away the only abandon button a member
who had taken part could reach: it lived on the approval row. A running
rotation is now a card above the members -- the step it is on (dealing,
storing, the group signing the new key state), who it waits on and since
when, and Abandon, behind a confirmation, for any member taking part.
It counts as running until the new generation's key state is signed,
while that signature is open, because the old shares wait on it. A
rotation that ended without completing says why until the next one.
The taking-part row now says what it decides: who is left out and as
what, and that nothing more will be asked. REFRESH_CONFIRM and its
string are gone from the UI state.
ShareRefreshManager.progress reads the step and who is missing from
stored messages. Those are now stored once, on first arrival, in record
and publishOwn: a redelivery rewrote the row and reset the stall clock.
Tests: the row names the withheld; the withheld member sees the rotation
run and cannot abandon it; the waiting-on names at dealing and storing;
the signing step, which nobody abandons; an abandoned rotation says why.
The stall-clock test backdates the messages first, and fails with the
old store-every-time behaviour put back. jvmTest 1250/1250; m3Audit at
its budgets; brand and wallet audits.
Not seen on a device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FoundingAdmins.check compares a key-backed room's admin policy with the
participants of the ceremony that made its key, as this device's own
DkgSession row has them -- and, for a subgroup, with the admins its
parent's birth certificate names. NotKeyBacked, CannotCheck (a later
joiner, who holds no ceremony), Matches, or Missing with who.
At the Welcome, after the key state is adopted, a room missing founders
gets one transcript line naming them (TYPE_FOUNDING_ADMINS_MISSING, a
membership line). The detail screen reads the check on every load into
ChatRoomDetailUIState.missingFoundingAdmins.
The repair is MarmotOutboundDao.addAdmins: one gated commit on the
current profile that writes the policy the group holds now plus the
missing founders -- additions only, never a list built elsewhere. The
legacy profile has no governance commits in this app, so a legacy room
gets the warning without the repair.
FoundingAdminsJvmTest: each Check, the pre-column fallback, the line
written once and only when someone is missing, and the repair on the
current profile through a relay's OK. jvmTest 1245/1245,
compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Participant.adminAt was written only when a commit arrived, so on the
device that created a convenient room or a direct message nobody was an
admin until somebody else committed. MarmotInboundManager.reconcileAdmins
brings the flags into line with the group's admin set without a caption.
It runs where every Marmot room is made -- replacing stampAdmins, which
only the keyed rooms had -- and when a room's detail screen opens, which
catches up rooms made before this build.
processGroupMembershipChanges shares the same flag rule, adminFlagChanges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leaveGroup called the repository inside viewModelScope.launch and caught
nothing, so "An admin cannot leave; hand over admin first" escaped the
coroutine: never shown, and on Android a crash. It now goes to an onFailed
callback the screen reports through the notifier, as disbandGroup does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GroupKeyStateManager.vouchesFor refused every key state naming a share
generation (fc437d05), so each recipient was asked to sign the new
generation before anyone's old share was deleted. vouchesForGeneration
now accepts the one state a rotation this device completed implies: the
generation it signs with and holds a share of, the rotation named and
complete here, its own table's hash, the ids its roster retires, a
session at that generation, and the path and parent of the room's
signed state. Rule 7 becomes 'nothing signed at h or later'. A state
that binds an id to a new identity is still never vouched for.
Vouching was decided once, on the proposal's arrival, and the
coordinator proposes the moment its own certificate verifies -- often
before a recipient's. resumeAt, which the rotation already calls on
activation, now asks again; resumeVouched does the same from the sync
sweep for a state an older build left asking.
Tests: one approval each and the group signs generation 1 and wipes the
old shares; a state heard before the certificate is vouched for once it
arrives; each rule broken on its own leaves the state asked; a withheld
member does not vouch; the sweep answers a state left asking, once. The
cutover test holds the proposal to keep checking that nothing is wiped
before the signature. jvmTest 1245/1245.
One earlier full run died on a SIGSEGV in SQLite's native code, in a
background key-package write unrelated to this change; the rerun was
clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Participant.adminAt had three writers and the Welcome was not one of
them: a joiner's rows came from Participant.fromMlsGroup with no flag, so
on every device but the creator's a robust group's admin room showed no
admins until some later commit happened to arrive.
AdminFlags.reconcile is now the one writer. It reads the room's rows
fresh and flags them from the group's own admin policy, both ways, and
writes nothing about membership. The Welcome path calls it after the
participant upsert; MarmotGroupCreation calls it in place of
stampAdmins, off the group it just made rather than its own list; and
processGroupMembershipChanges calls it in place of its three inline
computations.
Phase 0's ignored test passes. MarmotGroupCreationJvmTest: flags follow
the policy both ways, and a second pass changes nothing.
jvmTest 1237/1237, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ChatRepository.createMarmotGroup now takes the ceremony and the room it
ran in instead of a list of admins, and MarmotGroupCreation.createFor
derives the room's id, name, description and admins from it. The two
callers -- CeremonyFollowThrough's step 3 and the ritual screen's button
-- stop computing a set of their own. A room's epoch-0 admin list is
fixed for good at an address the key derives, so the one place the
founding set is read is now the one place a room is made.
A device that was not in the ceremony is refused rather than listed as
the room's creator.
MarmotGroupCreationJvmTest: the coordinator's device and a member's make
a room with the same admins, the ceremony's participants; an outsider
makes none. jvmTest 1236/1236 (1 skipped, Phase 2's),
compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proposer was asked like anyone because the button committed them to
a withheld list they were never shown. Now Rotate shares opens a dialog
naming who takes part and who is left out -- the stale members proposing
withholds again automatically included -- and why it would be refused,
before anything is sent. Pressing it is the proposer's agreement: the
session is created with dealApprovedAt set, and the proposer deals at
once.
ShareRefreshManager.plan is the one recipient/withheld split behind both
proposeRefresh and the new preview, so the dialog shows what the
proposal will say. The removal dialog names the stale members too.
Tests: the proposer's half of 'nothing goes out before they approve'
flips; the preview equals the proposal with nobody stale and with one;
a removal's preview names the removed for good and the stale until they
are back; a refused preview says why and sends nothing. jvmTest
1241/1241, m3Audit, brand and wallet audits.
Not seen on a device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RobustGroupAdminsJvmTest states the promise and shows where it breaks.
Three app phones: one creates the admin room through MarmotGroupCreation
with all three as admins, the others join by a real Welcome, gift wrapped
and stored through the sync funnel.
On every device the admin policy names the founders and isLocalAdmin is
true, on both profiles. The rows do not: a joiner's Welcome writes no
adminAt, so its own rows flag nobody -- ignored until Phase 2. A member
invited later is not an admin. The ceremony half checks that every device
that took part agrees on the founding set, for a group and a subgroup.
The later-member case runs on the legacy profile only: on the current
profile MarmotGroupCreation invites the founders through a room read
before its routing id is recorded, so a later invite skips its commit.
Phase 4 fixes that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShareRefreshManager.resumeRunning advances every rotation this user is in
that has not finished, through a new ShareRefreshDao.getRunningSessionsFor.
resumeRunningCeremonies runs it after the ceremony sweep, under the same
lock as the inbound path, once the live subscription is open. Behind the
rotation flag.
Without it, Phase 2 strands a rotation an older build paused at 'store
your new share': the sum is on file and nothing more will arrive.
Tests: that upgrade case resumes from the sweep alone and completes, and
two more sweeps send nothing; a member who has not taken part is looked
at and sends nothing, asked once; a build without rotation resumes
nothing. ShareRefreshRitualJvmTest 26/26.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShareRefreshManager.advance no longer stops before round 2 for its owner.
The gate's two reasons never needed a person: participantStep2 is the
check that stops a substituted table, and it fails the rotation out loud
before any prompt could appear; ShareRefreshConfirmation is the one
confirmation per generation, claimed with the pending share in one
transaction. pendingApproval now only answers DEAL.
No migration: confirmApprovedAt and ShareRefreshApprovalStep.CONFIRM stay
so rows written before still decode, documented as read by nothing.
Tests: the pinned gate flips (taking part alone completes the rotation,
asked once); the last to take part deals and confirms with nothing more
asked; a tampered sum fails the rotation on every device with nobody
asked; two rotations opened at once never split the group.
ShareRefreshRitualJvmTest 23/23.
Must ship with Phase 3: a rotation paused at the old second approval has
nothing left to arrive and needs the sweep to move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three tests pin where a rotation stops for its owners, so the phases that
remove those stops flip an assertion rather than pass by accident:
taking part alone leaves every recipient asked to store the new share;
a recipient is asked to take part, to store, and to sign the new key
state (the proposer the first two); and a completed rotation keeps the
old shares until the owners sign. answerEverything records each ask.
ShareRefreshRitualJvmTest 20/20.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tapping Rotate shares put "Take part in rotating the shares" in front of
the person who had just tapped it, and "Store your new share" after.
The button now asks first, in a dialog naming every member the rotation
leaves out -- the stale, withheld again -- and proposeRefresh approves
the proposer at both gates. DEAL is the decision about who is withheld,
which the dialog just took; CONFIRM guards against a coordinator
substituting a table, and the proposer is the coordinator. Every other
recipient is asked as before.
A test now shows two proposals crossing on the wire end with neither
running and every device on one table.
ShareRefreshRitualJvmTest 25/25, ChatRoomDetailSharesJvmTest 3/3,
m3Audit, compileDebugKotlinAndroid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The room detail screen read the shares summary once, and again only
after one of its own actions, so a key state signed in the background
left Rotate shares disabled until the screen was reopened.
ChatRepository.observeSharesInputs emits when the room's key state,
signing sessions or refreshes change; the view model reads the section
again once they settle, and nothing else on the screen.
ChatRoomDetailSharesJvmTest 2/2, m3Audit, compileDebugKotlinAndroid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SharesSummary.canRotate becomes Rotation: Unavailable, Available, or
Held with a reason -- a rotation in progress, the group's signature on
the new shares still owed, or this device behind. The button stays,
disabled, with the reason beneath it.
While the key state is owed and nobody here is asking for it, the
section offers to ask the group to sign it
(ShareRefreshManager.proposeOwedKeyState), so a coordinator who is gone
does not hold every later rotation; while somebody is asking, it links
to the proposal. The offer to rotate without a removed member is made
only when a rotation could start now, and says so otherwise.
The section's actions run one at a time, through isActionPending.
ShareRefreshRitualJvmTest 24/24, m3Audit, compileDebugKotlinAndroid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rotation is over when the group has signed the key state at the new
generation, not when its refresh completes. ShareRefreshManager.rotationHold
says why this device must not propose one now: a refresh still running,
a key state the group has not signed (or a key-state proposal still open
here, unless this device declined it), or a device behind the group.
proposeRefresh, and so proposeWithout, refuses on it.
The recovery walk test ran three rotations back to back with nothing
signed between; it signs each key state now. ShareRefreshRitualJvmTest
22/22.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The automatic ceremony lets a device sign, without asking its owner, the
one key state that can be true for a ceremony it finished
(GroupKeyStateManager.vouchesFor). Its seventh condition -- no state for
the room already signed here -- was what kept a share rotation's key
state out, and only in rooms that already had one. An eighth makes it
explicit: a state naming a share generation or a member binding says
more than the ceremony did, and its owner is asked.
Found by ShareRefreshRitualJvmTest after the merge: its devices hold no
first state, and the generation-1 state signed itself. jvmTest
1229/1229, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShareGenerations.recover rebuilds a device's share of every generation
from its host secret key alone: ChillDKG's recovery data gives generation
0, and each refresh's recovery data, applied to the generation before,
gives the next. It stops at a generation the host key was withheld from,
since a repaired share leaves no recovery data. Nothing calls it yet.
Tested three refreshes on, against every device's live share and each
generation's table. With the release-build test, jvmTest 1200/1200,
compileDebugKotlinAndroid and the audits pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The room detail screen shows a key share by share: the generation the
group signs with, who holds a share, who waits to be brought back and who
was removed for good; what this device is being asked (take part in a
rotation, store the new share, help bring a member back), with approve
and abandon; and the two things it may start -- rotate the shares, or ask
to be brought back. The copy says what a rotation does not do.
ExperimentalFeatures.shareRefresh gates all of it (D4): on in debug and
development builds, off in release until the zkp modules are reviewed.
Off, nothing is offered, and a rotation this device is asked into is
declined out loud. The desktop build can opt in with
-Dgiza.experimental=true. The iOS actual was not built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShareRepairManager brings back a participant id a refresh left stale, with
FrostReducedEnrollment in repair mode, on kinds 30346-30349. t live helpers
approve and run it; their round-1.1 shares and round-1.2 sums are raw
additive shares, so each goes NIP-44-encrypted between the two parties'
ChillDKG host keys. The target checks the result against the public share
the group signed -- never one the helpers supply -- stores it, and proves
it with a Schnorr signature by the share, which every device checks before
marking the id live. The share is a point of the new polynomial that the
old device never had.
10b: a new identity at an id -- a lost device, a compromised account -- is
bound by a group-signed key state first (frost_member, GroupKeyState
.memberBindings, schema 40), applied only to an id that is not live. Until
then its request waits, with nothing sent. A key state amending one at the
same generation is stamped a second later, so a binding can never tie with
the state it adds to.
jvmTest 1198/1198, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A removal takes a member out of the room, not out of the key: their share
still helps sign. After an admin removes a member who holds a live share,
the room screen offers to rotate without them -- a second act, never
folded into the removal, since it needs every remaining holder.
ShareRefreshManager.proposeWithout withholds them for good (RETIRED); the
refusals say when that would leave fewer than t holders (the group could
not sign at all) or not a majority (remove fewer at a time).
Tested in the ritual harness: in a 2-of-3, the other two sign at
generation 1 and the removed member's old share signs nothing with a new
one. jvmTest 1195/1195, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a refresh completes the coordinator asks the group to sign the key
state at the new generation -- the same room, key, path and parentage, plus
frost_generation, a hash of the public-share table, the refresh and any
retired ids. It is the new shares' first signature, and what D6 waits on:
a device that files that state, holds the generation active and agrees
with the group's table fails every signing session left at an older
generation, out loud, and deletes the older shares, the ceremony's
randomness that rebuilds generation 0's, and the WAL's page images of them.
A key state at a higher generation wins whatever its timestamp, in the
DAO and among signed events. A proposal at a generation this device has
confirmed and is still waiting on the certificate for waits instead of
declining, and resumes when the generation activates.
jvmTest 1193/1193, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a ceremony a device finished there is one true statement of what
its room signs with: its key, at the admin path, naming the room that
derives, with the parent's certificate for a subgroup. A signing
proposal that is exactly that statement is approved on arrival.
GroupKeyStateManager.vouchesFor checks it with the rules stateFrom
applies to a signed state, minus the signature; anything else, a key
state included, is asked about as before.
SignedGroupKeyStateTest's two approval-gate tests now assert the new
rule. CeremonyNetwork relays signing messages, so a ceremony runs from
the joins to a signed key state with nobody asked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ShareRefreshManager runs a FROST share refresh in the Marmot room the key
derives, on kinds 30340-30345, in the image of ChillDkgRitualManager:
every inbound message stored, every step recomputed from stored inputs,
nothing of a member's own published before they approve, at two gates
(DEAL, CONFIRM). Recipients are at least t and a majority of the ids not
retired, and a device confirms one refresh per base generation --
ShareRefreshConfirmation, written in the same transaction as the pending
generation it confirms -- so two refreshes from one generation cannot both
complete. The certificate activates the new generation; a withheld device
learns its table from the recovery data and files it with no share.
Schema 39 (AutoMigration): ShareRefreshSession, ShareRefreshMessage,
ShareRefreshConfirmation. Transcript lines as system lines; dispatch in
the Marmot inbound path.
ShareRefreshRitualJvmTest: three devices with real host keys refresh
through bitcoin-kmp's FrostRefresh and then sign at generation 1 as the
same room. jvmTest 1190/1190, compileDebugKotlinAndroid, audits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CeremonyFollowThrough asks a subgroup's parent to certify it, asks the
group to sign the key state, and creates the room, from stored rows and
one step at a time. It runs beside the live subscription, outside the
inbound lock, since creating a room waits on key packages the inbound
path delivers. It looks again when a ceremony finishes, a certificate
or key state is signed, or a key package arrives.
Only the coordinator's device acts on its own, and never again after a
signing session failed; the ladder keeps the buttons for both. Once the
room exists the ladder's last rung opens it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Once everyone has joined nothing is asked, so a ceremony that sits still
is waiting on a device that is not answering. After a day without a new
message, the ritual screen names who it is waiting on and since when,
with the abandon action beside it. Nothing abandons on its own.
A ceremony message is now stored once, on first arrival, so its time is
when it first came and a relay's redelivery does not restart the clock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The join screen carries what the round-one screen showed, the members
in particular, and says the device takes it from there. The round-one
and round-two screens, their routes and their strings are gone; the
ritual screen offers only the join, and the ladder describes each round
as something the device does.
Old request lines still read as answered: the automatic round writes
the same line a tapped one did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ritual moved on an arriving message or a member's tap. Without the
tap, a ceremony holding every message it needs -- one an older build
left waiting to be told to contribute, or one interrupted between
storing a message and acting on it -- would never move.
resumeRunning advances every ceremony this user has joined. Sync runs
it once per activation, after reopening the inbox.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
advance no longer stops at rounds 1 and 2. Contributing follows from
having joined, and confirming is ChillDKG's own check, which refuses a
substituted result whether or not anybody is looking. pendingApproval
returns the join or nothing, and approving a round is a no-op.
ROUND_1 and ROUND_2 stay in the enum, and their timestamps in the
schema, so rows written by older builds keep decoding.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schema 38 (AutoMigration): KeyShareGeneration and KeyShareMember for every
generation a refresh makes, FrostSigningSession.generation, and
GroupKeyState.generation and publicSharesHash. Generation 0 has no row: it
stays where ChillDKG wrote it, with ids derived from the host keys as
before.
ShareGenerations is the one door signing reads a share through.
FrostSigningManager fixes a session to the generation the group signs with
when it is proposed, carries it as frost_generation from generation 1 (a
generation-0 proposal is byte for byte what it was), and a device holding
no share of the named generation declines out loud with
GENERATION_REFUSAL instead of waiting or signing with the wrong share.
ShareGenerationsJvmTest refreshes a 2-of-3 group's shares by hand with a
zero-constant polynomial; the new shares sign and the signature verifies
as the unchanged room. jvmTest 1183/1183, compileDebugKotlinAndroid, and
the M3, brand and wallet audits pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CeremonyNetwork gives each member a database of their own and relays
what each queues to the others, stored first the way the inbound path
stores it. No test ran the rounds before: the others stop at the host
key or take a dealer's key.
Pins today's gates: members who have only joined stop at round 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every connection opens with PRAGMA secure_delete = ON (SecureDeleteDriver),
and GizaDatabase.scrubFreedPages truncates the write-ahead log, which keeps
whole page images of a share after its row is gone. Android backups and
device-to-device transfers carry none of the app's data: aux.db holds FROST
shares in plaintext, and a share copied somewhere the app cannot reach
cannot be rotated away from.
SecureDeleteJvmTest reads the database's files byte by byte; its two
controls find the share with secure_delete off and before the scrub.
jvmTest 1176/1176.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>