ChatRoomDetailScreen gets a Members' guarded wallets section of its own
under Subgroups: a row is a person, @name and the wallet's label, and
it opens their profile rather than a room. A request no signer has put
to the group yet says so, and a share-holder can put it to the group
from the row; a member who could ask has the way in beneath.
ProfilePreviewScreen lists the person's wallets the groups this profile
is in guard, one row per guarding group, with Spend where this device
holds a share -- the guardian spend the wallet screen already makes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A guarded wallet's subject is now a subgroup or a member.
GuardianManager.verify takes a member wallet certificate beside a
subgroup's statement, checks it on its own and walks the ancestor's
guardian root down a line of descent that ends in the wallet's id. The
group that signed a certificate lists it from its own signed events;
the groups above learn of it from a 30333 notice, and a member in both
rooms can carry it upward from the wallet screen as before.
The guardian spend is unchanged: the guarded tag carries W, the builder,
the check and the signing cache take any id. The wallet screen names a
subgroup's wallet #name and a member's @name -- the live profile name,
since the certificate fixes who the member is, not what they are called.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWalletManager.signSpend checks a spend the way a group member
checks a group's -- GroupSpend.check against the account the wallet
rederives to -- signs every input on the key path with the member's
key, asserts correctlySpends, and files it as a MemberWalletSpend.
While member wallets are shut on mainnet a member's own spend there is
held to the same cap as every group spend.
MemberSendScreen is the group's SpendForm with a button that signs and
sends; the line above it says there is no quorum after this. There is
no session for GroupTransactionWatcher to follow, so the wallet screen
follows the member's spends while it is open, sending again any
Electrum has not heard of, and lists them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GroupSendScreen's fields and preview move, unchanged, into SpendForm,
which emits into the caller's column so the group's form lays out as it
did. The button stays the caller's: a group asks its quorum, a member
will sign alone. An ownWallet flag changes the words -- "your coins",
"this wallet" -- and nothing else, so the two forms cannot drift.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The profile lists every guarded wallet of its own this device knows
about, named for the group that guards it: the ones whose key is here,
and the ones a group this device is in has certified for this npub,
which includes wallets made on another device and shown watch-only.
Each row says where the asking has got to -- asked, signing, not
signed, open -- or the balance.
MemberWalletScreen offers addresses only once a group has certified
the wallet. Before then the member can ask again or discard the key,
which is safe exactly then; after, it shows the balance, the address,
the coins and every coin a guardian took, read off the chain. Export
key, behind a confirmation, shows both descriptors with the private
key in them.
wipeData has no callers and deletes nothing yet, so there is no wipe to
guard; a note on it says what a caller must do once it does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWalletManager.request makes a random key, works out the group's
leaf and every inherited one, builds both descriptors, stores the key,
and only then puts the signed request into the group's room. It checks
the request the way every signer will before it goes, and a member who
holds a share of the group's key puts it to the group in the same step.
NewMemberWalletScreen is a consent screen first: who can take the
member's coins and after how long, who will see them, and that the
group is the recovery path -- then an optional label and one button.
Every refusal is named, and a member who does not know the group's key
can ask for it from there. Its entrances arrive with the profile's
guarded wallets (Phase 8) and the group's page (Phase 11).
GroupWalletRollout.MEMBER_WALLETS_ON_MAINNET is shut: the entrances are
offered on test networks only, since the member's own spend is the
first single-signer path the app has.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acceptProposal refuses a 30334 before it is shown unless it is exactly
the certificate the request it carries asks for, the person asking is a
member of the room, and its guardians are the ones this group grants --
SubgroupManager.grantFor with the wallet id in a child room's place.
MemberWalletManager.putToGroup is how a signer sponsors a request: one
session over the certificate the request determines, or the session
another sponsor already opened over the same event id. The signers read
the proposal as whose wallet and what the group can take from it, and
the transcript gets a line for the request and for the certificate
rather than raw JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWallet holds the random key of a guarded wallet one member holds
and a group guards, with the request that asked for it; MemberWalletSpend
the transactions the member signed alone. Whether a wallet is certified
is read off the group's signed events each time, so there is no column
for it. Neither table has a foreign key: deleting a group's room on this
device must never delete a key that coins may sit behind.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWalletCertificateEvent (30334) is the group's signature over a
member's request, which it embeds whole so an ancestor never in the room
can check that the member asked. template(request) is the only way one
is built and verify() checks a certificate is exactly that template, so
a sponsor chooses nothing and two sponsors propose one event id.
Its own kind rather than a 30329: every reader of birth certificates
assumes a room, and a test fails the day subgroupsOf reads both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWalletRequestEvent (30335) is the first thing that leaves the
member's device: the wallet key, its id, every guardian leaf and both
descriptors, signed by the member's nostr key and -- over a tagged
possession message -- by the wallet key itself. verified() checks all
of it that can be checked without the group's key, down to the
descriptors byte for byte.
An inner event is an unsigned rumor, so the room carries the signed
request whole as an inner event's content, as a 30333 notice carries a
statement; carried() takes it out only from the member who signed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member welcomed after a group's founding holds no key state, so cannot
work out the leaves a guarded wallet of theirs would carry. They ask with
a 30336 GroupKeyNoticeEvent; any member holding the verified key state
answers with the threshold key, its path and the group's certificate.
The answer is believed only for what checks itself -- the key rederives
the room, the certificate certifies it and names that key -- and is read
where it is used, never filed as key state. It carries the key rather
than the signed key state because the key state's row keeps what it said
and not the event.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemberWalletDerivation holds the private side of a guarded wallet whose
key path is one member's random key: the wallet id W, the account step
added to the scalar, CKDpriv to each address, and a key-path signature
under the address's script-path tweak. The public side is the group
wallet's derivation unchanged; GroupWalletDerivation.accountStep is split
out so both add the same tweak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SubgroupManager.Subgroup.walletPolicy reads it off the certificate, and
each row of a parent's subgroup list says guarded or unguarded wallet
under its supporting line. A subgroup's own parent row says the same,
off ChatRoomDetailUIState.walletPolicy. Founding history, shown as such;
an undecided certificate says nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signing: FrostSigningManager refuses a wallet statement proposal whose
guardedness the room's own certificate does not allow, before it is
shown, reading the policy off this device's key state.
Reading: GroupWallet.newestAmong takes the policy and drops a statement
it does not allow before rule 1 -- under a guarded policy a plain
statement is no wallet even alone, so an older client's plain wallet has
no addresses derived, no coins watched and no spends signed. walletFor
passes GroupWalletManager.walletPolicyFor. An undecided room reads
exactly as before. GuardianManager.verify refuses a forwarded statement
whose certificate's policy contradicts its keys or decided unguarded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GroupWalletViewModel reads the room's own wallet policy through
ChatRepository.walletPolicyOf: a parent that decided guarded leaves the
guarded wallet alone, one that decided unguarded the plain one alone, and
an undecided subgroup or a root group keep what they had. openWallet will
not build a plain statement under a guarded policy, and OpenWalletAction
shows one button with a line saying the decision was the parent's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SubgroupManager.refuseKeyState: a child signer refuses a key state whose
birth certificate decides a wallet policy other than the one its own
ceremony announced at the join gate -- undecided included. A ceremony
from an older build announced none and holds the certificate to nothing.
proposeSubgroupKeyState refuses the same thing before asking.
GroupKeyStateManager.parentageOf drops a state whose certificate's policy
does not read or contradicts its guardian keys, so a corrupt policy never
reads as undecided.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
proposeBirthCertificate reads the policy off the child's ceremony: guarded
carries the grant and `guarded`, unguarded carries no keys and
`unguarded`, and an older ceremony with none is certified as it always
was -- or as guarded under a guarded parent. An unguarded ceremony under
a guarded parent is refused with the remedy, start again.
refuseGrant becomes refuseCertificate. Every parent signer refuses a
certificate whose policy does not read or contradicts its keys, and a
guarded group's signers refuse anything but a guarded one, undecided
included -- D4, read off the signer's own key state. ProposedEvent says the
decision in both directions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SelectSubgroupAdminsScreen gains a wallet section under the quorum
stepper: guarded (the default) or unguarded, carried to proposeRitual.
Under a guarded parent the unguarded row is shown disabled with its
reason, setWalletPolicy will not move off guarded, a retry is pulled back
to guarded, and refusal() refuses it -- D4. A parent whose guardian keys
do not read cannot make a guarded subgroup, which is now refused before a
ceremony rather than after.
SubgroupManager.walletPolicyOf is the one reader of a group's own policy,
reached through ChatRepository with guardiansOf. DkgJoinApprovalScreen
tells an admin what the subgroup's wallet will be before they join.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
proposeRitual takes a walletPolicy and puts it on the proposal as a
["wallet", ...] tag, beside the parent and subject; acceptProposal files it
on DkgSession.walletPolicy. A proposal whose policy does not read, or that
carries one with no parent, is dropped, and proposeRitual refuses a policy
on a ceremony with no parent before anything else.
Schema 28 -> 29: the nullable DkgSession.walletPolicy, an auto-migration
like the other nullable additions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SubgroupWalletPolicy and WalletPolicyTag, ["wallet", "guarded"|"unguarded"],
and SubgroupBirthCertificateEvent.parseWalletPolicy. A certificate with no
tag reads Undecided; one whose tag does not read, or contradicts the
guardian keys beside it, reads null rather than undecided. certifies is
unchanged. Nothing writes the tag yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sharing a guarded statement wrote one notice per guardian room, each hashed
from the same sharer, second, kind, tags and content -- so every notice had
the same id, and the last room's upsert took the row. A grandchild told its
parent and grandparent at once reached only the grandparent.
Each notice now names its room in an `h` tag, which gives it an id of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The onchain-wallet naming change gives the row its room's name, so the row
test written for the removal of the nostr profile, relays and posts looks
for "Translation room onchain wallet" rather than "Group onchain wallet".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wallet screen's title and the row on the group's detail screen read
"<group name> onchain wallet" instead of "Group onchain wallet". A room
with no subject, and the wallet screen before its room has loaded, keep
the generic name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FrostSigningEvents.DECLINE and MarmotDirectMessage.ENVELOPE_KIND are both
30330. Recognising protocol kinds first (ceremony-creation Phase 6) returned
before the direct-message branch, so every direct message in a
current-profile room was dropped unopened. A 30330 that holds a gift wrap is
an envelope; only one that does not is a decline.
ProtocolKindDispatchJvmTest now opens an envelope through
fromGroupEventResult, which no test did before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GroupWalletRollout.GUARDIANS_ON_MAINNET is on, lifted by decision ahead of
the signet run its condition named. The mixed-version risk stays open and
is said so in the gate and the guardians note; guardian spends on mainnet
are held to MAINNET_CAP like every other spend.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A subgroup's ceremony runs in its parent's room, so that room holds a
certificate and a key-state signing session for every subgroup made under
it. The ceremony screen took the newest of each kind regardless of which
subgroup it was for, so a parent's second subgroup opened on the first
one's finished certificate, with "Ask the parent group to certify"
already disabled.
Each session is now matched on what its event names: the certificate on
the subgroup's threshold key, the key state on the ceremony. The newest
match still wins, so a failed request can be asked for again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The group's detail screen loses its "Nostr profile", "Relays" and "Posts"
rows, and the six screens behind them go with them: the profile, its
editor, the relay lists, their editor, the posts and the composer. So do
the readers they stood on (GroupNostrProfile, GroupRelayList, GroupPost),
their ChatRepository methods, and 97 strings.
Two things go that were not named, because nothing else reaches them.
BroadcastGroupSignedEventScreen was only opened from those three screens,
so the app no longer sends a group-signed event to a relay, and
EventPublishTransport goes with it. "Propose event" accepted only a
profile, a post or a relay list, so it would refuse every paste;
ProposeGroupEventScreen and GroupEventProposal are removed, and with them
the detail screen's canEditNostrProfile gate. What is left of that block
is the wallet row, shown in Marmot rooms only.
The transcript keeps what it already holds. The three message types stay
as private legacy names in GROUP_IDENTITY_TYPES, as the curated-lists
types did, so rows already written stay system lines. A profile or relay
list arriving in a room now applies to nothing, so a signing session an
older build opened for one ends without a raw-JSON bubble. A kind:1 falls
through to "unsupported", which is what it was before posts existed.
ProposedEvent no longer describes the three kinds.
GroupSignedWorkRowsJvmTest now covers the wallet row and the absence of
the removed rows. The chronicle tests still use a profile, a relay list
and a post as their kinds; they compare GroupSignedEvent rows, which are
unchanged, so only ChronicleTestKinds' account of why is corrected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found on the emulators: refusing a Marmot room left the app bar reading
"Shared key for " and nothing. It reads "Shared key" until the room is
loaded. The plan now records what was checked on the three emulators that
found the bug, and what was not.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schema 26 -> 27. MIGRATION_26_27 deletes the chat lines the removed document
arms wrote and the unsupported bubbles a subgroup's ceremony left in its
parent's chat -- found by the kind of the inner event behind them, so an
unknown payload's bubble stays -- then drops the twelve document tables,
children before parents, and MarmotInnerEvent.payloadEventId. Manual,
because it deletes rows. GroupSignedEvent keeps whatever the group signed,
and the chronicle keeps its column and its lines.
The nip30303 events and tags, the Mantra entities and DAOs, the repository
interface and the Markdown helper go with the tables, and so do the tests
that only exercised them. The key-state test signs posts where it signed
dialects. The migration test builds v26 from the exported schema and checks
the result against v27's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The inbound path no longer opens document submissions or applies document
kinds, and ProposedEvent no longer describes them. Nothing could send one:
the screens that did were removed in part 1.
The member chronicle carried nothing but document kinds. It is kept, and
what it may carry is now a ChronicleKinds value -- empty in the app, so a
device asks for no chronicle, sends none, and applies nothing from a page an
older build sends. The row-rebuild fallback and translation supersession go
with the documents. The chronicle's tests exercise the machinery with a kind
set of their own; the round trip through document rows is deleted with the
rows, as are the document-only apply test and the tests of translation
supersession.
Tests that used a dialect as an arbitrary signed payload now use a post.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing navigated to the artifact, chapter, dialect or translation screens:
ArtifactDetailRoute, AddArtifactRoute and AddDialectRoute were never built,
and the other six were only reached from inside those screens. Removed with
their view models, UI states, routes, nav host entries, the repository behind
them, TranslationScaffold, DetailRow, and the 65 strings only they used. The
group details screen loses the document repository it stored and never read.
The string catalogue test now checks its escapes on a string that stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A subgroup's ceremony runs in its parent's Marmot room, where its kinds
30310-30312 are also nip30303 document kinds. Round 1 (30312) was read as a
document submission first, failed to parse, and reached every other admin's
chat as an unsupported bubble of raw hex; the proposal and host keys reached
the translation arms before the ceremony's own. fromGroupEventResult now
stores a protocol message and returns before any document handling, and
applyInnerEvent checks the protocol arms first.
The comments that called the overlap safe are corrected, and the
"No app logic to handle" line every application message logged at info is
now a debug line that does not read like a failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was no way to end a ceremony: ChillDKG has no "no" short of it, and
the approval screens pointed at an abandon action on the ritual screen that
did not exist. ChillDkgRitualManager.abandon now ends a running ceremony this
device is in, filing and broadcasting the same FAILURE a fault sends, and the
ceremony screen offers it behind a confirmation.
record() now ignores a FAILURE from anyone outside the ceremony. In a
parent's room every member can read a subgroup's proposal, so any of them
could otherwise end it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DkgRitualRoute and the three approval routes now require the ceremony's id,
and the screen loses its start button, its quorum stepper and its fallback to
the room's newest ceremony. A transcript line naming no ceremony opens
nothing. The title is the ceremony's name rather than the room's, so a
subgroup's ceremony is not called after its parent.
Try again on a failed ceremony goes back to the screen that starts that kind:
the creation screen for a group's own key, or the subgroup picker filled in
from the ceremony that failed. Retrying a failed subgroup used to open a
whole-room ceremony in the parent's room.
A test counts the screens that open a ceremony, so a fourth is a decision.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CreateSharedKeyScreen takes the quorum and a single button, and nothing
else. It refuses a Marmot room and a group of one with a reason, hands over
to a ceremony the group already has rather than offering a second, and
replaces itself with the ceremony once it is opened so back never returns to
an offer. The group details' Shared key button and the card shown when a
robust group was created without its ceremony both lead here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three ways the shared-key screen could lose the ceremony it was showing, and
so offer to start one:
- initiate() ran again whenever the screen came back into view, resetting
the state to no ceremony and stacking another set of watchers. It now runs
once per view model.
- five coroutines each read the state, changed one field and wrote it back,
one of them across a suspending query, so an old copy could overwrite a
newer one. The state is now built by one flow and written in one place.
- an approval closed its screen as the button was pressed, cancelling the
view model's scope and with it a publish still in flight. The screen now
closes once the approval has gone out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
proposeRitual now refuses a ceremony with no parent in a Marmot room, and
acceptProposal drops one arriving there. A Marmot room's id is derived from
the key it already has, so a key of its own is one it could never use -- and
the shared-key screen offering to start one in a parent's room is how a
second, whole-room ceremony opened beside a subgroup's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A guarded wallet's coins have a spender outside the room: a guardian can
take a coin the child's open spend wants, and the child can move one a
guardian's wants. Neither winner is a row in the loser's room, so the loser
sat signed and rebroadcast forever. The watcher now asks the chain, for a
signed spend Electrum has not heard of, which transaction took each coin;
once that one confirms, recordReplaced marks the spend replaced and settles
every other spend of the coin, as recordConfirmed does for the room's own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whenever a guarded wallet's coins change, the wallet screen reads every used
address's history off Electrum, recognises a guardian's leaf in the witness
that spent a coin, and writes one transcript line per transaction saying
which group above took how much -- the child's only notice, since nobody in
its room signed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GroupSpend checks a spend as a guardian would sign it: every input under
the descendant's account, locked by the leaf's 12 blocks, signed over the
script-path sighash as the key the ancestor's walk reaches, and witnessed
with the leaf and its control block. The builder waits out the lock and
weighs the leaf; the signing manager proposes, accepts, signs and completes
it, and every signer reads the descendant's wallet from its own copy of the
statement. A guarded wallet row on the ancestor's wallet screen opens the
send form for it. Schema v27 adds GroupTransaction.guardedChatRoomId.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bitcoin-kmp reads a taproot derivation's fingerprint back from a serialised
PSBT as a signed int, so for any account whose fingerprint has its top bit
set -- half of them -- every member but the proposer refused every spend as
not the wallet's own. Compare the fingerprint as an unsigned 32-bit value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member in both rooms carries a descendant's signed guarded statement into
an ancestor's MLS room as a 30333 notice, and can pass one on a generation
further. Every ancestor device believes it only when its own guardian root
reaches the key the statement names for it. The wallet screen lists the
guarded wallets below the group with what is within its reach, and the
statements this device can still carry up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A room whose certificate grants guardian keys is offered a guarded wallet,
with a plain one beside it, on test networks; mainnet waits behind
GroupWalletRollout.GUARDIANS_ON_MAINNET. A spend's account is the one the
statement opened, so its own spends sign the guarded addresses' key path,
and wallets are watched per descriptor rather than per xpub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An account knows its guardians and puts a leaf per guardian in every
address, internal key unchanged. The statement names them and carries the
certificate that granted them, and verifies only when the certificate
certifies this room and grants exactly those keys. A guarded statement
outranks a plain one for its account, and its first guardians stand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parent grants the child its own guardian key and every key its own
certificate carries, one step further each, as guardian tags. Every parent
signer recomputes the grant and drops a certificate proposal carrying any
other keys before it is shown; one carrying none still signs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>