Commit Graph
935 Commits
Author SHA1 Message Date
Kgothatso NgakoandClaude Opus 5.5 83289aa4d0 fix(lightning): the group page's Lightning row waits for an onchain wallet
The Lightning wallet's key is made by the onchain wallet's signers and its
channels close to that wallet, so until the group has opened one the row
has nothing behind it. It now stays on the page disabled, and says that
Lightning is only available once the group has an onchain wallet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:51:51 +02:00
Kgothatso NgakoandClaude Opus 5.5 c4d8561cb0 fix(lightning): the wallet's payment list says a close is a close, and a sent amount without its fee
The same two misreadings the regtest run found in the room's lines, on the
wallet screen: a channel's close, which lightning-kmp files as an outgoing
payment with no payment hash, was listed as sent, and a sent amount
included its fee. Both now read through GroupLightningReports.isChannelClose
and recipientMsat, which the room's lines use too. A close is listed as one,
or as closing until it confirms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:06:02 +02:00
Kgothatso NgakoandClaude Opus 5.5 94385d2f4a fix(lightning): a channel's close is not a payment sent, and a sent amount leaves out its fee
Found by the regtest run, now that it checks the transcript. lightning-kmp
files a channel's close as an outgoing payment with no payment hash, which
wrote "sent" beside each closed line, and an outgoing payment's amount
includes its fee, so 20,000 sats with an 84-sat fee read as 20,084 sent.
GroupLightningRegtestJvmTest now asserts every device's lines: one per
channel opened and closed, one per payment, and no raw JSON, refusal or
alarm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 09:01:18 +02:00
Kgothatso NgakoandClaude Opus 5.5 a660fabd7e feat(lightning): a co-signer's refusal and the equivocation alarm, as lines (Phase 6)
The wallet's plan said a person sees a refusal as a transcript line, and
that two hashes echoed for one label raise the alarm in the transcript;
both were logger calls. A refusal is now said on the refusing device only,
once per request, with the check that failed; an operator asking for two
messages under one label is said on every device that sees it, once per
label, in the error tint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:21:21 +02:00
Kgothatso NgakoandClaude Opus 5.5 3ec79b95ad feat(lightning): what the operator's snapshots say happened, as lines (Phase 5)
A channel opening or closing, and a payment received, sent or failed, each
get one line however many snapshots repeat them. The snapshot restates the
whole wallet, so the line is keyed on the fact, not the message:
ChatMessage.lightningFactKey (v34, an AutoMigration) holds the channel's or
the payment's id. A payment's line sits where the payment happened, and a
channel a newer snapshot no longer holds is said to have closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:19:38 +02:00
Kgothatso NgakoandClaude Opus 5.5 1b4ed09798 feat(lightning): what the operator and the members say to each other, as lines (Phase 4)
The node seed being handed out, an invoice asked for and made, and an
operator's node stopping now each write one line, through
GroupLightningLines: on the way out by the device that sends the message,
which never reads its own back, and on arrival by every other, keyed on the
inner event so a redelivery is not a second line. An invoice request and a
stop are filed on arrival for the first time, and a stop is believed only
from the operator of the term it names.

The operator election line names the operator, the Lightning wallet's
signed lines get icons of their own, and every Lightning line opens the
wallet's screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:11:56 +02:00
Kgothatso NgakoandClaude Opus 5.5 3922c15d74 feat(lightning): the Lightning ceremony's lines read like the shared key's (Phase 3)
A ceremony stopped on another device was recorded as "Abandoned by" a key
prefix and the sender's exception message, and the screen showed it after
"Abandoned:". IcebergRitualManager.describe now says each fault as a
sentence naming the member at fault, sends that sentence in the failure
message, and the screen shows it in the error card the shared key ceremony
uses.

RitualNotice's chevron was described as opening the shared key ceremony on
every line; each family now says what it opens, the lines that lead nowhere
draw none, and only a request line can carry the approved tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:06:20 +02:00
Kgothatso NgakoandClaude Opus 5.5 03833a1c42 feat(lightning): the Lightning wallet's key ceremony asks from above the composer (Phase 2)
The standing notice under the newest message read only the shared key's
ceremonies, so a member owed the Lightning wallet's join, reveal or confirm
had to scroll to its request line. AwaitingCeremony now says which ceremony
and what it wants, the chat's view model observes the Lightning ceremonies
beside the shared key's, and a tap opens the screen that ceremony has.

The member who opened the Lightning ceremony is also asked, once its key is
made, to open the wallet -- the counterpart to ChillDKG's room awaiting
creation -- until a wallet statement for it is being signed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:03:01 +02:00
Kgothatso NgakoandClaude Opus 5.5 638c5aab64 fix(lightning): the wallet's own messages leave no raw JSON in the chat (Phase 1)
Every kind the group Lightning wallet's devices send each other -- the
Iceberg ceremony, the co-signing, the operator's snapshots and invoices --
reached applyInnerEvent's last arm and was written as an unsupported line
holding the event's JSON, beside the lines the managers already write.
GroupLightningEvents.PROTOCOL now joins the ChillDKG and FROST families as
protocol, and MIGRATION_32_33 deletes the bubbles already in rooms, found by
the kind of the inner event behind them, as MIGRATION_26_27 did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 23:58:07 +02:00
Kgothatso NgakoandClaude Opus 5.5 515ddea2be feat(lightning): the group node acts as requests arrive, and the mainnet run is recorded
On the first mainnet run, most of the wait for an invoice (six seconds) and for an authorised
payment to leave (five) was the node's ten-second poll. The node now watches the room's
invoice requests (30364) and authorisations (30363, which carry channel actions too), and acts
the moment either changes. The poll stays, for expiries and snapshots. Answering, paying and
closing each take one lock, so a wakeup, the poll and a direct call never act twice on the
same request: payAuthorised checks hasPaid, which suspends, before it marks a payment in hand.

Advances lightning-kmp-app to the commit that keeps payment preimages out of a release build's
Logcat.

The plan doc records the run with ACINQ's mainnet LSP: an on-the-fly 25,000-sat taproot
channel, 8,558 sats received, and a 21-sat payment sent. Every co-signer approved every
commitment. The doc also notes that a payment larger than the channel's 16,442 sats of
inbound would need the splice the co-signers still refuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 23:47:32 +02:00
Kgothatso NgakoandClaude Opus 5.5 309a486de9 fix(lightning): set the group node up as Phoenix sets up its own
ACINQ's mainnet LSP hung up on the group's node seven milliseconds after init, every time. The
node required simple taproot channels (bit 564). The LSP's init lists neither 564 nor 565, and
BOLT 9 obliges a peer to hang up on a required feature it does not offer. Phoenix leaves the
feature optional and stays connected. Nothing is lost by matching it: lightning-kmp asks for the
taproot channel type in every channel it opens, and the co-signers rebuild every funding output
and commitment as taproot.

The node now takes Phoenix's setup wherever the group's terms allow:
- lightning-kmp's default features and peer storage
- connect and handshake timeouts that grow with each attempt, tripled over Tor
- the LSP's onion address while the identity has Tor on, and no clearnet dial over Tor
- the 50% relative cap on liquidity fees

The absolute fee cap stays the statement's, and the redial backoff stays: Phoenix's resets at
every handshake, which against an LSP that hangs up after init would redial every 0.1 s.

On the operator's emulator, the group's connection to ACINQ now holds. The regtest run still
opens a simple_taproot_channel and passes. Whether ACINQ opens a taproot channel to the group's
node is still unknown until one is opened on mainnet. The plan doc says so, and Phase 0's
instruction to require the feature is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 23:03:27 +02:00
Kgothatso NgakoandClaude Opus 5.5 3e4de464fe feat(lightning): the group node redials the LSP, and says why it was dropped
lightning-kmp never reconnects by itself. The identity's own node has Phoenix's connection
daemon for that; the group's node connected once, so a single drop left it offline for the
rest of the term.

It now redials after every drop, waiting two seconds and doubling up to five minutes. A
connection that ends within a minute counts as a failure, so an LSP that hangs up on our
features isn't redialled every two seconds. Each drop is logged with its reason. When the
LSP's init doesn't offer a feature we require, the log names it. The node waits up to a
second for that init, because the socket can read as closed before the init's event arrives.

Run against ACINQ's mainnet LSP on an emulator, every drop reads: "Connection closed: the
LSP does not offer simple_taproot_channels, which this node requires". The plan doc now
records that against Phase 0's first step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 22:37:54 +02:00
Kgothatso NgakoandClaude Opus 5.5 cf8ae0200e feat(lightning): the group Lightning wallet on mainnet only
The Lightning wallet now opens on the node's own network, mainnet,
where the group's onchain wallet already is, so the separate testnet3
onchain wallet and its row on the group's screen are gone.
GroupLightningRollout.allows takes mainnet and regtest, nothing else.

This lifts the plan's mainnet gate by decision, ahead of its condition:
an outside review of the Iceberg scheme and the DKG, and a month on
testnet3. The LSP's signing deadline was never measured either.
Meanwhile:

- Every co-signer refuses to sign for a mainnet channel over
  MAINNET_CHANNEL_CAP, 1,000,000 sats, so a bigger one never opens; none
  grows, since splices are refused.
- The opening screen says the scheme is unreviewed and names the cap.

Running the co-signing suite on mainnet (now a second test class) found a
bug that would have stopped everything there: every key manager was built
with a testnet swap-in tpub, which lightning-kmp rejects on mainnet. That
covers every co-signer and the operator's node. Mainnet now takes the
mainnet LSP's published xpub; nothing derives from it.

The full JVM suite (1,578 tests) and the regtest run pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:45:57 +02:00
Kgothatso NgakoandClaude Opus 5.5 5ff9380b03 feat(lightning): turn the group Lightning wallet on, on testnet3 (Phase 15)
GroupLightningRollout.ENABLED is now true. A Marmot group's screen offers
the Lightning wallet and the testnet3 onchain wallet it closes to, and
devices run the group nodes they are elected to. NIP-17 rooms still get
neither: they have no key to sign with. Mainnet is still refused by
GroupLightningRollout.allows, whatever a screen offers.

It was turned on before Phase 0's testnet3 measurement of how long the
LSP waits for a signature, so the 60-second signing deadline is a guess
until the first groups run there. The plan doc says so.

The wallet-row test now finds the onchain row by its title and status,
since the testnet3 row is also "Not opened yet". A new test checks that
the Lightning rows open the Lightning wallet and the testnet3 wallet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:25:37 +02:00
Kgothatso NgakoandClaude Opus 5.5 0939bd4c55 Merge branch 'bennu' into claude/lightning-wallet-iceberg-f20da1
Brings in an Electrum client for a profile with no node: IdentityElectrum
gives an nsec or npub profile a StandaloneElectrum of its own, so every
profile can watch the chain.

For the group Lightning wallet:

- GroupChainClients now sits on IdentityElectrum's client for the node's
  network, so group wallets and the watcher work on profiles with no node
  too.
- Each other network (testnet3, for the Lightning wallet) now gets a
  StandaloneElectrum instead of this branch's own connection loop. The
  old loop picked a server with ElectrumServers and connected directly,
  ignoring the profile's Tor setting, so a profile with Tor on would have
  reached a testnet3 server in the clear. The new one uses onion servers
  while Tor is on. A test covers it.
- The group's Lightning node takes its context and logger from the app,
  not the identity's Phoenix business, so a profile with no node that
  holds a share can be elected and run it.
- The member wallet's follow() keeps its network parameter.

The full JVM suite (1,568 tests) and the regtest run pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 21:28:17 +02:00
Kgothatso NgakoandClaude Opus 5.5 cb277d3269 Merge branch 'bennu' into claude/lightning-wallet-iceberg-f20da1
Brings in the guarded member wallets, guarded subgroup wallets, ceremony
creation, and the removal of the group's nostr profile, relays and posts.

Two clashes needed more than a textual resolution:

- Event kinds. The guarded-wallet family took 30333-30337, the numbers
  the Lightning family used for its ceremony. Nothing conflicted
  textually and nothing would have failed, since each side reads the
  other's events by kind. The Lightning family moves to a fresh run,
  30350-30366, which costs nothing: rumor kinds that never shipped.
  GroupLightningEventsTest now knows the guarded-wallet kinds and asserts
  the family starts past every kind the app uses.
- Schema versions. bennu used 27-31. This branch's four versions were
  never on an installed database, so they become one migration, 31 to 32,
  adding the 13 Lightning tables.

Also:

- bennu's new member-wallet calls (broadcast, confirmationsOf,
  guardianSpends, the fee suggestion) now take the network, because this
  branch made Electrum clients per network.
- bennu's watcher conflict check uses the transaction's own network.
- NEVER_BROADCAST is gone with the broadcast screen, and so is the test
  that checked the Lightning statements against it.

The full JVM suite (1,554 tests) and the regtest run pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:23:33 +02:00
Kgothatso NgakoandClaude Opus 5.5 3f5de5887c refactor(wallet): every profile can watch, so the cannot-watch branches go (Phase 3)
The wallets are non-null wherever a screen is reached with an identity, and
with them go GroupWalletAddressesUIState.CannotWatch, the CANNOT_WATCH refusal,
canWatch on both wallet states and the new-member-wallet view model, and the
two strings that explained it. An nsec profile can now ask for a member wallet.
The profile screen keeps a nullable wallets, for previews and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:16:29 +02:00
Kgothatso NgakoandClaude Opus 5.5 da48d7b06c feat(wallet): an nsec or npub profile watches the chain on a client of its own (Phase 2)
IdentityElectrum hands the nav host the node's client for a profile with a
node, and a StandaloneElectrum for one without, stopping the last before the
next is made. The group wallets and the transaction watcher are made from it,
so they now exist for every profile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:10:19 +02:00
Kgothatso NgakoandClaude Opus 5.5 9899c57164 feat(wallet): an Electrum connection loop for a profile with no node (Phase 1)
StandaloneElectrum is the node daemon's Electrum branch without the business:
the identity's server, the same pauses and handshake timeouts, a fresh start
on any change to the network, Tor or the server, and no clearnet connection to
a server the user wants reached only over Tor. Not wired in yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:05:31 +02:00
Kgothatso NgakoandClaude Opus 5.5 ceffda81f6 Merge remote-tracking branch 'origin/bennu' into claude/wallet-guardian-group-display-4e7e78
Brings in guarded-wallet forwarding (docs/guarded-wallet-forwarding.md),
which made telling the groups above automatic and touched the same
sharing code in GuardianManager.

Resolved by keeping both: its upwardOf, elected sender and catch-up,
and this branch's naming and certificate tag. Its automatic forward now
carries the guardian's birth certificate too (guardianCertificateFor),
and D5's re-tell rule moved into its told(), replacing alreadyTold. Its
wallet-level named() is dropped in favour of this branch's, which also
fills the guardian and branch names.

GuardedWalletForwardJvmTest's "the button offers only what goes up"
now shares with the certificate, as every share from this build does;
without it the wallet is rightly offered once more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:18:38 +02:00
Kgothatso NgakoandClaude Opus 5.5 abb2c550ab feat(wallet): a person's page lists each guarded wallet once, with the group that guards it (Phase 6)
Wallets your groups guard drew one row per holding group, so a wallet
held by a group and its parent appeared twice, each row calling its
holder the guardian. MemberWalletManager.byWallet gathers the rows into
one entry per wallet: headed by its label, "Guarded by #M" for the
group that signed its certificate, and under it each group here with a
leaf in it, nearest first -- "#P: after 144 blocks, about 1 day" --
with Spend where this device holds a share, described as "Spend from
Savings as #P".

GuardedHere.guardianName, which was the holder's room name, is now
holderName, so it is not mistaken for the direct guardian's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:09:26 +02:00
Kgothatso NgakoandClaude Opus 5.5 a49c3c1639 feat(wallet): an ancestor's wallet screen gathers a member's wallets and names who guards each (Phase 5)
Members' guarded wallets move under a Members' wallets sub-heading, one
header per person -- @alice, "2 wallets, guarded by 2 groups" -- that
opens their profile, with a card per wallet beneath it. Each card says
which group below guards it: "Guarded by #N", "Guarded by #M, below
#P" where it is further down than this group's own child, "Guarded by
this group", or, with no name this device can check, "Guarded by a
group below #P". An unlabelled wallet is headed by that line.

Fund and Spend now name the wallet as well as the person, so a screen
reader tells one member's several wallets apart. The spend form's
title, the proposal a signer reads and the transcript line name a
labelled member wallet the same way: @alice's guarded wallet "Savings".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:04:08 +02:00
Kgothatso NgakoandClaude Opus 5.5 695b3db84c feat(wallet): an ancestor's guarded wallets gathered by person (Phase 4)
byPerson() gathers the member wallets among an ancestor's guarded rows
into one PersonGuardedWallets per member: their rows nearest first,
then by the guarding group's name, and a count of the distinct groups
that directly guard them. Subgroups' wallets are left out. Pure, over
the rows the screen already holds, so nothing has to be kept in step
while the chain redraws them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:58:16 +02:00
Kgothatso NgakoandClaude Opus 5.5 5200c4c182 feat(wallet): a notice of a member's wallet carries its guardian's birth certificate (Phase 3)
A 30333 carrying a 30334 gains ["certificate", <30329>]: the birth
certificate of the group that signed the member's wallet, so a device
in a group above that was never in that room can name it. It is a tag,
so an older build still believes the wallet, and it is checked with
certifies before it names anything.

GuardedWallet carries the checked certificate, Shareable passes it on,
and share writes it, so each hop up the tree hands it further. A room
told before notices carried it is offered again, once, when this
device has one to add.

Tell the groups above now offers only guardians above the room it is
shown from. It offered every guardian but that room, so a device in P
and M was asked to tell M about M's own member's wallet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:56:59 +02:00
Kgothatso NgakoandClaude Opus 5.5 a91bcfc269 feat(wallet): a member's wallet is named by the group that guards it, where this device can check (Phase 2)
GuardedSubject.Member gains guardianName and branchName, filled in
GuardianManager.named beside ownerName, so every caller of
guardedWalletsOf gets them without a lookup in a composable.

Each name is the room's founding name, read off a birth certificate its
parent signed and checked with SubgroupBirthCertificateEvent.certifies,
whoever handed it over: the certificates the parent signed, the room's
own key state, or one a subgroup's statement told to the holding room
carries. Without one, the room's name here; without that, null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:51:42 +02:00
Kgothatso NgakoandClaude Opus 5.5 449d80f8bf feat(wallet): a guarded wallet knows the group that directly guards it (Phase 1)
GuardedWallet gains three derived properties: directGuardianChatRoomId,
the nearest guardian, which for a member's wallet is the group that
signed its certificate; isGuardedHere; and branchChatRoomId, the
holding group's own child the wallet sits under. All are read off the
guardians and the line of descent a verified certificate already gives.

LineageExample is the note's R/P/M/N tree with Alice's two wallets in
it, for this phase's tests and the later ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:49:11 +02:00
Kgothatso NgakoandClaude Opus 5.5 7b6ea16c3b feat(wallet): the wallet screen says sharing upward happens on its own (forwarding, Phase 6)
Tell the groups above stays, as the fallback for what the automatic
forwarding could not send, and now says so once under its heading:
this device tells the groups above on its own when it can, and Share
is for a group above that has not heard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:47:28 +02:00
Kgothatso NgakoandClaude Opus 5.5 ea557306a5 feat(wallet): one line per guarded wallet shared into a group, and the forwarder sees it (forwarding, Phase 5)
With several devices able to forward, a group can be told about one
wallet more than once. A notice now writes its transcript line only
when it is the first the room holds for that statement, and none when
the room signed the statement itself; a duplicate is filed and silent.

