AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 35 Bitcoin

script: add SIGHASH_ALL_WITH_RANGEPROOF and DefaultSighashType; strip rangeproof bit for Taproot signing

Public commit record

What the developer wrote

Authored by Byron Hambly

73/100 · Adequate
script: add SIGHASH_ALL_WITH_RANGEPROOF and DefaultSighashType; strip rangeproof bit for Taproot signing

Add a named default constant SIGHASH_ALL_WITH_RANGEPROOF (SIGHASH_ALL |
SIGHASH_RANGEPROOF) and a DefaultSighashType() helper that selects the
default pre-Taproot sighash based on whether SIGHASH_RANGEPROOF is active
for the target chain.

Strip the 0x40 (SIGHASH_RANGEPROOF) bit when computing Schnorr
signatures, since the BIP341-style sighash always commits to rangeproofs
and rejects the bit. This keeps SIGHASH_ALL_WITH_RANGEPROOF a valid
universal default for both pre-Taproot and Taproot signing.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a new default signature mode for the Elements sidechain that includes 'rangeproof' data in signatures for older-style (pre-Taproot) transactions. It also makes sure that when Taproot/Schnorr signing is used, the extra rangeproof bit is stripped away because Taproot already commits to rangeproofs in a different way and would reject the bit. The change is defensive: it closes a 'rangeproof malleability gap' where transaction witnesses could potentially be altered without invalidating signatures, but only on chains where the relevant feature (dynafed) is active. It is not a fix for an active exploit, but a hardening/correctness improvement.

Recommended action

Review and merge as a defensive hardening change. Ensure wallet and RPC callers use DefaultSighashType() where appropriate, and verify that stripping the rangeproof bit for Taproot does not conflict with any custom signing flows. No urgent incident response is indicated by the commit itself.

Security signals we found

01

Adds SIGHASH_ALL_WITH_RANGEPROOF constant to commit rangeproofs in pre-Taproot signatures

02

Introduces DefaultSighashType() chain-aware default sighash selection

03

Strips SIGHASH_RANGEPROOF bit for Taproot/Schnorr signing to maintain validity

04

Includes unit tests for the new default sighash behavior

05

Closes pre-Taproot rangeproof witness malleability gap on dynafed-active chains

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 7/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.