Skip to content

Let the wallet choose which Core or Platform address a profile publishes #6164

Backlog

Description

@QuantumExplorer

What happens

A DashPay profile can publish a Core and a Platform payment address (#6124). When a host app wants to offer one of the wallet's own addresses for this, it has to choose the address itself:

  • Core: SwiftExampleApp calls nextReceiveAddress(accountIndex: 0). The account is hard-coded in Swift, and the call returns the next unused receive address without reserving it. Until that address receives a payment, the same address is offered again, so the profiles of two identities of one wallet can end up publishing the same address. One address in two profiles links them.
  • Platform: the app used to pick the lowest unused address from its SwiftData mirror, across accounts, without consulting the live pool. feat!: set, change and remove DashPay profile payment addresses in SwiftExampleApp #6094 removes that button; the field is typed or pasted only until the wallet can supply an address.

Which account to use, whether an address already published for another identity may be reused, and how a published address is marked so it is not handed out again are wallet decisions. They should not be made in each host app.

What is wanted

An identity-scoped operation in platform-wallet, for example profile_payment_address_candidate(identity_id, kind), that:

  • resolves the wallet that owns the identity and uses its live pools;
  • returns an address for the identity's profile, with a stated rule on reuse (for example: never an address another identity's profile of this wallet publishes or was offered);
  • records the offer or the publication so the next call differs.

FFI, Swift and Kotlin wrappers then only pass the result to the editor. SwiftExampleApp restores the Platform "use this wallet's address" button on top of it, and drops its own account choice for Core.

Raised by the review of #6094: #6094 (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