Commit Graph
826 Commits
Author SHA1 Message Date
Kgothatso NgakoandClaude Opus 5.5 0e3110bff7 feat(wallet): a group opens, sets and closes its members' wallets (Phase 6)
The group's page shows, first in Members' guarded wallets, where the group
stands -- guarding them after a delay, never having said so, or having
stopped -- to everybody in a Marmot group, with Change or Guard members'
wallets for a device that can sign. It opens MemberWalletPolicyScreen:
the delay chooser, what a change reaches (only wallets asked for from now
on), the older-app caveat, Ask the group, and for an open group Stop
guarding new wallets behind a dialog saying closing releases nothing.
Each proposes a 30337 through the existing signing session.

GuardianDelayChooser and its state, GuardianDelayInput, move out of the
subgroup picker so both screens share them; the picker's behaviour is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:49:56 +02:00
Kgothatso NgakoandClaude Opus 5.5 b57979f577 feat(wallet): every signer judges a member's request by the group's policy (Phase 5)
MemberWalletManager.judgePolicy is D6 of docs/member-wallet-delay.md: a
request carrying an open policy its group signed is judged at that delay
unless this device holds a newer one -- then it is stale, asked under a
changed delay or of a group that has since closed. A request carrying no
policy, a closed one or another group's is refused. refuseCertificate
checks the grant at the judged delay, and putToGroup runs the same check
before it proposes.

The member sees it: a wallet not yet guarded carries refusedBecause, the
wallet screen says why, and Ask again makes a new request under the
group's newest policy with a new key -- the old one, never offered, is
discarded -- or, for a closed group, leaves only Discard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:42:25 +02:00
Kgothatso NgakoandClaude Opus 5.5 a1b74ae818 feat(wallet): a member asks only an open group, and builds under its policy (Phase 4)
MemberWalletManager.refusal gains NOT_OFFERED -- the group has signed no
policy -- and CLOSED, after the refusals it had; a member with no key yet
still gets KEY_UNKNOWN and its button to ask, since the answer brings the
policy too. request() works out the grant at the open policy's delay and
the request carries that policy whole as ["member_wallet_policy", ...];
delaysOf reads it, and is null for a group that is not open.

MemberWalletRequestEvent.verified gains a sixth check: a carried policy is
an open one the asked group signed, and the nearest guardian's delay is
its delay. A request carrying none still reads, so certificates signed
before policies keep verifying; that a new request must carry one is the
signers' rule, which comes next.

The member-wallet test fixtures open their groups at the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:35:44 +02:00
Kgothatso NgakoandClaude Opus 5.5 b9c69589c3 feat(wallet): a key answer carries the group's member-wallet policy to a late member (Phase 3)
A member welcomed after the group signed its policy cannot decrypt it, so
the key notice that already tells them what the group signs with now
carries the newest 30337 the answering device holds, open or closed, as
["member_wallet_policy", <event>]. GroupKeyNoticeEvent.read verifies it as
the room's own signature, and an answer carrying one that does not verify
does not read at all. MemberWalletManager.policyFor considers carried
policies beside stored ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:32:54 +02:00
Kgothatso NgakoandClaude Opus 5.5 9b724cfb87 feat(wallet): a group's devices read its member-wallet policy, and the transcript says it (Phase 2)
MemberWalletManager.policyFor: the newest 30337 the group's own room
signed among the GroupSignedEvent rows this device holds, open or closed;
null for a group that never signed one. The transcript gets a line for a
verified policy -- "The group guards members' wallets, after 144 blocks,
about 1 day", or "has stopped guarding new members' wallets" -- so an
older-looking raw-JSON bubble never shows, and ProposedEvent says what a
signer is agreeing to, reading the proposal's shape through the new
MemberWalletPolicyEvent.read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:31:14 +02:00
Kgothatso NgakoandClaude Opus 5.5 62846dda33 feat(wallet): a group's policy on its members' wallets, open or closed (Phase 1)
MemberWalletPolicyEvent, kind 30337: ["d", "member-wallets"] with exactly
one of ["guardian_delay", <6..65,535>] or ["closed"], signed by the group's
own room. verify refuses a policy that says both, neither, or something out
of range, or that another room signed; newestAmong picks by created_at then
id, open or closed. Nothing produces one yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:28:29 +02:00
Kgothatso Ngako 05bd6ed6a8 Merge branch 'refs/heads/bennu' into claude/ecstatic-feynman-2c5628 2026-10-24 09:09:17 +02:00
Kgothatso NgakoandClaude Opus 5.5 3b2d9bd82f Merge branch 'bennu' into claude/ecstatic-feynman-2c5628
Brings in member guarded wallets and funding a descendant's guarded wallet.

