Skip to content

fix(platform-wallet): private contact requests sign with the first key by id instead of the shared key rule #5960

Open

Description

@Claudius-Maginificent

TL;DR: Sending a private contact request signs with the first eligible identity key by key id, so the wallet may ask for the strongest authentication or use a budgeted application key for a routine write.

User story

As a DashPay user, I want sending a private contact request to sign with the same key a public contact request would use, to avoid an unnecessary strong-authentication prompt and to keep application keys with a budget for the apps they belong to.

Scenario

Base flow

An identity has the usual key layout (key 1 CRITICAL, key 2 HIGH, both AUTHENTICATION), and possibly an application key with a budget or an expiry. The user sends a private contact request from the wallet.

Actual behavior

The wallet signs with the first eligible key in key id order. With the usual layout that is the CRITICAL key, so the user may be asked for stronger authentication than the write needs. A key with a budget or an expiry can be chosen even when an unlimited key qualifies. When no key qualifies, the error is a plain InvalidIdentityData string instead of a typed error.

Expected behavior

The private send chooses its key by the same rule as the wallet's other document writes: the weakest level the document type accepts, unlimited keys before limited ones, and a typed "no usable signing key" error when nothing qualifies.

Detailed discussion

  • rs-sdk platform::dashpay::private_contact_request::private_contact_request_signing_keys returns the eligible keys in key id order, and its doc says "A wallet signs with the first its signer holds".
  • rs-platform-wallet wallet/identity/network/private_contact_requests.rs (around line 1673) does exactly that: first_available(private_contact_request_signing_keys(..)).
  • The wallet already has a better picker for document writes, key_selection::usable_authentication_key (unlimited keys first). The private send does not use it.

Proposed fix: the SDK helper decides only which keys are eligible and does not prescribe an order. The wallet chooses among them with its shared picker, scoped to DashPay's private contact request document type. Consensus is unaffected, because the SDK eligibility filter still applies. This should land after #5588, which moves the wallet's key pickers onto one rule; there it is a small change.

Prior work

Attribution

🤖 Co-authored by Claudius the Magnificent AI Agent

Activity

  1. added
    bug
    on Nov 17, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions