Skip to content

fix: validate segwit output type instead of tx witness#236

Merged
matthewjablack merged 2 commits intomasterfrom
fix/funding-input-segwit-validation
Jan 20, 2026
Merged

fix: validate segwit output type instead of tx witness#236
matthewjablack merged 2 commits intomasterfrom
fix/funding-input-segwit-validation

Conversation

@matthewjablack
Copy link
Contributor

Summary

Fixes the FundingInput validation to properly check if the output being spent is segwit (P2WPKH, P2WSH, or P2TR) rather than checking if the previous transaction used segwit inputs.

Changes

  • Replace prevTx.isSegWit check with direct validation of the output's scriptPubKey
  • Add support for P2WPKH (22 bytes), P2WSH (34 bytes), and P2TR (34 bytes) output types
  • Validate that the specified prevTxVout exists in the previous transaction
  • Provide clearer error messages for validation failures

@matthewjablack matthewjablack merged commit 3b23b25 into master Jan 20, 2026
2 checks passed
@matthewjablack matthewjablack deleted the fix/funding-input-segwit-validation branch January 20, 2026 21:11
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

Comments