- Schema: bennu's v30 (MemberWallet, MemberWalletSpend) is kept as it is;
  DkgSession.guardianDelay moves to v31, with a 30 -> 31 auto-migration.
- Conflicts: strings and README take both sides; the send form's guardian
  delay line moves into the shared SpendForm; the guarded wallet card keeps
  its Fund and Spend buttons and gains this group's own leaf's delay.
- bennu's uses of ANCESTOR_DELAY become each leaf's own delay:
  GuardedWalletRow.arriving, the funding form's "spend these coins again"
  line, the member wallet screens' reach text (MemberWalletManager.delaysOf)
  and the member certificate's proposal summary.
- Four of bennu's fixtures built a "guarded" wallet with no guardian leaf;
  they now carry the ancestor's, as a verified statement would.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:31:51 +02:00
Kgothatso NgakoandClaude Opus 5.5 0b8ae8150c feat(wallet): offer member guarded wallets on mainnet
GroupWalletRollout.MEMBER_WALLETS_ON_MAINNET is on, lifted by decision
ahead of the signet run that was to lift it, as GUARDIANS_ON_MAINNET
was. A member's own spend on mainnet stays held to MAINNET_CAP, like
every group and guardian spend: memberCapFor no longer lifts with the
gate, since the run that would have justified lifting both has not
been made. The note says the gate is open, what it still leaves open,
and where the cap lifts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:29:58 +02:00
Kgothatso NgakoandClaude Opus 5.5 a8869f533b Merge branch 'bennu' into claude/guarded-wallet-individual-plan-d79fcf
Brings in a group funding a descendant's guarded wallet. Three conflicts:

- GroupSendScreen: funding replaced the address field and named the
  funded wallet in the preview, inside the fields this branch moved
  into SpendForm. SpendForm now takes a destination slot, which a
  funding fills with its card, and the funded wallet's name; the
  preview takes both that name and the member's ownWallet words.
- GroupWalletScreen: the guarded wallet row is funding's card with Fund
  beside Spend, headed by this branch's #name / @name and carrying a
  member's label.
- docs/README.md: both rows.

Funding reads guarded wallets through GuardianManager.guardedWalletsOf,
which this branch widened to members' wallets, so a group can now fund
a member's guarded wallet. Every place funding named a wallet with
`name ?: "a subgroup"` -- the title, the destination card, the preview,
the proposal summary, a signer's refusal -- uses displayName, so it
reads "Fund @alice's guarded wallet". A test funds a member's wallet
end to end through GroupSpend.fundingsOf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:15:27 +02:00
Kgothatso NgakoandClaude Opus 5.5 ece52a12fd feat(groups): a group's page lists its members' wallets, and a person's page the groups guarding them (Phase 11)
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>
2026-10-24 07:58:05 +02:00
Kgothatso NgakoandClaude Opus 5.5 4ea38043ad feat(wallet): the groups guarding a member's wallet list it as @name (Phase 10)
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>
2026-10-24 07:53:23 +02:00
Kgothatso NgakoandClaude Opus 5.5 8a3e98e4d6 feat(wallet): a member spends their guarded wallet alone (Phase 9, part 2)
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>
2026-10-24 07:49:59 +02:00
Kgothatso NgakoandClaude Opus 5.5 f5f1763b4f feat(subgroup): the certificate carries the chosen delay, and both quorums check it (Phase 6)
proposeBirthCertificate grants the parent's own leaf the delay off the
child's ceremony, or the default for an older build's ceremony; every
inherited key keeps the delay its ancestor chose.

