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

Use FundingTxInput instead of Utxo in CoinSelection

Public commit record

What the developer wrote

Authored by Jeffrey Czyz

85/100 · Strong
Use FundingTxInput instead of Utxo in CoinSelection

In order to reuse CoinSelectionSource for splicing, the previous
transaction of each UTXO is needed. Update CoinSelection to use
FundingTxInput (renamed to ConfirmedUtxo) so that it is available.

This requires adding a method to WalletSource to look up a previous
transaction for a UTXO. Otherwise, Wallet's implementation of
CoinSelectionSource would need WalletSource to include the previous
transactions when listing confirmed UTXOs to select from. But this would
be inefficient since only some UTXOs are selected.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit refactors how the Lightning Dev Kit (LDK) selects coins for on-chain Bitcoin transactions. It changes the internal data structure used during coin selection so that each selected coin now carries the full previous transaction that created it, not just the coin's own details. The main stated reason is to prepare for a future feature called 'splicing.' The commit also adds a new wallet method to look up those previous transactions on demand. There is no direct evidence in the commit that this fixes an active security bug, but it does touch code that handles real money (transaction fees and UTXOs) and changes a public wallet interface, so downstream implementers need to update their code.

Recommended action

Treat as a breaking API refactor with security-adjacent implications. Downstream projects implementing WalletSource or WalletSourceSync must add get_prevtx. Review custom coin-selection implementations to ensure they now provide the previous transaction for each selected UTXO and validate it correctly. Monitor LDK release notes for any follow-up security guidance, but no immediate patch urgency is indicated by the commit itself.

Security signals we found

01

Refactors coin-selection data structures to include full previous transaction (prevtx) for each selected UTXO

02

Adds new required wallet interface methods: WalletSource::get_prevtx and WalletSourceSync::get_prevtx

03

Adds defensive validation in default coin selection that previous transaction txid matches outpoint and output index exists

04

Changes public API/types (CoinSelection, WalletSource, WalletSourceSync) - downstream implementers must update

05

Touches fee-calculation and transaction-building code paths used for fee-bumping and HTLC claims

06

No explicit security bug, CVE, or vulnerability described in commit message or diff

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/15
Confidence 6/10
Evidence quality 3/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.