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

Fix MAX_STANDARD_TX_WEIGHT check

Public commit record

What the developer wrote

Authored by Jeffrey Czyz

58/100 · Thin
Fix MAX_STANDARD_TX_WEIGHT check

The interactive-tx construction protocol needs to make sure the
constructed transaction does not exceed MAX_STANDARD_TX_WEIGHT. A naive
estimate of the transaction weight after signing was used, but was not
accurate. Specifically, it double-counted EMPTY_SCRIPT_SIG_WEIGHT and
didn't include SEGWIT_MARKER_FLAG_WEIGHT.
✓ Descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes how rust-lightning estimates the final size of a Bitcoin transaction during the interactive-tx protocol used to build funding transactions for Lightning channels. The old estimate double-counted a fixed empty-signature weight and forgot to add the SegWit marker/flag bytes, so it could wrongly allow a transaction that is actually too large to be accepted by the Bitcoin network. Such a transaction would not propagate through standard Bitcoin nodes, potentially causing a channel-funding attempt to fail or get stuck.

Recommended action

Review whether any released versions shipped with the incorrect weight estimate and assess whether an oversized funding tx could be induced by a peer. If so, consider a security advisory and patch release. Add regression tests covering transactions near MAX_STANDARD_TX_WEIGHT with multiple SegWit inputs.

Security signals we found

01

Denial-of-service / protocol-stall risk from non-standard oversized transaction

02

Incorrect transaction-weight estimation in consensus-adjacent code

03

Fixes mempool-standard policy check (MAX_STANDARD_TX_WEIGHT)

04

Interactive-tx construction protocol correctness

Risk score

Why this scored 59/100

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