Releases: synonymdev/ldk-node
v0.6.1-rc.5
This Release:
Applies a fix to detect when the requested amount is within the spendable balance and automatically calculates the fee as if sending all available funds, while retaining the anchor channel reserve. Previously, when users try to calculate fees for amounts close or equal to their total balance, calculate_total_feewould throwInsufficientFunds`.
- Detect near-full-balance send attempts and apply max-spend logic
- Avoids
InsufficientFundserror incalculate_total_feewhen near the total spendable balance
v0.6.1-rc.4
This release adds the ability to retrieve the original BOLT11 invoice string from PaymentDetails by adding a new bolt11 field to the PaymentKind::Bolt11 and PaymentKind::Bolt11Jit variants.
Changes:
- Added
bolt11: Option<String>field toPaymentKind::Bolt11andPaymentKind::Bolt11Jitvariants - Updated all payment creation code paths to store the invoice string:
Bolt11Payment::send()Bolt11Payment::send_using_amount()Bolt11Payment::receive()Bolt11Payment::receive_via_jit_channel()
- Updated bindings to include the new field
- Maintained backward compatibility by using
Option<String>
Breaking Changes:
None - the field is optional and existing code will continue to work.
v0.6.1-rc.3
This Release:
- Adds optional description field to
PaymentKind::Bolt11andPaymentKind::Bolt11Jitvariants - Extracts description from BOLT11 invoices during payment processing
- Handles both direct descriptions and description hashes
- Updates bindings to expose description field
v0.6.1-rc.2
Description
This release adds the ability to calculate transaction fees without broadcasting, allowing users to estimate costs before committing to a transaction.
What's New
- New
calculate_total_feemethod onOnchainPaymentthat simulates creating a transaction and returns the total fee in satoshis calculate_total_feeuses the same validation assend_to_address- checks UTXOs, reserves, and fund availability
Usage
let fee = node.onchain_payment().calculate_total_fee(
&address,
amount_sats,
fee_rate,
utxos_to_spend
)?;v0.6.1-rc.1
This release:
- Syncs with upstream
v0.6.1release. - Bumps version to
v0.6.1-rc.1
v0.6.0-rc.4
v0.6.0-rc.3
Summary
This release adds coin selection functionality to ldk-node, giving users control over which UTXOs are used in on-chain transactions. This is essential for fee optimization, proper UTXO management and privacy-conscious users.
Key Features
1. UTXO Management
- List spendable outputs: New
list_spendable_outputs()method returns all UTXOs that are safe to spend- Safety: Automatically excludes UTXOs being used to fund Lightning channels
2. Coin Selection Algorithms
Added select_utxos_with_algorithm() method with four algorithms:
- BranchAndBound: Finds exact amount matches to minimize change
- LargestFirst: Prioritizes largest UTXOs (reduces UTXO set size)
- OldestFirst: FIFO selection (useful for accounting/tax purposes)
- SingleRandomDraw: Random selection for privacy
3. Manual UTXO Control
- Updated
send_to_address()to accept optionalutxos_to_spendparameter - Allows users to specify exactly which UTXOs to use in a given transaction
API Changes
New Methods
// List all spendable UTXOs
pub fn list_spendable_outputs() -> Result<Vec<SpendableUtxo>, Error>
// Select UTXOs using an algorithm
pub fn select_utxos_with_algorithm(
target_amount_sats: u64,
fee_rate: Option<FeeRate>,
algorithm: CoinSelectionAlgorithm,
utxos: Option<Vec<SpendableUtxo>>
) -> Result<Vec<SpendableUtxo>, Error>
// Updated send_to_address with UTXO selection
pub fn send_to_address(
address: &Address,
amount_sats: u64,
fee_rate: Option<FeeRate>,
utxos_to_spend: Option<Vec<SpendableUtxo>> // NEW parameter
) -> Result<Txid, Error>
New Types
- SpendableUtxo: Contains outpoint and value_sats
- CoinSelectionAlgorithm: Enum with the four algorithms
- Error::CoinSelectionFailed: New error for selection failures
Use Cases
1. Privacy: Users can avoid linking UTXOs from different sources
2. Fee Optimization: Select UTXOs to minimize transaction size/fees
3. Dust Management: Consolidate small UTXOs when fees are low
4. Accounting: Use OldestFirst for FIFO tax calculations
5. Channel Safety: Automatically protects channel funding UTXOs
Testing Recommendations
- Test each coin selection algorithm with various UTXO sets
- Verify channel funding UTXOs are properly excluded
- Test edge cases (insufficient funds, all UTXOs locked, etc.)
- Verify manual UTXO selection works correctly
Breaking Changes
None - the changes are backwards compatible. The new parameter in send_to_address() is optional.v0.6.0-rc.2
This release:
- Syncs with upstream
v0.6.0release.
v0.6.0-rc.1
Add Replace-By-Fee (RBF) and Child-Pays-For-Parent (CPFP) functionality
to allow users to bump fees on stuck transactions.
- Add
bump_fee_by_rbfto replace transactions with higher fee versions - Add
accelerate_by_cpfpto create child transactions that pay for parent - Add
calculate_cpfp_fee_ratehelper for automatic fee calculation - Add new error variants for transaction fee bumping operations
- Expose methods through
OnchainPaymentAPI - Add UniFFI bindings for RBF/CPFP functionality
RBF allows replacing an existing unconfirmed transaction with a new version
that pays a higher fee. CPFP allows accelerating a transaction by spending
one of its outputs with a high-fee child transaction.