Skip to content

A profile write does not recognise a shielded address of an account the wallet has not bound #6140

Open

Description

@QuantumExplorer

What happens

PlatformWallet::write_dashpay_profile refuses to publish a shielded address that belongs to this wallet, unless it is the identity's own prepared account (check_shielded_address_publication, added in #6124). It tells the wallet's own addresses by the viewing keys of the shielded accounts that are bound now (shielded_keys).

An account of the same seed that is not bound is therefore not recognised, and its address passes as another wallet's would:

  • an ordinary account that was bound and then left out of a later bind (bind [0, 1], then bind [0]: account 1's address is accepted);
  • an account bound in an earlier session and not in this one;
  • an account that was never bound.

Publishing such an address ties that account's funds to the identity, which is what the rule is meant to prevent.

Why it is not fixed in #6124

The profile write has no seed, so it cannot derive the accounts it does not hold. Recognising them needs a source of ownership keys that outlives the bound set, for example the persisted viewing keys the host already stores per account, read at check time and kept apart from scan registration. That is a design choice of its own and wider than carrying the profile fields.

The user has to paste the address by hand to reach this: the example app's "use my shielded address" button only offers the prepared address.

Possible fix

Check the address against every viewing key persisted for this wallet, not only the bound ones, before treating it as another wallet's. Accounts never bound in any session would still not be recognised without the seed.

Raised by CodeRabbit on #6124: #6124 (comment)

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