Skip to content

chore!: remove Taproot (BIP341) support - #1253

Closed
ZocoLini wants to merge 1 commit into
devfrom
chore/remove-taproot
Closed

ZocoLini wants to merge 1 commit into
devfrom
chore/remove-taproot

Conversation

@ZocoLini

@ZocoLini ZocoLini commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Dash Core has no Taproot consensus rules (no SCRIPT_VERIFY_TAPROOT/WITNESS flags in src/script/interpreter.h), so the Taproot code inherited from rust-bitcoin is dead.

Removes the taproot module, BIP341 sighash, P2TR address/script helpers, the Taproot re-exports in dashcore-crypto and their tests.

First half of a redo of #400 on top of current dev; SegWit removal follows in a separate PR.

🤖 Generated with Claude Code

PR Hygiene · c70940f

  • Bots — coderabbitai ✓
  • Self-review — post /self-reviewed
  • Build green
  • Approvals
    • files with no dedicated owner (crypto/src/key.rs, crypto/src/lib.rs, crypto/src/sighash.rs and 13 more) — QuantumExplorer or xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • Breaking Changes
    • Taproot address types and constructors are no longer available.
    • Taproot script, witness, and transaction-weight utilities have been removed.
    • Taproot signature hashing, key tweaking, spend information, and related cryptographic APIs are no longer supported.
    • Taproot consensus encoding and address-type mappings have been removed. Legacy and SegWit address and signature-hashing support remain.

Dash Core has no Taproot (nor SegWit) consensus rules, so the inherited
rust-bitcoin Taproot code is dead weight. Drop the `taproot` module,
BIP341 sighash, P2TR address/script helpers, Taproot crypto re-exports
and their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 30, 2026
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e445410 and c70940f.

Files selected for processing: 16
  • crypto/src/key.rs
  • crypto/src/lib.rs
  • crypto/src/sighash.rs
  • dash/src/address.rs
  • dash/src/blockdata/script/borrowed.rs
  • dash/src/blockdata/script/owned.rs
  • dash/src/blockdata/script/tests.rs
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/blockdata/witness.rs
  • dash/src/consensus/encode.rs
  • dash/src/crypto/mod.rs
  • dash/src/crypto/sighash.rs
  • dash/src/lib.rs
  • dash/src/taproot.rs
  • dash/tests/data/bip341_tests.json
  • key-wallet-ffi/src/types.rs
Files with no reviewable changes: 8
  • dash/src/consensus/encode.rs
  • dash/src/blockdata/script/tests.rs
  • dash/src/lib.rs
  • dash/tests/data/bip341_tests.json
  • dash/src/blockdata/transaction/mod.rs
  • dash/src/crypto/mod.rs
  • crypto/src/lib.rs
  • dash/src/taproot.rs

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

Walkthrough

This change removes Taproot APIs and related address, script, witness, consensus-encoding, and sighash support from the crypto and Dash crates. It also removes associated Taproot tests and vectors. The FFI address conversion maps P2tr through its existing fallback to Unknown.

Changes: Taproot support removal

Layer / File(s) Summary
Remove Taproot modules and crypto APIs
crypto/src/key.rs, crypto/src/lib.rs, crypto/src/sighash.rs, dash/src/crypto/mod.rs, dash/src/lib.rs, dash/src/taproot.rs
The Taproot module and its public APIs were removed, along with Taproot key and sighash type exports.
Remove Taproot address support
dash/src/address.rs, key-wallet-ffi/src/types.rs
Taproot address types, constructors, parsing and decoding mappings, and x-only key relations were removed. The FFI conversion uses its existing fallback for P2tr.
Remove Taproot script and witness support
dash/src/blockdata/script/*, dash/src/blockdata/transaction/mod.rs, dash/src/blockdata/witness.rs, dash/src/consensus/encode.rs
Taproot script constructors and checks, witness script extraction, key-spend weight predictions, and TapLeafHash consensus encoding were removed with related tests.
Remove Taproot sighash implementation and vectors
dash/src/crypto/sighash.rs, dash/tests/data/bip341_tests.json
The Taproot cache, validation types, errors, signing-data methods, and related tests were removed from SighashCache. The legacy and SegWit implementations remain.

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

Change: Other

Suggested reviewers: kwvg, quantumexplorer, sanket1729

Merge Risk: Minimal · up to c7094

This change removes the unused Taproot (BIP341) API, address, script and sighash support. Nothing in the supplied evidence shows a remaining dependency on the removed items. Normal CI, including a workspace-wide test build, should confirm it before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: removing Taproot (BIP341) support.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 8 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@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 Oct 30, 2026
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.77%. Comparing base (e445410) to head (c70940f).
⚠️ Report is 12 commits behind head on dev.

Files with missing lines Patch % Lines
dash/src/crypto/sighash.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1253      +/-   ##
==========================================
+ Coverage   80.49%   80.77%   +0.28%     
==========================================
  Files         291      290       -1     
  Lines       77412    75716    -1696     
==========================================
- Hits        62312    61159    -1153     
+ Misses      15100    14557     -543     
Flag Coverage Δ
core 79.11% <66.66%> (+0.90%) ⬆️
ffi 57.00% <ø> (+0.10%) ⬆️
rpc 52.05% <ø> (ø)
spv 93.71% <ø> (-0.02%) ⬇️
wallet 82.57% <ø> (ø)
Files with missing lines Coverage Δ
dash/src/address.rs 58.82% <100.00%> (+1.58%) ⬆️
dash/src/blockdata/script/borrowed.rs 80.86% <ø> (+3.38%) ⬆️
dash/src/blockdata/script/owned.rs 72.67% <ø> (+2.84%) ⬆️
dash/src/blockdata/transaction/mod.rs 89.88% <ø> (-0.12%) ⬇️
dash/src/blockdata/witness.rs 89.61% <ø> (-0.83%) ⬇️
dash/src/consensus/encode.rs 87.61% <ø> (+0.29%) ⬆️
key-wallet-ffi/src/types.rs 76.44% <ø> (+0.13%) ⬆️
dash/src/crypto/sighash.rs 75.00% <0.00%> (+2.66%) ⬆️

... and 18 files with indirect coverage changes

@github-actions github-actions Bot added the merge-conflict The PR conflicts with the target branch. label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@ZocoLini

ZocoLini commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

#400got updated

@ZocoLini ZocoLini closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR conflicts with the target branch. waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant