Skip to content

refactor: backport rust-bitcoin#5680, drop unconstructed Ed25519 error variants, reap base58 module, tidy base64 dep - #1053

Merged
ZocoLini merged 11 commits into
dashpay:devfrom
kwvg:pkc_ecdsa
Sep 24, 2026
Merged

ZocoLini merged 11 commits into
dashpay:devfrom
kwvg:pkc_ecdsa

Conversation

@kwvg

@kwvg kwvg commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Additional Information

PR Hygiene · a03df50

  • Bots — coderabbitai ✓
  • Self-review — posted; again after any push
  • Within your 5 open PRs
  • Build green
  • Approvals
    • files with no dedicated owner (crypto/Cargo.toml, crypto/src/ecdsa.rs, crypto/src/key.rs and 22 more) — QuantumExplorer or ZocoLini or xdustinface
    • key-wallet (key-wallet/Cargo.toml, key-wallet/src/bip32.rs, key-wallet/src/dip9.rs and 1 more) — QuantumExplorer or ZocoLini or xdustinface

When every box is checked the PR Hygiene check passes and this can merge.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: dashpay/rust-dashcore/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 590d4aec-70e5-453e-b708-c2278ed278b3

📥 Commits

Reviewing files that changed from the base of the PR and between af82e1d and a03df50.

📒 Files selected for processing (27)
  • crypto/Cargo.toml
  • crypto/src/ecdsa.rs
  • crypto/src/key.rs
  • crypto/src/lib.rs
  • crypto/src/serde_utils.rs
  • crypto/src/sighash.rs
  • crypto/src/taproot.rs
  • dash/Cargo.toml
  • dash/src/address.rs
  • dash/src/base58.rs
  • dash/src/blockdata/script/owned.rs
  • dash/src/blockdata/script/push_bytes.rs
  • dash/src/blockdata/transaction/special_transaction/provider_registration.rs
  • dash/src/blockdata/transaction/special_transaction/provider_update_registrar.rs
  • dash/src/crypto/key.rs
  • dash/src/crypto/mod.rs
  • dash/src/crypto/sighash.rs
  • dash/src/hash_types.rs
  • dash/src/lib.rs
  • dash/src/serde_utils.rs
  • dash/src/sign_message.rs
  • dash/src/taproot.rs
  • key-wallet-ffi/src/special_payload.rs
  • key-wallet/Cargo.toml
  • key-wallet/src/bip32.rs
  • key-wallet/src/dip9.rs
  • key-wallet/tests/derivation_tests.rs
💤 Files with no reviewable changes (1)
  • dash/src/base58.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds key and sighash APIs to dashcore-crypto and updates dash to use them. It also updates Base58 and Base64 integrations, and adds key-wallet derivation-path constructors for payment, identity, asset-lock, and DIP-13 application paths.

Changes

Crypto API extraction and integration

Layer / File(s) Summary
Add crypto types and implementations
crypto/Cargo.toml, crypto/src/*
The crypto crate adds public key, private key, hash, tweaked-key, and sighash types. It adds serialization support and exports the new modules and dependencies.
Route dash APIs through dashcore-crypto
dash/src/base58.rs, dash/src/lib.rs, dash/src/crypto/*, dash/src/hash_types.rs, dash/src/address.rs, dash/src/blockdata/script/*, dash/src/taproot.rs
dash re-exports crypto types and Base58 from dashcore-crypto. It updates address parsing errors, hash types, serialized-signature conversion, and Taproot tweaking.
Update encoding and downstream consumers
dash/Cargo.toml, dash/src/sign_message.rs, dash/src/blockdata/transaction/special_transaction/*, dash/src/serde_utils.rs, key-wallet/Cargo.toml, key-wallet/src/bip32.rs, key-wallet-ffi/src/special_payload.rs
Base64 calls use the engine API, and Base58 calls use the renamed crate dependency. Tests and consumers replace PubkeyHash hex helpers with string parsing or formatting. The combined serde macro is removed.

Wallet derivation paths

Layer / File(s) Summary
Define and re-export derivation enums
key-wallet/src/dip9.rs, key-wallet/src/bip32.rs
KeyDerivationType and ApplicationKeyPurpose are defined in dip9.rs and re-exported from bip32.rs.
Add derivation-path constructors
key-wallet/src/dip9.rs, key-wallet/tests/derivation_tests.rs
DerivationPath gains constructors for BIP-44, CoinJoin, identity, asset-lock, and DIP-13 application paths.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Refactor

Suggested reviewers: quantumexplorer

Merge Risk: ⚪ Minimal · up to a03df

This refactor moves key, sighash, and Base58 handling into the shared crypto crate, updates the Base64 dependency, and relocates existing wallet derivation-path helpers without changing the paths they produce. No behavior regressions were identified, and the change looks ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 119 functions across 23 files. (3 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main refactoring work: the rust-bitcoin backport, removal of unused Ed25519 error variants, deletion of the base58 module, and the base64 dependency update. It is s…
Full details: Docstring Coverage

Explanation

Docstring coverage is 45.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 119 functions across 23 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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 Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.68670% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.45%. Comparing base (65f11cd) to head (a03df50).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
key-wallet/src/dip9.rs 92.65% 13 Missing ⚠️
dash/src/taproot.rs 33.33% 12 Missing ⚠️
dash/src/address.rs 0.00% 7 Missing ⚠️
...ction/special_transaction/provider_registration.rs 45.45% 6 Missing ⚠️
dash/src/blockdata/script/push_bytes.rs 0.00% 4 Missing ⚠️
dash/src/crypto/sighash.rs 0.00% 2 Missing ⚠️
key-wallet/src/bip32.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1053      +/-   ##
==========================================
+ Coverage   77.01%   77.45%   +0.44%     
==========================================
  Files         320      317       -3     
  Lines       81519    80645     -874     
==========================================
- Hits        62778    62464     -314     
+ Misses      18741    18181     -560     
Flag Coverage Δ
core 78.82% <38.00%> (+0.59%) ⬆️
ffi 51.50% <100.00%> (+2.20%) ⬆️
rpc 20.00% <ø> (ø)
spv 92.01% <ø> (-0.05%) ⬇️
wallet 80.22% <92.30%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
dash/src/blockdata/script/owned.rs 69.83% <ø> (ø)
...n/special_transaction/provider_update_registrar.rs 86.27% <100.00%> (ø)
dash/src/crypto/key.rs 99.13% <ø> (+20.97%) ⬆️
dash/src/hash_types.rs 62.41% <100.00%> (-1.46%) ⬇️
dash/src/serde_utils.rs 36.03% <ø> (ø)
dash/src/sign_message.rs 79.10% <100.00%> (-0.31%) ⬇️
key-wallet-ffi/src/special_payload.rs 92.05% <100.00%> (ø)
key-wallet/src/bip32.rs 81.82% <80.00%> (-0.88%) ⬇️
dash/src/crypto/sighash.rs 67.32% <0.00%> (+1.74%) ⬆️
dash/src/blockdata/script/push_bytes.rs 33.54% <0.00%> (-0.86%) ⬇️
... and 4 more

... and 23 files with indirect coverage changes

`git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
`git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
`git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
`git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space`
@kwvg
kwvg marked this pull request as ready for review September 24, 2026 12:37
@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Sep 24, 2026
@kwvg

kwvg commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

/self-reviewed

@kwvg
kwvg requested a review from ZocoLini September 24, 2026 12:49
@github-actions

Copy link
Copy Markdown
Contributor

Ready for review — needs QuantumExplorer or ZocoLini or xdustinface.
Full checklist in the description.

@github-actions github-actions Bot added ready-for-human Bots have reported, the author has self-reviewed, and the build is green: this needs a human. and removed waiting-self-review Waiting for the author to post /self-reviewed labels Sep 24, 2026
@ZocoLini
ZocoLini merged commit 9a4bc0c into dashpay:dev Sep 24, 2026
46 of 47 checks passed
@kwvg kwvg self-assigned this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Bots have reported, the author has self-reviewed, and the build is green: this needs a human.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants