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

Fix incorrect weight estimation for splice shared input

Public commit record

What the developer wrote

Authored by Wilmer Paulino

73/100 · Adequate
Fix incorrect weight estimation for splice shared input

The splice shared input weight should always be composed of the base
input weight (prevout & sequence), an empty `script_sig` weight, and the
multisig channel-type specific witness weight.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in how the Lightning Dev Kit estimates the transaction weight (and thus the required transaction fee) when splicing a channel. Previously, the code estimated the weight of the shared splice input using a generic function based on the previous funding output type, which could produce an incorrect value. The fix explicitly builds the weight from the base input fields, an empty script signature, and the expected multisig witness. If the estimate was too low, the resulting transaction could have paid an insufficient fee and failed to confirm or propagate; if too high, funds could be overpaid as fees. The included test changes show the corrected fee math changes the expected change output amount.

Recommended action

Review the fixed weight formula against all supported channel types and complete the TODO for Taproot/single-sig channel types. Run the updated splicing tests and consider adding edge-case tests for minimum-fee splice transactions to ensure the estimate is never below the actual weight.

Security signals we found

01

Incorrect transaction weight estimation can lead to underpayment or overpayment of miner fees

02

Shared splice input uses a fixed 2-of-2 multisig witness weight assumption

03

Fee miscalculation could cause a splice transaction to be rejected by the network or to lock up funds temporarily

04

TODO indicates weight model is incomplete for non-multisig channel types such as Taproot

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 8/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.