Skip to content

feat(key-wallet): add missing DIP-15 derivation constants to dip9#886

Merged
shumkov merged 2 commits into
devfrom
feat/dip9-auto-accept-feature-const
Jul 14, 2026
Merged

feat(key-wallet): add missing DIP-15 derivation constants to dip9#886
shumkov merged 2 commits into
devfrom
feat/dip9-auto-accept-feature-const

Conversation

@shumkov

@shumkov shumkov commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Every other DIP-9-family feature index (identities 5' with its sub-features, coinjoin 4', dashpay 15', platform payment 17') is defined in key_wallet::dip9, but two DIP-15 derivation families were never added:

  • the auto-accept feature 16'm/9'/coin_type'/16'/expiry', the expiry-bounded bearer keys behind the DashPay auto-accept QR (dapk);
  • the contactInfo hardened children — root/65536'/index' (encToUserId) and root/65537'/index' (privateData) under the owner's identity-authentication path.

As a result, downstream consumers in dashpay/platform carry their own copies today: rs-platform-wallet (crypto/auto_accept.rs local const, crypto/contact_info.rs named consts) and rs-sdk-ffi's resolver signer (raw 16/65536/65537 literals — it cannot import platform-wallet). Duplicated magic numbers for canonical derivation constants are exactly what dip9 exists to prevent (noticed while fixing the same issue for the invitation constants in dashpay/platform#4041).

What was done?

Added to key-wallet/src/dip9.rs, beside their siblings, each with a doc comment describing the derivation family:

  • FEATURE_PURPOSE_DASHPAY_AUTO_ACCEPT: u32 = 16
  • DASHPAY_CONTACT_INFO_ENC_TO_USER_ID_CHILD: u32 = 1 << 16
  • DASHPAY_CONTACT_INFO_PRIVATE_DATA_CHILD: u32 = (1 << 16) + 1

No behavior change — documented constants only. The dashpay/platform call sites will switch to them on their next rust-dashcore bump.

How Has This Been Tested?

cargo check -p key-wallet + cargo fmt clean; additive constants only, no runtime paths touched.

Breaking Changes

None (additive).

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests (n/a — documented constants)
  • I have made corresponding changes to the documentation if needed

🤖 Generated with Claude Code

Every other DIP-9-family feature index (identities 5' with its
sub-features, coinjoin 4', dashpay 15', platform payment 17') is defined
in key_wallet::dip9, but the DIP-15 auto-accept feature 16'
(m/9'/coin'/16'/expiry', the expiry-bounded bearer-key family behind the
DashPay auto-accept QR) was never added. Downstream consumers — the
platform wallet's auto_accept_derivation_path and the FFI resolver
signer's raw-key export gate in dashpay/platform — each carry their own
local `16` literal as a result.

Define FEATURE_PURPOSE_DASHPAY_AUTO_ACCEPT = 16 next to its siblings so
those call sites can reference the canonical constant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@shumkov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b1e0c652-2897-4b37-bb5b-3206baf3571d

📥 Commits

Reviewing files that changed from the base of the PR and between 2045cd2 and 6ab1ac0.

📒 Files selected for processing (1)
  • key-wallet/src/dip9.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dip9-auto-accept-feature-const

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.33%. Comparing base (2045cd2) to head (6ab1ac0).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #886      +/-   ##
==========================================
- Coverage   74.37%   74.33%   -0.04%     
==========================================
  Files         327      327              
  Lines       74747    74747              
==========================================
- Hits        55590    55563      -27     
- Misses      19157    19184      +27     
Flag Coverage Δ
core 77.26% <ø> (ø)
ffi 50.31% <ø> (ø)
rpc 20.00% <ø> (ø)
spv 90.96% <ø> (-0.16%) ⬇️
wallet 74.40% <ø> (ø)
Files with missing lines Coverage Δ
key-wallet/src/dip9.rs 6.38% <ø> (ø)

... and 5 files with indirect coverage changes

Same gap as the auto-accept feature: the DIP-15 contactInfo hardened
children (encToUserId = 65536', privateData = 65537' under the identity-
auth root) had no canonical constants, so dashpay/platform carries them
twice — named consts in rs-platform-wallet's crypto/contact_info.rs and
raw 65536/65537 literals in rs-sdk-ffi's resolver signer (which cannot
import platform-wallet). Define them beside the other DIP-15 constants.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shumkov shumkov changed the title feat(key-wallet): add the DIP-15 auto-accept feature constant to dip9 feat(key-wallet): add missing DIP-15 derivation constants to dip9 Jul 14, 2026
@shumkov shumkov merged commit ac8828c into dev Jul 14, 2026
36 checks passed
@shumkov shumkov deleted the feat/dip9-auto-accept-feature-const branch July 14, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant