Guarded wallets are told to the groups above without a tap: upward
only, by one elected device as they arrive and by the rest when a
group's chat or wallet screen opens, with Share as the fallback.
docs/guarded-wallet-forwarding.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan is marked built, with a table of the nine places the build
chose differently -- the forwarder's own line written by share so the
button writes it too, a notice carried on by any device that believes
it whether or not it holds the room's key, one explanatory line under
the fallback section rather than one per row, and the signet run still
to make. The guardians and member-guarded-wallets notes say forwarding
no longer waits on a tap, and the README that it has been built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
A group above can use its leaf in a guarded wallet only once told, and
today that is the Share button on the lower group's wallet screen. The
plan has every device that files a guarded wallet it believes tell the
groups above it is in -- one elected sender at once, the rest in a
catch-up when a group's chat or wallet screen opens -- and keeps the
button as the fallback for a notice lost on the wire.
It fixes two bugs in the button on the way: it tells guardian groups
below the current one, and a guarding group's own member certificate
never counts as told.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
"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>
member-wallet-delay.md is marked built, with a table of where the build
chose differently -- most of all that a request carrying no policy still
reads, so wallets guarded before policies keep verifying. The member
wallets note's "full control" stops saying 12, and its D3 adds that only
an open group takes a request; the guardian-delay note's member-wallet row
and the README follow.
The three-emulator run is still to do by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
The member-wallet policy (30337) becomes the group's opt-in: no policy
means the group does not guard members' wallets (D8), so every new member
wallet's delay is one its group chose. A newer policy with ["closed"]
instead of a delay stops new wallets (D9); it never releases one already
guarded, whose addresses carry the group's leaf. Opening again is a newer
open policy.
The signer table, the picker's refusals (POLICY_UNKNOWN, NOT_OFFERED,
CLOSED), the request, the screen -- now MemberWalletPolicyScreen, with
Stop guarding new wallets -- and the emulator run follow. Phases 4, 5 and
6 now ship together, since 4 and 5 close every group until 6 opens it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The group's quorum signs a standing policy in its own room -- a new kind,
30337, ["guardian_delay", <blocks>] -- rather than a birth certificate
tag: the certificate is the parent's statement, frozen at birth, and a
root group has none. A member's request is built under the newest policy
and carries it whole, so late members (through the key notice) and
signers who missed it judge it alike; signers refuse a stale or missing
one. A wallet already guarded keeps its delay. Seven phases, not built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Member guarded wallets are offered on mainnet; a member's own spend
there stays held to MAINNET_CAP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A guarded wallet a group keeps for one member: the member's random key
on the key path, and the leaves a guarded subgroup of the group would
carry. docs/member-guarded-wallets.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The plan is marked built, with a table of the thirteen places the build
chose differently -- the key notice carrying the key rather than the
signed key state, the request travelling whole inside an inner event,
Put to the group living on the group's page, the wallet screen
following a member's spends while open, and the signet run still to
make before the mainnet gate lifts. The guardians and subgroups notes
point here, and the README says it has been built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
guardian-delay.md is marked built, with a table of where the build chose
differently. group-wallet-guardians.md's "Why 12, and why for everybody"
becomes "Why a delay, and who sets it": each parent chooses its own leaf's
delay from 6 to 65,535 blocks, inherited ones keep theirs, and a long
delay is a backstop rather than an override. The policy note's picker
section and the README follow.
The three-emulator run is still to do by hand.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
For delays at each edge of the script number's encoding -- 6, 16, 17,
127, 128, 32767, 32768 and 65535 -- an ancestor quorum's script-path spend
passes correctlySpends at nSequence = delay and fails one block short.
GroupSpendBuilder offers a guardian a coin only once it is that deep and
puts that sequence on every input, and GroupSpend.check refuses the
default's lock on a leaf that chose another.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>