Skip to content

platform-wallet: check the entered recipient of a self-shield (types 15 and 21) in the wallet, not in the example apps #6158

Open

Description

@QuantumExplorer

platform_wallet_manager_shielded_shield (type 15) and platform_wallet_manager_shielded_shield_from_identity (type 21) take no recipient and always pay shielded account 0's default Orchard address. Both example apps let the user type a recipient in the Send flow and compare it with the wallet's own address in the view (Swift SendViewModel.selfShieldRecipientProblem; Kotlin SendTransactionScreen, shared helper since #6147), so the destination the user approves is never seen by the code that builds the note.

A failed host check cannot misdirect funds (the note always lands on the wallet's own address), but the restriction is app policy living in two hosts. Fix: pass the expected recipient through FFI/JNI and have rs-platform-wallet refuse a mismatch against the same account keys it builds the note with (resolve_shield_recipient), or make the destination read-only in both apps. Then delete both host copies.

Design it alongside the _to_recipient variants on 5.2 (#5863, #5896). It must not enable third-party shielding on 5.1.

Raised in review of #6147.

Activity

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