Trusted Sites is nostr-identity signing, and name authority now lives on the
Username page, so the nostr cluster is its logical home. Pure placement move:
the row now renders inside the identity card just below Nostr Relays; label,
live session-count value, and open handler are unchanged.
Also carries the two raw-key leak fixes (goblin.receipt.copied ->
goblin.receive.copied, wallets.canceled -> wallets.tx_canceled) and the
every_t_call_site_key_exists_in_en guard, so this branch is clean on its own.
Translations for the new settings/username/advprivacy keys were reviewed
across all six locales and left as-is (consistent with house register).
The returning-user identity-import path (a .backup file or a bare nsec,
existing plumbing since Build 92) is now surfaced as proper centered
buttons instead of a small left-aligned text link.
- Wallet step: a first-class "Import identity" choice stands alongside
Create new / Restore from seed. It composes with either seed choice; the
import panel itself opens on the identity step once the wallet exists.
- Identity step: the left-aligned "Already have an identity? Import it"
link is replaced by a centered secondary button labelled "Import
identity", consistent with the other onboarding buttons. The panel behind
it clearly offers BOTH a .backup file picker and an nsec field.
New keys goblin.onboarding.wallet.import_identity{,_hint} in all six
locales; drift test green.
Follow-ups on the Settings redesign, all in the goblin view:
- Truncation sweep: settings_row_toggle now reserves room for the switch
and bounds the text column, so a long label/subtitle WRAPS to another
line instead of running under the switch and clipping. Fixes the
Advanced Privacy notification descriptions (worst in longer locales);
applies uniformly to every toggle row. The Username and Advanced Privacy
blurbs are full-width labels that already wrap. No description on the new
surfaces can truncate: wrapping is width-bounded, not length-tuned.
- Anonymous-mode censor is a FIXED count of dots (five), computed by a pure
censored_amount_dots() that ignores the real amount, so the balance
magnitude never leaks. Used for both the home balance hero and censored
activity amounts. Unit-tested to never vary with size.
- Settings navigation resets to the root whenever the user is off the
Settings (Me) tab, so leaving and re-entering always lands on the
top-level page instead of the last sub-page. One reset at the leave/enter
boundary via a pure settings_page_after(); deep links that open a
sub-page set the tab to Me in the same frame, so they survive. Unit-tested.
Two new Settings pages, each the single home for its feature.
Username (SettingsPage::Username) consolidates everything name-related
off the main Settings and out of the identity card: claim a name if you
have none, release the one you own, and choose the name authority from a
known list OR a free-typed custom server. Reuses the existing claim_ui and
claim/release worker flow; the old inline name-authority editor and the
main-settings claim card are removed (single home).
Advanced Privacy (SettingsPage::AdvancedPrivacy) replaces the lone
"hide amounts" toggle. Notifications section: hide amounts (existing),
hide names, or hide all details (a generic localized private alert that
leaks no name or amount; an empty amount collapses the Android
notification template to just the private line). Anonymous mode: one
toggle that censors STRICTLY the home balance (dots, tap to reveal; the
fiat rate fetch stays off until revealed) and the activity list (dots for
names and amounts, tap a row to reveal and open). Presentation only, with
no money-path or storage change.
Migration: the existing hide_amounts config keeps its exact meaning
(notification amount hiding); the three new fields default off, so no
surprise on upgrade. Covered by a new config test (227 lib tests).
All new strings via t!() in all six locales; drift test green.
Root cause of the broken build 153 QR trust login, confirmed in code:
cb.return_to_caller() fired in the sign handler right after spawning the
callback POST worker. The app backgrounded immediately, the GUI frame pump
stopped, and the rest of the grant lives on that pump: the outcome poll that
consumes the POST result, the session creation, and the session-open channel
publish (which the service loop only sends on its next tick, after
add_session marks the set dirty). Backgrounded, none of that ran, so the
site never received the session and the browser poll never logged in.
The ordering fix, uniform across login, authorize, and trust:
- the sign handlers no longer return-to-caller; the app stays foreground
(frames pumping) until the flow is fully complete
- login/authorize: the return decision happens in the outcome poll, only on
a successful POST; a failed POST keeps the user in the wallet with the
honest toast
- trust: the decision waits further, for the session-open announce to be
CONFIRMED handed to a relay. announce_new_sessions now records per-channel
delivery (at least one relay accepted) in NostrService::session_announced;
the new TrustWait GUI state polls it with a 15s deadline and an honest
"announce unconfirmed" toast on timeout (goblin.trust.announce_failed x6)
- a freshness bound on all three: a result consumed on a late resume (the
user backgrounded the wallet themselves mid-flow) shows the toast but
never bounces them back out
- the decision itself is the pure authuri::should_return_to_caller(allowed,
post_ok, publish_confirmed), unit-tested: pending, failed, or unconfirmed
work never returns; rt=0 never returns
Trust prompt copy, owner directive: the gist in one or two lines, detail
tucked away. The modal now leads with a single plain line (act-for-you plus
the money rule) and folds categories, money line, and duration behind the
existing show-full disclosure idiom; the red caution lines stay visible.
goblin.trust.* keys tightened in all six locales, drift test green.
The Build 151 return-to-caller is right for same-device deep-links but wrong
for a QR scanned from another screen: there is no caller, so the wallet bounced
the user into whatever app was previous. The login/authorize/trust URIs now
carry an optional rt flag: rt=0 disables the return (QR case), rt=1 or an absent
flag keeps the return (backward compatible). Parsing is byte-exact and fails
closed to the return-enabled default on empty, garbage, or duplicate values
(first occurrence wins, like every other param). Security is unchanged: the flag
is a single boolean gate on the existing best-effort app-switch and derives no
target, so it can never introduce a redirect the URI could not already perform;
cb-host==domain binding and every other check are untouched.
- shared parse_return_flag helper in authuri, reused by login and trust
- return_to_caller field on LoginUri, AuthorizeUri, TrustUri (default true)
- all three GUI flows (login, authorize, trust) honour the flag uniformly
- parser unit tests: absent/explicit/garbage/duplicate + the no-return decision
FR wallets.tx_stale was 'En attente trop longtemps' (noun + adverb, not
grammatical); now 'En attente trop longue', adjective agreeing with attente.
Other five locales for tx_stale / receipt.stale_note read natural, left as-is.
Also carries the two raw-key leak fixes (goblin.receipt.copied ->
goblin.receive.copied, wallets.canceled -> wallets.tx_canceled) and the
every_t_call_site_key_exists_in_en guard so this branch is clean standalone.
Some pending transactions showed no way to cancel or clear them, stranding
users with stuck pendings (fee-bug leftovers, and payments orphaned after an
identity switch whose nostr meta lives in another identity's store).
Root causes:
- Goblin receipt: both cancel affordances required the payment's nostr tx_meta,
which is per-identity. A tx orphaned by an identity switch (or left by an old
build) has no meta in the active store, so neither Cancel button rendered.
- GRIM tx list + tx detail: the Cancel button was gated behind
wallet.synced_from_node(), so an unreachable/unsynced node hid it entirely.
Fixes (cancellation is unchanged: the plain libwallet cancel_tx that unlocks the
reserved inputs, GRIM parity, no new money behavior):
- Receipt: universal fallback Cancel for any still-cancellable pending the
nostr-aware paths miss, running WalletTask::Cancel. ReceiptDetail carries
can_cancel/stale.
- GRIM list/detail: ungate the local Cancel from node sync (only repost/repeat
still needs a live height).
- Soft "stale" nudge on pendings older than 24h (WalletTx::stale/STALE_AGE_SECS)
with the Cancel right there. It only colours a label; nothing auto-cancels on
a timer (a slow interactive send may still complete).
- New tx_stale / receipt.stale_note strings across all six locales.
- Unit tests for can_cancel state coverage and the stale threshold.
1. Lock Android to portrait (screenOrientation="portrait" on MainActivity).
Phone-first GRIM-style wallet; no cheap phone/tablet split so the whole
Android app is locked, matching the single phone surface.
2. Enlarge the mobile Home header wordmark: mark 24 to 36 (+50%), "goblin"
text 18 to 26, gap 8 to 9, so the top-left lockup carries the same
visual weight as the 40 to 44px right cluster (owner asked for a
noticeably bigger bump than the first +25% pass).
3. Swap the Pay-screen inline mark for the official GoblinPay lockup: the
black Apple-Pay-style badge on light surfaces, the white wordmark on
dark (theme dark_base split). New img assets from the GoblinPay repo.
4. Plain GoblinPay/receive QR: drop the yellow center-mark overlay from
w::qr_code (mirrors the prior "plain QR default" decision). Test
goblin_receive_qr_decodes updated to the plain render.
After approve + hold-to-accept, the pending request card no longer keeps
the Decline button and amount alongside a half-width spinner. While the
payment is in flight the whole card is replaced by one centered spinner
labelled with the action, sitting exactly where the card was, and it
vanishes once the send completes and the request clears.
P2-1: a money-tier request id is reserved the moment its prompt is raised
(money_pending_ids); a replayed envelope (drain overlapping the live
subscription, or deliberate) returns AlreadyPending / the cached result and
can never raise a second prompt or re-sign. Applies to sign and escalated
encrypt. Regression test covers both replay-while-pending and replay-after-
completion.
P2-3: the money modal for a pay-committing encrypt now shows the inspected
plaintext (escaped + truncated exactly like the sign path), so the user sees
what they are agreeing to pay, not a blind label.
Hardening:
- payment marker set widened (amount, total, price, msat), TODO(audit) kept.
- identity dropped mid-session now answers identity_mismatch on the channel
(refusal_json per op type) instead of silently timing out the site.
- session-end payload carries reason: revoked (wallet end) / expired (TTL or
idle sweep, newly published by the tick) / logout (site's own).
- decrypt gets its own soft-cap window (30/min) and an honest 'reading your
messages' notice, distinct from the signing-volume toast (new locale key
in all six languages).
- money answers route by the session's site channel key, never the display
domain.
- committed the auditor's env-gated NIP-44 v2 interop test against
nostr-tools (GOBLIN_CT1 harness).
- The session channel now subscribes and publishes on the wallet's relays
UNION each session's relay hint (channel_relays), dialing any hinted relay
via the idempotent connect_relays, so wallet and site meet even without a
shared default relay.
- Clean up clippy findings in the new code (abs_diff, collapsible ifs via
let-chains, char-array find).
- Trust-grant modal: password-gated hold-to-confirm 'Trust <domain>?' showing
identity + truncated npub, the granted low-tier categories (human labels,
caution lines for unknown/login-excluded kinds), and the fixed money-asks
line. Folds login in; creates the session on login-POST success.
- Money-tier per-action modal: the v1-authorize-shaped password + hold-to-confirm
prompt raised over the channel for a sign or a pay-committing encrypt; declines
on cancel/timeout.
- Trusted Sites settings page: active sessions, what each signs silently, time
left, pause/resume, and one-tap end (revocation). Row + count in Settings.
- Dispatch + per-frame router for trust/money; PENDING_TRUST wired.
- goblin.trust.*, goblin.money.*, goblin.trusted_sites.*, settings.trusted_sites
in all six locales; drift test green.
- Add channel encrypt/decrypt ops (identity-key NIP-44) for magick's order-DM
seal path: EncryptRequest/DecryptRequest, serve_encrypt/serve_decrypt,
ChannelOp, generalized complete_money. Both low tier + rate-limited; an
encrypt whose plaintext commits payment escalates to the money prompt;
decrypt (the DM-read risk) is rate-limited and flagged for the security pass.
- session-open payload aligned to {type,id,identity_pubkey}; sent alongside
the unchanged 22242 server callback.
- Error codes aligned to the shared set (Refused -> kind_not_in_session).
- Owner ruling: kind 30402 (listing) is money tier, stripped from the silent
set like 17/22242; spec tier table + category map + tests updated.
- session.rs: channel-event builders (session-open / session-end / wrapped
sign_result), decrypt, SessionSummary + PendingMoney, and the serve/
complete_money runtime orchestration (with unit tests).
- client.rs: in-memory session store on NostrService (add/end/resume,
summaries, money-prompt queue + answers, high-volume notice); channel
subscription over the sessions' wallet channel keys, handle_channel event
serving, session-open announce, drain-on-resume via the frame heartbeat,
and money-answer draining wired into the service loop.
- lib.rs: PENDING_TRUST crate-root stash (set/take).
- dispatch: goblin:trust routed after authorize, before pay, in both the
deep-link and camera-scan dispatchers.
Adds the testable protocol core for the two-tier session signer:
- trusturi.rs: goblin:trust URI parser, fail-closed like login/authorize,
with sk (site channel key), r (relay hint), k (kind set) fields.
- session.rs: wallet-owned tier classifier (kind table + content
escalation for flagged conversation kinds), kind-set sanitation, the
kind-to-category display mapping, NIP-44 channel envelope shapes,
client-pinned created_at signer with skew guard, and per-session
enforcement (identity binding, replay dedup, size caps, rate limiting,
TTL/idle lifetime).
30 new unit tests; full lib suite green.
The live Goblin send UI guarded only on amount > spendable, so a send of
the whole balance was offered as valid with no room for the network fee.
The wallet then built a slate needing amount + fee but holding only amount,
so the send failed with NotEnoughFunds or sat unconfirmed.
GRIM's send modal reserves the fee: it refuses amount + fee > max and caps
its max at spendable - fee. Mirror that here. Both the amount screen and the
review page now price the exact amount (one CalculateFee per amount, as GRIM
does) and refuse the send unless amount + fee fits the spendable balance;
hold-to-send stays disabled until the fee is priced, so a full-balance
payment is never dispatched with no room for its fee.
Adds amount_fits / max_sendable helpers with unit tests covering the
send-max boundary.
Comments only, no behavior change: tag the five deferred audit findings at the
code they refer to so they are findable later. M5 (widen display escaping to
category-based) and M6 (template echo vs re-serialization) in authuri; L2
(redact secrets from Debug) at NostrIdentity; L3 (carry secrets as ZeroingString
end-to-end) at get_nostr_nsec; L4 (reset AdvancedState on back) in the goblin
on_back handler.
Copying a revealed nsec (or a post-rotation new key) left the secret sitting in
the clipboard indefinitely. Add copy_secret_to_buffer: it copies now and, after
a short delay, clears the clipboard only if it still holds exactly that secret
(compare-then-clear), so whatever the user copied since is never clobbered. Both
nsec copy sites now use it. Desktop clears through the long-lived clipboard owner
on a background thread; Android does the same over its JNI clipboard via the
established non-GUI app-handle pattern; other platforms fall back to a plain copy.
reencrypt_all was best-effort per file: a partial failure left some identities
on the old password and some on the new, a split the user cannot open with one
password. Make it all-or-nothing: stage every re-encryption to a sibling temp
file and only commit (rename into place) once every identity re-encrypts
cleanly; any phase-1 failure deletes the temps and leaves every identity on the
old password.
Surface the failure: change_password now returns a hard error when the
re-encryption fails instead of logging and reporting success.
Keep the running NostrService in sync after a successful change by refreshing
its in-memory identity blobs to the new password, so same-session gated ops
(which re-unlock with the new password) work without a wallet reopen. The
decrypted keys are unchanged by a password change, so listening and sending are
untouched. Adds an all-or-nothing test.
The login URI parser checked the callback scheme but not that its host belongs
to the displayed domain, so a site could show d=magick.market while pointing cb
at its own host and harvest a signed login event for a domain it does not
control. Apply the same domain binding the authorize URI already enforces:
share authuri's domain_bound as pub(crate) and reject a login URI whose callback
host is neither the domain nor a label-boundary subdomain of it. The
http://localhost dev callback stays exempt. Adds binding tests.
Add serde field defaults to every field of ProofAddrRegistry, HeldIdentities,
and HeldEntry so a file written by a different build parses instead of failing:
an unknown extra field is ignored and a dropped non-essential field falls back
to its default. The counter and version defaults are supplied by helper
functions so next defaults to 1 (never 0, which is the app's default address)
and ver to 1. This is parse-side only; the on-disk write path is unchanged.
Adds forward-compat tests for both registries.
The per-sale proof-address allocator did an unlocked read-modify-write of the
persisted counter, so two concurrent mints could read the same next index and
hand out the same derivation index, an address reuse that mis-addresses a
payment proof. Serialize the whole load-bump-persist behind a process-wide
lock so every index is unique.
Persist the counter atomically: write a sibling temp file in the same
directory, flush, then rename over the target, so a crash mid-write cannot
leave a torn file.
Refuse a corrupt registry: a file that exists but fails to read or parse now
returns an error instead of silently resetting the counter to 1 (which would
re-hand-out already-minted indices and reuse an address). Only a missing file
defaults to the fresh-wallet counter. Adds a concurrency test asserting unique
indices across racing threads, plus missing-vs-corrupt coverage.
goblin:authorize?e=<base64url template>&d=<domain>&cb=<https callback>&c=<64-hex nonce>
(and the nostr: QR twin) asks the wallet to sign exactly one Nostr event.
Fail-closed parser beside loginuri: strict three-key template (kind, content,
tags; any pubkey/created_at/id/sig injection rejects), kind allowlist 1/6/7/30023
(22242 only via login), 4096/2048 size caps, unpadded base64url only, delegation
tags rejected, and the new cb-host-must-belong-to-d binding. Approval modal
mirrors the 150 login machinery: Authorize <domain>? verb, plain-language kind
rendering, 240-char escaped preview with truncation marker and show-full view,
identity picker, wallet password gate, single pending request, 120 s expiry,
single-use. Wallet alone sets pubkey/created_at/id/sig, NIP-01 canonical only;
delivery POSTs {c, d, event} to cb with the shared HttpClient and 15 s timeout,
consumed regardless of outcome, quiet toasts. Dispatchers check authorize before
pay on both the deep-link and QR paths. goblin.authorize.* strings in all six
locales; 29 new authuri tests.
URI schema: pay/invoice URIs gain an optional `count=N` parameter
(goblin:<npub|nprofile>?amount=X&count=N[&memo=...]) asking the wallet to
issue N payment requests in one go. Default 1 when absent (single flow
unchanged), capped at MAX_BATCH_COUNT = 20, fail-closed to 1 on zero/garbage,
first occurrence wins — all payuri conventions, unit-tested.
A count>=2 deep link whose recipient is a direct key (npub/nprofile) with an
amount opens ONE batch-approval modal — "Approve N invoices", with the payer,
per-invoice amount, total, and memo — instead of the send flow. On approve,
the wallet mints N fresh per-sale proof addresses (Wallet::mint_proof_address;
a mint failure stops the batch, already-issued requests stand) and fires the
same NostrRequest task the single flow uses, once per invoice; the requests
appear in activity as they dispatch. Anything else (count on a name that
needs discovery, or no amount) degrades to the single flow with count
ignored. The minted address is recorded on each request's metadata
(TxNostrMeta::proof_address, serde-default None) so the per-sale machinery
can read it; WalletTask::NostrRequest gains the optional address and the
single flow passes None. New goblin.batch.* strings in all six locales.
App side of the index-0 unpinning. Wallet::mint_proof_address allocates the
next fresh derivation index from a persisted, never-reusing counter
(src/wallet/proof_addrs.rs; proof_addrs.json in the wallet dir — an index
carries no secret, the keys live in the wallet seed) and derives its
slatepack/proof address through the wallet's existing indexed derivation
(address_from_derivation_path), exactly as the app's default index-0 address
is derived. Index 0 stays the default app address; nothing changes for normal
receives. Allocation starts at 1, is monotonic and persisted before use (a
crash burns an index, never reuses one), and is capped at
MAX_PROOF_ADDRESS_INDEX = 1023 — the receive-side scan bound of the matching
grin-wallet submodule patch (kept as a local constant so this crate also
builds against the unpatched upstream submodule; the wallet-side patch, which
detects the addressed index on receive and signs the payment proof with the
matching key, lives in the wallet submodule on a local branch pending the
owner's decision on where that patch is pinned).
Tests: allocation monotonic + persistent from 1, refuses past the scan bound,
corrupt counter degrades to address reuse (the old single-address world),
never a fund risk.
The first-back pill now reads "Press back again to switch wallets"
(re-translated in all six locales) and is styled as a native quiet toast: a
solid soft pill with no border, small regular dim text — no accent colors,
nothing loud. No haptic on the back press (owner's call). Behavior unchanged.
At the wallet Home (the top level, where back was silently swallowed), the
first Android back now shows a brief non-blocking pill — "Press back again to
leave this wallet" — and a second back within two seconds DESELECTS the wallet
to the switcher. The wallet stays UNLOCKED (select(None)-style deselection, no
close, no logout), so returning is one tap and its nostr service keeps running
untouched. Quitting the app lives only at the switcher, via GRIM's existing
native exit-confirmation on back (unchanged). In-wallet sub-screens keep
normal back navigation, no hint. The second back never quits directly.
The hint is a bottom-anchored fading pill above the tab bar (goblin view),
armed by the host (WalletsContent::back_exit_at) in the swallowed-no-op
branch; nothing else about back handling changes. New goblin.home.back_again
string in all six locales; drift green.
MIN CONFIRMATIONS (GRIM parity): the wallet group in Settings gains a
"Minimum confirmations" row just below the Node row, showing the current value
(default 10) and opening a numeric edit modal ported from GRIM's
min_conf_modal_ui (same prompt/error strings, Cancel/Save, CenterTop). The
fork already carried the full backend — WalletConfig::min_confirmations with
MIN_CONFIRMATIONS_DEFAULT=10 and Wallet::update_min_confirmations — and the
value already feeds the spendable/send logic (retrieve_summary_info, send and
receive params) plus the GUI confirmation counts via
data.info.minimum_confirmations, so this only exposes the existing knob.
INTEGRATED NODE -> ADVANCED: the integrated-node tabs (info, metrics, mining
with stratum, node settings) leave main Settings — Goblin is the lighter
client. Their ONE home is now Settings -> Advanced, as a second action on the
"Run your own node" card (live sync status in the label when the node runs),
with back returning to Advanced. The duplicate entry on the node-connection
page is removed too, per the single-home rule; all functionality is kept.
The add sheet's "Generate new" was a mode toggle that set import=false — the
mode the sheet already opens in — so it read as a completely dead button, and
the four-button layout (Generate new / Import / Cancel / Add) mixed two silent
mode toggles with two actions.
The sheet now DEFAULTS to generate mode with a one-line note saying a fresh
anonymous key will be created; the standalone "Generate new" button is gone.
One clear toggle sits above the action row and always names the OTHER mode:
"Import an existing identity instead" switches to import mode (revealing the
.backup picker and nsec paste inputs), where it becomes "Create a new key
instead" to switch back. The action row stays exactly Cancel + Add — Add
creates a fresh identity in generate mode and imports in import mode — keeping
the 147 modal-lock, uniform-button and CenterTop conventions. The old
generate/import toggle labels are removed from all six locales and the new
generate_note / import_instead / generate_instead strings added; drift green.
MANAGE SHEET IS A TRUE MODAL: the pencil now opens the per-identity management
sheet through the GRIM Modal system (like the password modal), which dims and
locks the identity list behind it — switching and row taps are disabled until
it closes, killing the bug where the active identity could be switched while a
manage sheet was open for a different one. The modal is titled with the
identity it manages (display precedence: private tag, else bare name, else
truncated npub). The step-1 delete confirmation moved into a modal too (same
standard: a sheet acting on a specific item locks its background), also titled
with the identity, chaining into the wallet-password modal as before.
UNIFORM PAIRED BUTTONS: every paired action row in the identity sheets now
renders one consistent widget per row. In modals both halves are the GRIM
modal button (Cancel/Save; Cancel/Delete with Delete carrying only the red
color at the same size and shape). The in-page add panel's Cancel/Add row —
which mixed big_action_on_card with the 56px big_action inside 44px halves —
now uses big_action_on_card_ink for both, matching the Generate/Import toggle
(the reference pattern); the disabled Add state dims its ink. Audited the rest
of the new identity UI: the toggle row was already uniform and the remaining
buttons are full-width singles.
Root cause found by diffing against upstream GRIM, which does not have the
bug: GRIM gives every ScrollArea a distinct id_salt (e.g. "wallet_list_scroll",
"wallet_tab_content_scroll"); our goblin surface created fifteen unsalted
ScrollArea::vertical() — Settings Main and every settings sub-page render
theirs at the same position in the same parent Ui, so they all resolved to the
SAME egui scroll-state id. Scroll offset and remembered content extents
collided across pages, clamping the Settings list's maximum scroll to another
(shorter) page's extent: the page stopped scrolling before its real end and the
bottom items — including the wallet-management foot (Switch wallet / Lock /
Advanced), i.e. the way out — were unreachable on the phone. This one root
cause covers both user reports ("Settings bottom cut off" and "can't exit").
Every goblin ScrollArea now carries a unique id_salt, matching GRIM's
convention, so each page keeps its own scroll state and traverses to its true
bottom. Back-press behavior is deliberately untouched.
The top-of-page identities copy now says what identities ARE in end-user
terms — the names you get paid under, all paying into this one wallet — and
what you can do (add, switch, remove). No protocol jargon.
PRIVATE TAG: a local, app-only name the user gives an identity. Stored as
NostrIdentity.private_tag in its 0600 identity file (serde-default; it also
rides inside the NIP-44-sealed .backup envelope, which serializes the whole
struct, and is restored on backup import). NEVER published — kind-0 metadata is
built only from the claimed NIP-05 name, untouched. Display precedence
everywhere an identity is shown (switcher rows, delete confirm, transaction-
detail attribution): private tag, else claimed name (bare, no @), else
truncated npub (HeldIdentitySummary::display).
ROW UX: identity rows show the label with a checkmark on the active one; TAP =
instant switch (unchanged). A small pencil affordance per row opens a
management sheet: Rename (set/clear the private tag; saves via
Wallet::rename_nostr_identity, which persists the file and updates the running
service in place — no password needed, the ncryptsec is untouched) on top, and
Delete at the bottom, visually separated and destructive-styled, feeding the
existing double gate (danger card, then the wallet-password modal). Delete only
renders while more than one identity is held. New strings in all six locales.
DELETE: each held identity row gains a trash affordance. Step 1 is a danger
card naming the identity, stating the removal is PERMANENT and prominently
reminding the user to back it up first (unrecoverable without its nsec or
.backup); step 2 is the existing wallet-password modal, which executes
Wallet::delete_nostr_identity. Delete drops the entry from the held-identity
index, removes its on-disk encrypted file, and rebuilds the service without it,
so its pubkey leaves the multi-pubkey gift-wrap subscription and its key leaves
the unlocked in-memory set. The shared balance and all other identities are
untouched. Edge cases: the LAST identity can never be deleted (the trash only
renders with more than one held); deleting the ACTIVE identity promotes a
survivor to active first; deleting the legacy primary (identity.json) promotes
a survivor INTO identity.json so init_nostr's fallback and an older build's
rollback anchor still resolve, never leaving a hole that would mint a fresh key.
IMPORT: the add panel's "Import nsec" is now just "Import" and offers both a
.backup file picker and a paste-an-nsec field. The .backup path reuses the same
from_encrypted_backup + re-encrypt-under-this-wallet's-password flow as the
existing identity import (name and history restored), through the same NIP-49
encrypted store; the pasted-nsec path is unchanged. New strings in all six
locales; drift green.
Rewrites the identity blurb to say all identities receive into the one balance
at once (switching only chooses which you present and send as), and removes the
privacy note's claim that switching or a shared balance lets a relay link your
identities — the wallet's Tor transport is the answer to that, and the framing
is not something we assert. Drops the now-unused sync-flow strings (syncing,
caught_up, paid_while_away, need_password) across all six locales; drift green.
Reworks the multi-identity model. When the wallet is unlocked, EVERY held
identity's nsec is decrypted into memory (unlock_all_identities), and the
service listens for gift wraps addressed to ALL of them at once, each redeeming
into the one shared balance. Switching is now an instant, purely-local change of
which identity is presented and used for sending — no password, no service
teardown, no catch-up.
How receives stay deduped across all identities: a SINGLE gift-wrap subscription
with a multi-pubkey filter (OR over #p) and a SINGLE sequential notification
handler. Each wrap is p-tagged to exactly one identity, so it arrives once and is
processed once through the unchanged processed-set — dedup is exactly as safe as
the single-identity path, with no concurrent wrap processing. handle_wrap opens
each wrap by trying each held key until one succeeds; that key is the recipient
identity, recorded as the tx's recipient_pubkey. publish_identity now advertises
every held identity's DM-relay list (and profile, if named), each signed with its
own key, on the shared relay set.
NostrService holds all identities (recv) plus the active keys/identity (swapped
in place on switch); the switch-sync signals (is_switch_syncing/switch_received
and the "Syncing/Caught up/You were paid while away" flow) are removed — there is
nothing to catch up. The password modal remains only for add/import; the Build
144 import button and modal-position fixes are kept. init/add/import/rotate
rebuild the service with all identities; a plain switch does not.
Per-identity Tor-circuit isolation is deferred: all identities share the wallet
relay set for now.
- Import/Generate toggle: constrain each button to half the panel width, like the
Cancel/Add row. big_action_on_card_ink sizes to ui.available_width(), so in the
toggle's horizontal the first button ate the whole width and the Import button
overflowed the card. Now two equal-width in-panel buttons that match the panel's
other actions.
- Password modal: open it at ModalPosition::CenterTop (the project convention for
text-input modals, e.g. the send-note and wallet-settings modals) instead of the
default vertical center, so on mobile it sits above the soft keyboard.
- Password entry is now a MODAL popup mirroring the wallet-open password modal
(Modal + explanation + masked field + wrong-password line + Cancel/Continue),
used as the unlock step for BOTH switching and adding. The inline page-top
password field is gone; tapping a held identity opens the modal to unlock and
switch, and Add opens it to encrypt+store. A correct password is verified
synchronously so a wrong one stays in the modal.
- Add no longer force-switches into the new identity ("Add and switch" -> "Add");
it is added to the held set and the user activates it later via tap -> modal.
This also removes the switch-triggered publish from the create path, so
creating an identity only generates a fresh anonymous key and stores it
encrypted (no name lookup/claim).
- Fixes the import-nsec flow. Root cause: the required password lived in a page-
top field disconnected from the Add card, so the confirm button's armed gate
stayed disabled unless that separate field was filled — import (and generate)
read as inert. Moving the password into the modal removes the disconnected
gate; the underlying add_nostr_identity(Some(nsec)) path was already sound
(covered by the new regression test).
- Usernames render WITHOUT a leading "@" (project convention), in the switcher
and the transaction-detail identity row; unnamed identities show a truncated
npub. New add_confirm/pass_prompt strings in all six locales (drift green).
- No "Primary" (or any placeholder) label: label_for now yields the claimed
name's local part or EMPTY, never a placeholder word. The UI derives its
display from the name or a truncated npub, so an unnamed identity is shown by
its npub, never "Primary".
- Add Wallet::verify_nostr_password so the identity password modal can reject a
wrong password up front (in-memory NIP-49 unlock of the active identity),
matching the wallet-open modal, before spawning an add/switch worker.
- Regression test: importing a bare nsec adds it as a held identity via the same
NIP-49 encrypted store, keyed by its own pubkey, openable under the wallet
password, with the active pointer unchanged (add never switches).
Turn the per-identity activity cue on (SHOW_ROW_IDENTITY_CUE = true) and render
it as the owner-approved corner badge. The row's main avatar stays the
COUNTERPARTY; overlaid on its bottom-right corner is a small ~14px badge filled
with the USER's OWN identity gradient for that transaction (from
ActivityItem.owner_pubkey via the exact identicon gradient math, falling back to
the primary identity for pre-feature rows), so a glance clusters which of your
identities each payment used. Shown only when the wallet holds more than one
identity, never on system (mining) rows.
The badge is a true smooth rotated linear gradient (an egui mesh reproducing the
avatar's SVG gradient, not a flat chip) at 0.9 fill opacity, with a 1px
theme-aware hairline ring (near-black on light, near-white on dark) so it stays
legible on both pure-white and pure-black and against the avatar it sits on.
identity_dot is now the single gradient renderer, shared by the row badge and
the transaction-detail legend.
The transaction detail's Identity row now carries a small two-tone gradient dot
in that identity's OWN gradient, drawn with the exact identicon math
(gradient_rgb8, refactored out of gradient_params so the dot matches the
identity's avatar everywhere). The dot is theme-aware and deliberately quiet: a
faint fill plus a faint ring that stays legible on both light and dark
backgrounds without becoming a bright chip.
A per-row cue in the activity list is intentionally OFF (SHOW_ROW_IDENTITY_CUE
= false): on a row the avatar is the counterparty, so a gradient dot there is
both redundant with that avatar and does not tell the user which of their OWN
identities was used. The plumbing (the seam const, a per-frame identity context,
ActivityItem.owner_pubkey recording the tx's owning identity) is kept so a
proper own-identity cue can be added later in one place, but it renders nothing
now. The switcher page and profile card already show the active identity via its
own gradient avatar and name.
The transaction receipt now has an Identity row telling the user which of the
wallet's held nostr identities was active when that payment was received or
sent. It uses the identity recorded on the transaction (TxNostrMeta's
recipient_pubkey), not a reconstruction, and falls back to the primary
identity for pre-feature rows. It shows the NIP-05 name when the identity has
one (any domain), otherwise a truncated npub, and is always shown on the
detail view (no clutter there whether the wallet holds one identity or many).
The activity list rows are unchanged. New goblin.receipt.identity string added
in all six locales.
A swap glyph (phosphor arrows-left-right) sits top-right of the Settings
profile row and opens a dedicated identity switcher page. The page lists the
held identities with the active one checked, tap a non-active one to switch,
and adds a new identity by generating a fresh nsec or importing an existing
one, then switches to it. One shared wallet-password field unlocks a target
on switch and encrypts a new identity on add; it is cleared from memory when
the page closes. A syncing then "caught up" / "you were paid while away"
banner reflects the switch catch-up (the count honors hide-amounts). Android
back and the back button return to Settings.
The active identity drives the single live gift-wrap subscription and every
send/display, and every identity redeems into the ONE shared grin balance.
Switching reuses the rotate/import stop-wait-start machinery: it verifies the
wallet password by unlocking the target BEFORE any teardown (a wrong password
never strands the wallet with no running identity), gates on no in-flight
send, tears down the service and stands a fresh one on the target key against
the SAME shared store (so processed-dedup carries across and nothing double
redeems), and moves only the active pointer (identity.json is never
overwritten). The catch-up now looks back from when THIS identity last
listened, so a payment that arrived while it was dormant is fetched and
redeemed on switch-in; the service surfaces a syncing state and a count of
payments redeemed during that catch-up for a "you were paid while away" cue.
TxNostrMeta gains recipient_pubkey (serde-default empty = primary) to tag
which front door a payment used, for per-identity activity and a later
accounting split. Wallet gains nostr_identities / add_nostr_identity /
switch_nostr_identity, init_nostr adopts the held-identity index with legacy
migration, and a wallet-password change now re-encrypts every held identity
through the same NIP-49 path. Only the active nsec is ever decrypted in
memory; the rest stay encrypted at rest.
One wallet, one grin seed / one balance, but a SET of nostr identities
(nsecs), exactly one active at a time. New identities module owns the
held-identity index (identities.json): which identities the wallet holds,
their order, and which is active. It stores no secrets; each held identity
is its own NIP-49 ncryptsec on disk, exactly like the single identity today
(identity.rs create/unlock/backup reused unchanged, plus save_at/load_at for
the per-identity files and pubkey_hex for the index key).
Migration is fund-safe and needs no key regen: a pre-feature wallet has only
identity.json, which the index adopts in place as the single active identity
number one; the legacy file is never overwritten, so an older build still
opens the wallet on it (clean rollback). The store gains a per-identity
last_active_at so a switch back to a dormant identity can catch up from when
it last listened, not merely from the wallet-wide last connection.
Unit tests cover migration, add/switch/cap/dedupe, active resolution across a
reload, corrupt-index fallback, reencrypt-all, and the catch-up-since rule.
Repoint the changelog modal's third button to https://docs.goblin.st
(the docs/reference destination; GitHub button already covers source)
and swap its code-brackets glyph for the BOOK icon so it reads as a
docs link. Rebrand the startup version-announcement log line from
"Grim" to "Goblin".