Every parent signer now takes the own leaf's delay from the proposal and
recomputes everything else -- keys, order, and each inherited key's delay,
which must be the group's own certificate's -- so a proposer cannot
shorten or lengthen an ancestor's wait. Every child signer refuses a
certificate whose own-leaf delay is not the one its ceremony announced at
the join gate. ProposedEvent says the delay in blocks and roughly in time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:48:36 +02:00
Kgothatso NgakoandClaude Opus 5.5 70d896a38d refactor(wallet): the send form is one composable a member's spend can share (Phase 9, part 1)
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>
2026-10-24 07:46:14 +02:00
Kgothatso NgakoandClaude Opus 5.5 b58a757a44 feat(subgroup): the picker chooses the parent's own guardian delay, and the join gate says it (Phase 5)
Under the guarded row, SelectSubgroupAdminsScreen offers the delay for
this group's own leaf: presets for an hour, two (the default), a day, a
week, a month, six months and the longest, and a custom field in blocks
whose supporting text says what it works out to, or why it cannot be
used. The view model keeps what was typed rather than clamping it,
refusal() refuses a delay outside 6..65,535 for a guarded subgroup, a
retry restores it, and confirm passes it to proposeRitual. The guarded
row and the join gate stop quoting 12.

Lands with Phase 6, which puts the chosen delay into the certificate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:44:52 +02:00
Kgothatso NgakoandClaude Opus 5.5 eb4d627840 feat(wallet): a member's guarded wallets on their profile, and each one's screen (Phase 8)
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>
2026-10-24 07:44:30 +02:00
Kgothatso NgakoandClaude Opus 5.5 467965b81a feat(wallet): Fund beside Spend on every guarded wallet, in a card that keeps the name (Phase 5)
Each guarded wallet on an ancestor's wallet screen becomes an outlined card:
the name (now up to two lines) and what is within reach, then Fund and Spend
in a flow row under them rather than in the list item's trailing slot, each
naming its wallet to a screen reader. Fund is offered only where the room has
a wallet of its own and can sign and watch. The supporting line adds what is
arriving -- coins not yet past the leaf's lock -- so a funding does not look
lost for two hours. The send form's destination card names the wallet once,
under "To", instead of repeating the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:42:21 +02:00
Kgothatso NgakoandClaude Opus 5.5 fbfe9075f2 feat(wallet): every screen says each guardian's own delay (Phase 7)
Before a parent can choose a delay, the screens stop saying "12":

- the child's wallet screen, opened or not, lists each guardian nearest
  first with its own delay -- "#Council: after 144 blocks, about 1 day" --
  named by the room this device holds for it;
- an ancestor's Guarded wallets list says, per wallet, the delay that
  wallet gives this group, and GuardedWalletRow.withinReach counts coins
  past that delay rather than the default (GuardedWallet.delay);
- the send screen tells a guardian that only coins past its leaf's lock
  can be spent;
- the subgroup rows and a subgroup's parent row say "Guarded wallet,
  after <delay>", off the certificate.

The strings that quoted one number are reworded without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:42:15 +02:00
Kgothatso NgakoandClaude Opus 5.5 0bc076a894 feat(wallet): a member asks a group to guard a wallet only they can spend from (Phase 6)
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>
2026-10-24 07:38:30 +02:00
Kgothatso NgakoandClaude Opus 5.5 5ff4af2d2f feat(dkg): a guarded subgroup's ceremony carries the delay its coordinator chose (Phase 4)
proposeRitual takes a guardianDelay and puts it on the proposal as
["guardian_delay", "<blocks>"], beside ["wallet", "guarded"] and only
there; acceptProposal files it on DkgSession.guardianDelay. A delay that
does not read, falls outside 6..65,535, or comes with an unguarded policy
drops the proposal, and proposeRitual refuses the same before anything
goes out. A guarded proposal with no delay files none, and is certified at
the default later.

Schema 29 -> 30: the nullable DkgSession.guardianDelay, an auto-migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:38:24 +02:00
Kgothatso NgakoandClaude Opus 5.5 2dd1caafdd feat(wallet): a number of blocks said in time, roughly (Phase 3)
text/BlockDuration.approximate: within 5% of exactly one hour, day, month
or year, that unit singular; otherwise the largest unit that comes to at
least 2, rounded -- 216 blocks is about 36 hours, 65,535 about 15 months.
delayText says it beside the block count, "144 blocks, about 1 day", and
the block count alone on regtest.

The catalogue's first plurals, so nothing reads "about 1 hours";
StringCatalogueJvmTest asserts they resolve. Nothing shows a delay yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:36:18 +02:00
Kgothatso NgakoandClaude Opus 5.5 7848559547 feat(wallet): the send form funds a descendant's guarded wallet (Phase 4)
GroupSendRoute.fundChatRoomId opens the form in fund mode: the address field
gives way to a fixed destination card naming the wallet, the address
fundingAddress chose and its index, and that the group can spend the coins
again after the leaf's lock. The form follows the descendant's chain state and
the room's open fundings, so a paid or held address moves on while it is open.
A route naming both a source and a destination is not opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:34:33 +02:00
Kgothatso NgakoandClaude Opus 5.5 b1e3e884cc feat(wallet): a guardian's delay is 6 to 65,535 blocks, and a parent can choose its own (Phase 1)
GuardianDerivation gains MIN_DELAY (6), MAX_DELAY (65,535, BIP68's
block-based ceiling) and DELAY_RANGE; ANCESTOR_DELAY becomes DEFAULT_DELAY,
the 12 a parent is offered first. grant() takes the parent's own leaf's
delay and leaves every inherited key at the delay its ancestor chose.
leafScript and GuardianTag.parse refuse anything outside the range, so a
tag under the floor does not read. Every tag written before said 12.

Tests pin the leaf script byte for byte where the number push changes
length -- 6, 16, 17, 127, 128, 32767, 32768, 65535 -- and older(65535) in a
checksummed descriptor. Nothing chooses a delay yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:33:12 +02:00
Kgothatso NgakoandClaude Opus 5.5 e181690f81 feat(wallet): every signer checks a member wallet before the group guards it (Phase 7)
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>
2026-10-24 07:31:57 +02:00
Kgothatso NgakoandClaude Opus 5.5 2b0cd72d8b feat(wallet): every signer derives a funding's address again before naming it (Phase 3)
GroupSpend.fundingsOf reads each payment's derivation against the guarded
wallets the room holds: a claim that derives is a funding, one that does not
refuses the spend, and one under an account this device does not hold is left
as the bare address. Every proposal and acceptance path and checkedSpend read
it, ProposedSpend says "Fund X's guarded wallet", open fundings hold their
addresses, and a bump keeps the claim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:30:14 +02:00
Kgothatso NgakoandClaude Opus 5.5 d6c2b1b20e feat(db): schema 30 keeps a member wallet's key and its spends (Phase 5)
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>
2026-10-24 07:27:33 +02:00
Kgothatso NgakoandClaude Opus 5.5 52390e27cf feat(wallet): the certificate a group signs to guard a member's wallet (Phase 4)
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>
2026-10-24 07:25:51 +02:00
Kgothatso NgakoandClaude Opus 5.5 fcf4b8e104 feat(wallet): a spend can fund a guarded wallet, and its PSBT says where (Phase 2)
GroupSpendBuilder.send and sendAll take a Destination: a typed address, or a
Funding of a descendant's guarded wallet at the address fundingAddress chose.
The funding output carries its tap_bip32_derivation under the descendant's
account, the field change already uses, so it is never taken for change and a
signer holding that wallet can derive it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:24:44 +02:00
Kgothatso NgakoandClaude Opus 5.5 58af30b8bf feat(wallet): a member's request for a guarded wallet, signed twice (Phase 3)
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>
2026-10-24 07:24:25 +02:00
Kgothatso NgakoandClaude Opus 5.5 39c3e128fb feat(wallet): an ancestor funds a guarded wallet two past its current address (Phase 1)
GroupWalletState.fundingAddress picks the lowest unused, unreserved receive
index from current + ADDRESSES_AHEAD up to the end of the watched window, and
GroupSpend.claimedFundingIndices reads what open fundings already hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 07:21:57 +02:00
Kgothatso NgakoandClaude Opus 5.5 3ec9fe0984 feat(wallet): a member with no key state can learn what the group signs with (Phase 2)
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>
2026-10-24 07:21:31 +02:00
Kgothatso NgakoandClaude Opus 5.5 5240ab24be feat(wallet): a member's guarded wallet derives and signs from one key (Phase 1)
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>
2026-10-24 07:17:05 +02:00
Kgothatso Ngako 60cb3fa7ae Merge remote-tracking branch 'origin/bennu' into claude/parent-group-wallet-control-5a1540
# Conflicts:
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/database/repository/DatabaseChatRepository.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/repository/ChatRepository.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/ui/view/model/ChatRoomDetailViewModel.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/ui/view/state/ChatRoomDetailUIState.kt
#	composeApp/src/commonTest/kotlin/com/machankura/bennu/compose/text/ProposedEventTest.kt
2026-10-24 06:13:32 +02:00
Kgothatso NgakoandClaude Opus 5.5 6bd47210f9 feat(subgroup): the detail screens show what a parent decided about a wallet (Phase 8)
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>
2026-10-23 22:10:14 +02:00
Kgothatso NgakoandClaude Opus 5.5 1069059174 feat(wallet): every member refuses and ignores a wallet its parent ruled out (Phase 7)
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>
2026-10-23 22:08:48 +02:00
Kgothatso NgakoandClaude Opus 5.5 47df6f51f7 feat(wallet): a subgroup's wallet screen offers only what its parent decided (Phase 6)
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>
2026-10-23 22:04:43 +02:00
Kgothatso NgakoandClaude Opus 5.5 52ca030c8b feat(subgroup): the child's quorum holds its certificate to the policy it joined under (Phase 5)
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>
2026-10-23 22:02:49 +02:00
Kgothatso NgakoandClaude Opus 5.5 44a15e9bc2 feat(subgroup): the certificate carries the wallet policy, and every parent signer checks it (Phase 4)
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>
2026-10-23 22:00:59 +02:00
Kgothatso NgakoandClaude Opus 5.5 6599b5b116 feat(subgroup): the picker chooses the subgroup's wallet policy, and the join gate says it (Phase 3)
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>
2026-10-23 21:58:10 +02:00
Kgothatso NgakoandClaude Opus 5.5 58751692c6 feat(dkg): a subgroup's ceremony carries the wallet policy its coordinator chose (Phase 2)
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>
2026-10-23 21:53:41 +02:00
Kgothatso NgakoandClaude Opus 5.5 f19001cd61 feat(subgroup): a birth certificate can carry its child's wallet policy (Phase 1)
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>
2026-10-23 21:50:57 +02:00
Kgothatso NgakoandClaude Opus 5.5 67fe01dd5b fix(groups): a grandchild's wallet reaches every guardian in one share
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>
2026-10-23 20:51:38 +02:00
Kgothatso Ngako da0841fd5e Merge branch 'claude/remove-nostr-relays-posts-fc5580' into bennu 2026-10-23 18:28:30 +02:00
Kgothatso Ngako 79f2ec3d4d Merge branch 'bennu' into claude/remove-nostr-relays-posts-fc5580
# Conflicts:
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/database/model/ChatMessage.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/database/repository/DatabaseChatRepository.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/nostr/wallet/GroupWallet.kt
#	composeApp/src/commonMain/kotlin/com/machankura/bennu/compose/repository/ChatRepository.kt
2026-10-23 18:28:25 +02:00
Kgothatso NgakoandClaude Opus 5.5 7093adc0ee feat(wallet): a group's onchain wallet is named for its group
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>
2026-10-23 18:26:44 +02:00
Kgothatso NgakoandClaude Opus 5.5 0449293963 fix(marmot): a direct message's envelope is opened, not taken for a signing decline
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>
2026-10-23 18:13:02 +02:00
Kgothatso Ngako 79470dab1a Merge branch 'claude/taproot-group-hierarchy-spending-7a37ac' into bennu 2026-10-23 18:07:20 +02:00
Kgothatso NgakoandClaude Opus 5.5 7746f3d17f feat(wallet): offer guarded wallets on mainnet
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>
2026-10-23 18:06:19 +02:00
Kgothatso NgakoandClaude Opus 5.5 af4304aaae fix(dkg): a parent's second subgroup is not shown its first one's signing sessions
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>
2026-10-23 17:59:34 +02:00