Repository navigation
Description
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-sdkplatform::dashpay::private_contact_request::private_contact_request_signing_keysreturns the eligible keys in key id order, and its doc says "A wallet signs with the first its signer holds".rs-platform-walletwallet/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
- feat(platform-wallet): send, receive and accept DashPay private contact requests #5810 added private contact requests, including this picker.
- feat(platform-wallet)!: expose protocol-14-aware signing-key selection #5588 unifies the wallet's signing-key selection; it lists this path as a known limitation and does not change it.
Attribution
🤖 Co-authored by Claudius the Magnificent AI Agent
Activity