Skip to content

Releases: synonymdev/ldk-node

v0.6.1-rc.5

31 Jul 14:44
6dd6e64

Choose a tag to compare

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 InsufficientFunds error in calculate_total_fee when near the total spendable balance

v0.6.1-rc.4

28 Jul 17:58
b2aa511

Choose a tag to compare

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 to PaymentKind::Bolt11 and PaymentKind::Bolt11Jit variants
  • 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

18 Jul 19:59
90d678d

Choose a tag to compare

This Release:

  • Adds optional description field to PaymentKind::Bolt11 and PaymentKind::Bolt11Jit variants
  • 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

06 Jul 14:46
696a5f2

Choose a tag to compare

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_fee method on OnchainPayment that simulates creating a transaction and returns the total fee in satoshis
  • calculate_total_fee uses the same validation as send_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

20 Jun 16:09
207c299

Choose a tag to compare

This release:

  • Syncs with upstream v0.6.1 release.
  • Bumps version to v0.6.1-rc.1

v0.6.0-rc.4

17 Jun 14:36
f9829bb

Choose a tag to compare

What's Changed

  • fix: 12 word mnemonic entropy by @pwltr in #5
  • feat: Exposes calculate_cpfp_fee_rate method, allowing users to calculate appropriate fee rates for Child-Pays-For-Parent (CPFP) transactions before creating them.

v0.6.0-rc.3

11 Jun 13:28
46e093d

Choose a tag to compare

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 optional utxos_to_spend parameter
  • 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

10 Jun 13:25
c5dcd19

Choose a tag to compare

This release:

  • Syncs with upstream v0.6.0 release.

v0.6.0-rc.1

02 Jun 15:01
ad86b64

Choose a tag to compare

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_rbf to replace transactions with higher fee versions
  • Add accelerate_by_cpfp to create child transactions that pay for parent
  • Add calculate_cpfp_fee_rate helper for automatic fee calculation
  • Add new error variants for transaction fee bumping operations
  • Expose methods through OnchainPayment API
  • 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.