Skip to content

Shielded tip from a contact: check that the username still belongs to that contact #6200

Done

Description

@QuantumExplorer

Problem

A tip opened from a saved DashPay contact passes only the contact's DPNS name to the wallet (review_shielded_tip / send_shielded_tip take a username). If that name has since moved to another identity, the wallet correctly resolves it to the new owner. On a first tip to that name, the review reports New with no warning, so the sender can pay an identity that is not the contact they picked.

Found in review of #6197 (KotlinExampleApp tip screens). The Swift tip screens have the same entry point.

Proposed fix (wallet, not the hosts)

Let the review and the send take an optional expected recipient identity (the contact's id). Rust refuses with a typed error when the name resolves to a different identity. Hosts pass the contact id when the tip starts from a contact and nothing when the user typed a name. The comparison lives in platform-wallet (wallet/shielded/tip_payment.rs), with the FFI, JNI, Swift and Kotlin wrappers marshalling the extra argument.

Test: a name that moved to another identity before the first tip from a contact is refused at review and at send; a typed name is unchanged.

Until then

The hosts show the resolved recipient's identity id on the review. Neither app compares it with the contact, because that check is a wallet rule.

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