share writes the forwarder's own line into each group it tells, since a
sender is never handed its own MLS message back -- for the automatic
forwarding and the button alike.

Two older tests described a notice under an id other than the one they
filed, which now reads as a second notice; they describe the filed one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:46:43 +02:00
Kgothatso NgakoandClaude Opus 5.5 23b6f00496 feat(wallet): opening a group catches up on what the groups above were never told (forwarding, Phase 4)
GuardianManager.forwardAll forwards everything the button would list
from a room, on every network, without the election: what the elected
device never sent, what arrived while this one was offline, and every
certificate and statement filed before forwarding existed. It runs as
the group's chat opens and before its wallet screen reads what is left
to share, through ChatRepository.forwardGuardedWallets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:44:27 +02:00
Kgothatso NgakoandClaude Opus 5.5 29979e6ba5 feat(wallet): a guarded wallet is told to the groups above as it arrives (forwarding, Phase 3)
Three arrivals now forward, on the device elected to send at once: a
member wallet certificate filed in the group that signed it, a guarded
wallet statement filed in a subgroup, and a notice arriving in a group
-- the statement inside goes on a generation further, from any device
that believes it, whether or not it holds that room's key. Each rides
on the arrival and never fails it.

GroupWalletRollout.FORWARDS_GUARDED_WALLETS is the switch; the button
does not read it. A member's wallet signed two generations down now
reaches the root with nobody calling share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:43:00 +02:00
Kgothatso NgakoandClaude Opus 5.5 7397ca46ed fix(wallet): a guarded wallet is told upward only, to a group that does not hold it (forwarding, Phase 2)
GuardianManager.forward tells every group above a room that this device
can tell about a statement it believes, as the profile in that room.
With whenElected it sends only where this device is the elected sender
among the members of both rooms; the catch-up will send the rest.

The button's targets move onto the same rules, which fixes two bugs in
it: it offered to tell guardian groups below the room as well as above
-- the root re-telling the middle group that told it -- and a guarding
group's own member certificate, held as a signed event, never counted
as told. A target belonging to another profile on the device is never
told either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:41:12 +02:00
Kgothatso NgakoandClaude Opus 5.5 8c46ba8a1b feat(wallet): what a forwarder believes, and which groups are above (forwarding, Phase 1)
GuardianManager.verify splits into believable -- everything it checks
except the walk down from an ancestor's own guardian root, which only a
device holding that key can make -- and the walk. believable is what a
device checks before passing a statement on.

upwardOf is the groups a statement is told to from a room: those after
it in the guardian list, never those before. electedSender is who, of
the members in both rooms, sends at once. Nothing calls either yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:38:39 +02:00
Kgothatso NgakoandClaude Opus 5.5 b7baea701b fix(wallet): a direct chat is not a group that can guard a member's wallet
A direct chat is a Marmot room of exactly two people, and never has a key
-- a ceremony needs three -- so it passed the picker's only filter and sat
there asking for a key nobody can answer with. MemberWalletManager.couldGuard
leaves out a room of fewer than three members unless this device knows its
key, so a real group that shrank to two after its ceremony stays. The
picker (groupsOf) and the group page's members' wallet section and Ask
button use the same rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 11:09:45 +02:00
Kgothatso NgakoandClaude Opus 5.5 8871e47224 feat(wallet): the group picker lists only groups that guard members' wallets, or may
"Choose a group to guard it" no longer lists a group that never opened to
its members' wallets, or has closed: neither is a choice. A group whose
key -- and so whose policy -- this device has not been told stays, with
the button that asks, since the answer is how it learns the group is
open; so do the refusals about the profile itself. The empty list now
says how that changes: a group's signers can turn it on from its page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:58:55 +02:00
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