Skip to content

platform-wallet: a shielded Clear followed by a restart stops scanning the tip account of an identity removed from the device #6306

Backlog

Description

@QuantumExplorer

What happens

A wallet scans one shielded account per identity (the identity's tip account, shielded_identity_account_index). When an identity is removed from the device while its profile still publishes that account's address, the account keeps scanning because its persisted viewing key row records the account index: a bind adds every identity account that has a row.

A shielded Clear deletes the viewing key rows (it has to: Clear is the recovery for an account whose stored key no longer matches the seed). After #5934 the bind that follows a Clear in the same process still adds the account, because the wallet handle keeps its keys across a Clear. Two cases are not covered:

  • the process ends between the Clear and the next seed bind;
  • the Clear runs on a handle that never installed keys in this process (a cold-start bind that failed, which is one reason a user runs Clear).

In both, the next bind no longer adds the removed identity's account, so tips sent to its still-published address are not scanned.

Impact

No funds are lost. The account is derived from the seed, and once the identity is back on the device the bind adds its account again and the scan starts from zero, so tips received meanwhile are found. Neither example app shows a removed identity's shielded balance in the meantime. An identity comes back by user action (wallet search), not by itself.

On v5.2-dev before #5934 the Kotlin app kept viewing key rows across a Clear, so this is new there. The Swift app already deleted them on every Clear.

Proposed fix

Keep only the account indices, in Rust's own shielded store file, in a table a Clear keeps and a wallet removal drops (as shielded_tip_recipients is kept):

  • in NetworkShieldedCoordinator::clear_admitted, before the reset, record (wallet_id, account_index) for the identity accounts in the coordinator's registry and in a best-effort host.load(). A failed load is logged and does not stop the Clear; a failed write aborts the Clear with nothing reset, as the pending-wipe mark does;
  • the coordinator loads the rows into memory when it is built, and bind_shielded_locked reads that copy, so the bind path takes no store lock;
  • this replaces the handle fallback added in fix(platform-wallet): own the shielded coordinator and wipe host rows inside Clear #5934.

Test: bind with a row for a removed identity's account, Clear, build a fresh wallet handle and coordinator on the same store file, bind from the seed, and assert the account is registered and its row written again.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    e33a2f3
  2. QuantumExplorer commented on Nov 25, 2026

    @QuantumExplorer
    MemberAuthor

    Fixed in #5934 (e33a2f3), with one change from the design above: the account numbers are recorded when a wallet's accounts are registered, not at Clear time from a host load. A registration writes the identity accounts not kept yet and takes no store lock when it adds none, so Clear gains no host call and no new way to fail. The coordinator holds the copy a seed bind reads.

    Left open: a wallet whose only binds since that change failed before they registered has nothing recorded, so a Clear in that state still stops scanning a removed identity's account until the identity is back on the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions