Skip to content

Shielded tips in the example apps: restart-safe submission and identity-scoped source account #5674

Done

Description

@PastaPastaPasta

Problem

Two gaps in the shielded-tip flows of the example apps, raised in review of #5288 and left out of it to keep that PR's scope bounded:

  1. A restart can repeat a tip. ShieldedTipSubmission (Swift) and ShieldedTipSubmissions (Kotlin) keep their "a tip is in flight / its outcome is unknown" guard in memory only. After the app is killed during a broadcast, or after an uncertain result, a relaunch starts in the ready state. The native send reserves notes, not a payment intent, so a retry can spend other notes and pay the recipient twice. (thread)
  2. A re-slot can change which account pays. The Kotlin tip sheet captures the source account before an awaited preferences write. If discovery re-slots the selected identity during that window, the send still uses the old slot's tip account. verify_tip_account_owner only proves the account is wallet-owned, not that it belongs to the identity the user picked, so the wrong pool can pay. No funds leave the wallet. (thread)

Possible fixes

  1. Persist an outstanding tip intent before calling the native send, restore it as unresolved on launch, and reconcile it against shielded activity before allowing another send. Test it by recreating the process after an accepted-but-unconfirmed send while other spendable notes exist.
  2. Pass the expected source identity through the native tip send (Rust, C FFI, JNI, Swift, Kotlin) and check its seed-verified slot right before note selection. Keep an explicitly account-based path for deliberately spending a retired account.

Activity

  1. PastaPastaPasta commented on Oct 29, 2026

    @PastaPastaPasta
    MemberAuthor

    Also in scope: prepare_shielded_tip_address checks the identity's index under the wallet-manager read guard, then releases it before taking shielded_config_lock and binding. A re-slot in between binds and returns the old slot's address, and a later profile write can publish it. (thread)


    🤖 Posted autonomously by Claude on behalf of pasta.

  2. added a commit that references this issue on Nov 1, 2026
    3dc04f1
  3. QuantumExplorer commented on Nov 24, 2026

    @QuantumExplorer
    Member

    Status: #5288, #5709 and #5711 are closed, and shielded tips are rebuilt on v5.1-dev. Both points of this issue are covered there:

    The app side is in #6198 (SwiftExampleApp) and #6197 (KotlinExampleApp), on the wrappers in #6192. This issue can close once those four merge.

    🤖 Posted by Claude Code

  4. QuantumExplorer commented on Nov 24, 2026

    @QuantumExplorer
    Member

    Closing: #6191, #6192, #6198 and #6197 are all merged into v5.1-dev, so both points of this issue are in. The tip rows have not been run on a device or a network yet; any problem a run finds gets its own issue.

    🤖 Posted by Claude Code

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