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

Advise extract_tx_unchecked_fee_rate in sign_psbt docs

Public commit record

What the developer wrote

Authored by auto-pr-bot

81/100 · Strong
Advise extract_tx_unchecked_fee_rate in sign_psbt docs

The sign_psbt() doc comments on CoinSelectionSource, WalletSource and
their synchronous counterparts told wallet implementors to call
psbt.extract_tx() to get the transaction to sign. Since the rust-bitcoin
0.31 upgrade (a8bd4c097f7a, first released in v0.0.124-beta) that method
rejects transactions paying more than 25,000 sat/vB, and LDK's own
callers were switched to extract_tx_unchecked_fee_rate() at the same
time while the docs were left behind.

The transactions handed to sign_psbt() can legitimately carry a fee
above that cap: the anchor CPFP child LDK builds for a
ChannelClose event folds the commitment transaction's fee into its own
input value, so its fee pays for the whole package and its own feerate
exceeds 25,000 sat/vB once the commitment is large enough (e.g. ~146
sat/vB target with 483 pending HTLCs). A wallet written as documented
then fails sign_psbt() and the force-close is never broadcast.

Point implementors at extract_tx_unchecked_fee_rate() instead, and warn
against extract_tx() so they don't "fix" it back.

@matt asked:

> @auto-pr-bot can you change the docs to fix this?

Fixes #5594

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5594
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only updates documentation comments in LDK's wallet utility code. It tells wallet developers not to use a standard Bitcoin library method (psbt.extract_tx()) when implementing the sign_psbt() function, because that method rejects transactions with very high fees. In certain legitimate Lightning scenarios—like a child transaction paying fees for both itself and its parent force-close transaction—the fee rate can exceed the library's cap. Using the wrong method would cause the wallet to refuse to sign, preventing a force-close transaction from being broadcast. The commit itself does not change any code behavior, only the guidance given to implementers.

Recommended action

No immediate code deployment is needed, but downstream wallet implementors using these traits should review their sign_psbt() implementations to ensure they use extract_tx_unchecked_fee_rate() rather than extract_tx(). Projects on LDK v0.0.124-beta or later that followed the old documentation are at risk of failing to broadcast force-close transactions under high-fee conditions.

Security signals we found

01

Documentation-only change correcting security-relevant integration guidance

02

Incorrect wallet integration could cause denial of service for force-close broadcast

03

References a real fee-rate validation pitfall introduced by rust-bitcoin 0.31 upgrade

Risk score

Why this scored 60/100

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