Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
66b1a88
Stop migrating spendable outputs from pre-v0.3 format
tnull Jul 31, 2025
ed12e65
Bump to LDK main (4e32d852)
tnull Feb 6, 2025
4b45d7c
Switch to use `rustls-ring` everywhere
tnull Aug 15, 2025
80ac9f3
Use log timestamps with millisecond resolution
joostjager Sep 3, 2025
a489fbf
Merge pull request #462 from tnull/2025-02-upgrade-to-ldk-0.2
tnull Sep 10, 2025
66f5c28
Add static invoice support
joostjager Aug 19, 2025
8f0e4fd
Merge pull request #621 from joostjager/static-invoice-server
tnull Sep 16, 2025
006a06e
Adapt channel balance reporting to use confirmed candidate
joostjager Sep 16, 2025
f0296d2
Merge pull request #634 from joostjager/splicing-balance
tnull Sep 16, 2025
c99ff30
Log to console with node prefix
joostjager Sep 16, 2025
e8b2513
Merge pull request #636 from joostjager/multi-node-console-log
tnull Sep 17, 2025
8d18d16
Update static invoice store for invoice requests
joostjager Sep 16, 2025
efbef4c
Update static invoice test to use unannounced channels
joostjager Sep 17, 2025
0f1d66c
Merge pull request #635 from joostjager/always-online-fwd-inv-req
tnull Sep 18, 2025
3df1477
Fix wait_for_tx exponential backoff
joostjager Sep 19, 2025
97f404f
Adapt to new pay_for_offer call in upstream LDK
joostjager Sep 18, 2025
569e910
Merge pull request #639 from joostjager/pay-for-offer-refactor
tnull Sep 22, 2025
904a05f
Try to log status code for `reqwest`'s `Request` error kind
tnull Sep 22, 2025
65945f8
Merge pull request #641 from joostjager/backoff-fix
tnull Sep 22, 2025
55ffd26
Merge pull request #643 from tnull/2025-09-try-log-status
tnull Sep 24, 2025
1192085
Bump LDK and account for `FutureSpawner` move
tnull Sep 25, 2025
f3dea63
Merge pull request #648 from tnull/2025-09-fix-futurespawner
tnull Sep 25, 2025
b7598ae
Add onion mailbox for async receivers
joostjager Sep 4, 2025
8e03ddc
Merge pull request #632 from joostjager/onion-mailbox
tnull Sep 25, 2025
2ae3466
Re-format all imports
tnull Sep 28, 2025
09eacfa
Merge pull request #652 from tnull/2025-09-format-all-imports
tnull Sep 29, 2025
11b7eb5
Use cancellable task for inbound connections
joostjager Sep 22, 2025
6f1edcd
Listen on all provided addresses
joostjager Sep 22, 2025
0f621ff
Do not use random ports from ephemeral range
joostjager Sep 23, 2025
ca1e5a7
Merge pull request #644 from joostjager/multi-listen-fix
tnull Oct 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
- name: Generate Kotlin JVM
run: ./scripts/uniffi_bindgen_generate_kotlin.sh

- name: Install `bindgen-cli`
run: cargo install --force bindgen-cli

- name: Generate Kotlin Android
run: ./scripts/uniffi_bindgen_generate_kotlin_android.sh

Expand Down
59 changes: 35 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,57 @@ panic = 'abort' # Abort on panic
default = []

[dependencies]
lightning = { version = "0.1.0", features = ["std"] }
lightning-types = { version = "0.2.0" }
lightning-invoice = { version = "0.33.0", features = ["std"] }
lightning-net-tokio = { version = "0.1.0" }
lightning-persister = { version = "0.1.0" }
lightning-background-processor = { version = "0.1.0", features = ["futures"] }
lightning-rapid-gossip-sync = { version = "0.1.0" }
lightning-block-sync = { version = "0.1.0", features = ["rpc-client", "rest-client", "tokio"] }
lightning-transaction-sync = { version = "0.1.0", features = ["esplora-async-https", "time", "electrum"] }
lightning-liquidity = { version = "0.1.0", features = ["std"] }
#lightning = { version = "0.1.0", features = ["std"] }
#lightning-types = { version = "0.2.0" }
#lightning-invoice = { version = "0.33.0", features = ["std"] }
#lightning-net-tokio = { version = "0.1.0" }
#lightning-persister = { version = "0.1.0" }
#lightning-background-processor = { version = "0.1.0" }
#lightning-rapid-gossip-sync = { version = "0.1.0" }
#lightning-block-sync = { version = "0.1.0", features = ["rest-client", "rpc-client", "tokio"] }
#lightning-transaction-sync = { version = "0.1.0", features = ["esplora-async-https", "time", "electrum-rustls-ring"] }
#lightning-liquidity = { version = "0.1.0", features = ["std"] }
#lightning-macros = { version = "0.1.0" }

#lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["std"] }
#lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["std"] }
#lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["futures"] }
#lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["rpc-client", "tokio"] }
#lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["esplora-async-https", "electrum", "time"] }
#lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["rest-client", "rpc-client", "tokio"] }
#lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main", features = ["esplora-async-https", "electrum-rustls-ring", "time"] }
#lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }
#lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", branch = "main" }

lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994", features = ["std"] }
lightning-types = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-invoice = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994", features = ["std"] }
lightning-net-tokio = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-persister = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-background-processor = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-rapid-gossip-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-block-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994", features = ["rest-client", "rpc-client", "tokio"] }
lightning-transaction-sync = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994", features = ["esplora-async-https", "electrum-rustls-ring", "time"] }
lightning-liquidity = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }
lightning-macros = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994" }

#lightning = { path = "../rust-lightning/lightning", features = ["std"] }
#lightning-types = { path = "../rust-lightning/lightning-types" }
#lightning-invoice = { path = "../rust-lightning/lightning-invoice", features = ["std"] }
#lightning-net-tokio = { path = "../rust-lightning/lightning-net-tokio" }
#lightning-persister = { path = "../rust-lightning/lightning-persister" }
#lightning-background-processor = { path = "../rust-lightning/lightning-background-processor", features = ["futures"] }
#lightning-background-processor = { path = "../rust-lightning/lightning-background-processor" }
#lightning-rapid-gossip-sync = { path = "../rust-lightning/lightning-rapid-gossip-sync" }
#lightning-block-sync = { path = "../rust-lightning/lightning-block-sync", features = ["rpc-client", "tokio"] }
#lightning-transaction-sync = { path = "../rust-lightning/lightning-transaction-sync", features = ["esplora-async-https", "electrum", "time"] }
#lightning-block-sync = { path = "../rust-lightning/lightning-block-sync", features = ["rest-client", "rpc-client", "tokio"] }
#lightning-transaction-sync = { path = "../rust-lightning/lightning-transaction-sync", features = ["esplora-async-https", "electrum-rustls-ring", "time"] }
#lightning-liquidity = { path = "../rust-lightning/lightning-liquidity", features = ["std"] }
#lightning-macros = { path = "../rust-lightning/lightning-macros" }

bdk_chain = { version = "0.23.0", default-features = false, features = ["std"] }
bdk_esplora = { version = "0.22.0", default-features = false, features = ["async-https-rustls", "tokio"]}
bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls"]}
bdk_electrum = { version = "0.23.0", default-features = false, features = ["use-rustls-ring"]}
bdk_wallet = { version = "2.0.0", default-features = false, features = ["std", "keys-bip39"]}

reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
Expand All @@ -78,12 +93,7 @@ rand = "0.8.5"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
tokio = { version = "1.37", default-features = false, features = [ "rt-multi-thread", "time", "sync", "macros" ] }
esplora-client = { version = "0.12", default-features = false, features = ["tokio", "async-https-rustls"] }

# FIXME: This was introduced to decouple the `bdk_esplora` and
# `lightning-transaction-sync` APIs. We should drop it as part of the upgrade
# to LDK 0.2.
esplora-client_0_11 = { package = "esplora-client", version = "0.11", default-features = false, features = ["tokio", "async-https-rustls"] }
electrum-client = { version = "0.24.0", default-features = true }
electrum-client = { version = "0.24.0", default-features = false, features = ["proxy", "use-rustls-ring"] }
libc = "0.2"
uniffi = { version = "0.28.3", features = ["build"], optional = true }
serde = { version = "1.0.210", default-features = false, features = ["std", "derive"] }
Expand All @@ -97,8 +107,9 @@ prost = { version = "0.11.6", default-features = false}
winapi = { version = "0.3", features = ["winbase"] }

[dev-dependencies]
lightning = { version = "0.1.0", features = ["std", "_test_utils"] }
#lightning = { version = "0.1.0", features = ["std", "_test_utils"] }
#lightning = { git = "https://github.com/lightningdevkit/rust-lightning", branch="main", features = ["std", "_test_utils"] }
lightning = { git = "https://github.com/lightningdevkit/rust-lightning", rev = "3e21ba37a133977d4247e86f25df983b39326994", features = ["std", "_test_utils"] }
#lightning = { path = "../rust-lightning/lightning", features = ["std", "_test_utils"] }
proptest = "1.0.0"
regex = "1.5.6"
Expand Down
98 changes: 54 additions & 44 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dictionary Config {
sequence<PublicKey> trusted_peers_0conf;
u64 probing_liquidity_limit_multiplier;
AnchorChannelsConfig? anchor_channels_config;
SendingParameters? sending_parameters;
RouteParametersConfig? route_parameters;
};

dictionary AnchorChannelsConfig {
Expand Down Expand Up @@ -95,6 +95,8 @@ interface Builder {
[Throws=BuildError]
void set_node_alias(string node_alias);
[Throws=BuildError]
void set_async_payments_role(AsyncPaymentsRole? role);
[Throws=BuildError]
Node build();
[Throws=BuildError]
Node build_with_fs_store();
Expand Down Expand Up @@ -167,13 +169,13 @@ interface Bolt11InvoiceDescription {

interface Bolt11Payment {
[Throws=NodeError]
PaymentId send([ByRef]Bolt11Invoice invoice, SendingParameters? sending_parameters);
PaymentId send([ByRef]Bolt11Invoice invoice, RouteParametersConfig? route_parameters);
[Throws=NodeError]
PaymentId send_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, SendingParameters? sending_parameters);
PaymentId send_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, RouteParametersConfig? route_parameters);
[Throws=NodeError]
void send_probes([ByRef]Bolt11Invoice invoice);
void send_probes([ByRef]Bolt11Invoice invoice, RouteParametersConfig? route_parameters);
[Throws=NodeError]
void send_probes_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat);
void send_probes_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, RouteParametersConfig? route_parameters);
[Throws=NodeError]
void claim_for_hash(PaymentHash payment_hash, u64 claimable_amount_msat, PaymentPreimage preimage);
[Throws=NodeError]
Expand Down Expand Up @@ -209,17 +211,23 @@ interface Bolt12Payment {
Bolt12Invoice request_refund_payment([ByRef]Refund refund);
[Throws=NodeError]
Refund initiate_refund(u64 amount_msat, u32 expiry_secs, u64? quantity, string? payer_note);
[Throws=NodeError]
Offer receive_async();
[Throws=NodeError]
void set_paths_to_static_invoice_server(bytes paths);
[Throws=NodeError]
bytes blinded_paths_for_async_recipient(bytes recipient_id);
};

interface SpontaneousPayment {
[Throws=NodeError]
PaymentId send(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters);
PaymentId send(u64 amount_msat, PublicKey node_id, RouteParametersConfig? route_parameters);
[Throws=NodeError]
PaymentId send_with_custom_tlvs(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters, sequence<CustomTlvRecord> custom_tlvs);
PaymentId send_with_custom_tlvs(u64 amount_msat, PublicKey node_id, RouteParametersConfig? route_parameters, sequence<CustomTlvRecord> custom_tlvs);
[Throws=NodeError]
PaymentId send_with_preimage(u64 amount_msat, PublicKey node_id, PaymentPreimage preimage, SendingParameters? sending_parameters);
PaymentId send_with_preimage(u64 amount_msat, PublicKey node_id, PaymentPreimage preimage, RouteParametersConfig? route_parameters);
[Throws=NodeError]
PaymentId send_with_preimage_and_custom_tlvs(u64 amount_msat, PublicKey node_id, sequence<CustomTlvRecord> custom_tlvs, PaymentPreimage preimage, SendingParameters? sending_parameters);
PaymentId send_with_preimage_and_custom_tlvs(u64 amount_msat, PublicKey node_id, sequence<CustomTlvRecord> custom_tlvs, PaymentPreimage preimage, RouteParametersConfig? route_parameters);
[Throws=NodeError]
void send_probes(u64 amount_msat, PublicKey node_id);
};
Expand Down Expand Up @@ -254,7 +262,7 @@ interface LSPS1Liquidity {
[Throws=NodeError]
LSPS1OrderStatus request_channel(u64 lsp_balance_sat, u64 client_balance_sat, u32 channel_expiry_blocks, boolean announce_channel);
[Throws=NodeError]
LSPS1OrderStatus check_order_status(OrderId order_id);
LSPS1OrderStatus check_order_status(LSPS1OrderId order_id);
};

[Error]
Expand Down Expand Up @@ -311,11 +319,12 @@ enum NodeError {
"InsufficientFunds",
"LiquiditySourceUnavailable",
"LiquidityFeeTooHigh",
"InvalidBlindedPaths",
"AsyncPaymentServicesDisabled",
};

dictionary NodeStatus {
boolean is_running;
boolean is_listening;
BestBlock current_best_block;
u64? latest_lightning_wallet_sync_timestamp;
u64? latest_onchain_wallet_sync_timestamp;
Expand Down Expand Up @@ -347,6 +356,7 @@ enum BuildError {
"WalletSetupFailed",
"LoggerSetupFailed",
"NetworkMismatch",
"AsyncPaymentsConfigMismatch",
};

[Trait]
Expand Down Expand Up @@ -392,7 +402,7 @@ enum PaymentFailureReason {
[Enum]
interface ClosureReason {
CounterpartyForceClosed(UntrustedString peer_msg);
HolderForceClosed(boolean? broadcasted_latest_txn);
HolderForceClosed(boolean? broadcasted_latest_txn, string message);
LegacyCooperativeClosure();
CounterpartyInitiatedCooperativeClosure();
LocallyInitiatedCooperativeClosure();
Expand All @@ -402,8 +412,9 @@ interface ClosureReason {
DisconnectedPeer();
OutdatedChannelManager();
CounterpartyCoopClosedUnfundedChannel();
LocallyCoopClosedUnfundedChannel();
FundingBatchClosure();
HTLCsTimedOut();
HTLCsTimedOut( PaymentHash? payment_hash );
PeerFeerateTooLow(u32 peer_feerate_sat_per_kw, u32 required_feerate_sat_per_kw);
};

Expand Down Expand Up @@ -456,11 +467,11 @@ dictionary PaymentDetails {
u64 latest_update_timestamp;
};

dictionary SendingParameters {
MaxTotalRoutingFeeLimit? max_total_routing_fee_msat;
u32? max_total_cltv_expiry_delta;
u8? max_path_count;
u8? max_channel_saturation_power_of_half;
dictionary RouteParametersConfig {
u64? max_total_routing_fee_msat;
u32 max_total_cltv_expiry_delta;
u8 max_path_count;
u8 max_channel_saturation_power_of_half;
};

dictionary CustomTlvRecord {
Expand All @@ -469,13 +480,13 @@ dictionary CustomTlvRecord {
};

dictionary LSPS1OrderStatus {
OrderId order_id;
OrderParameters order_params;
PaymentInfo payment_options;
ChannelOrderInfo? channel_state;
LSPS1OrderId order_id;
LSPS1OrderParams order_params;
LSPS1PaymentInfo payment_options;
LSPS1ChannelInfo? channel_state;
};

dictionary OrderParameters {
dictionary LSPS1OrderParams {
u64 lsp_balance_sat;
u64 client_balance_sat;
u16 required_channel_confirmations;
Expand All @@ -485,22 +496,22 @@ dictionary OrderParameters {
boolean announce_channel;
};

dictionary PaymentInfo {
Bolt11PaymentInfo? bolt11;
OnchainPaymentInfo? onchain;
dictionary LSPS1PaymentInfo {
LSPS1Bolt11PaymentInfo? bolt11;
LSPS1OnchainPaymentInfo? onchain;
};

dictionary Bolt11PaymentInfo {
PaymentState state;
DateTime expires_at;
dictionary LSPS1Bolt11PaymentInfo {
LSPS1PaymentState state;
LSPSDateTime expires_at;
u64 fee_total_sat;
u64 order_total_sat;
Bolt11Invoice invoice;
};

dictionary OnchainPaymentInfo {
PaymentState state;
DateTime expires_at;
dictionary LSPS1OnchainPaymentInfo {
LSPS1PaymentState state;
LSPSDateTime expires_at;
u64 fee_total_sat;
u64 order_total_sat;
Address address;
Expand All @@ -509,24 +520,18 @@ dictionary OnchainPaymentInfo {
Address? refund_onchain_address;
};

dictionary ChannelOrderInfo {
DateTime funded_at;
dictionary LSPS1ChannelInfo {
LSPSDateTime funded_at;
OutPoint funding_outpoint;
DateTime expires_at;
LSPSDateTime expires_at;
};

enum PaymentState {
enum LSPS1PaymentState {
"ExpectPayment",
"Paid",
"Refunded",
};

[Enum]
interface MaxTotalRoutingFeeLimit {
None ();
Some ( u64 amount_msat );
};

[NonExhaustive]
enum Network {
"Bitcoin",
Expand Down Expand Up @@ -716,6 +721,11 @@ enum Currency {
"Signet",
};

enum AsyncPaymentsRole {
"Client",
"Server",
};

dictionary RouteHintHop {
PublicKey src_node_id;
u64 short_channel_id;
Expand Down Expand Up @@ -861,7 +871,7 @@ typedef string UntrustedString;
typedef string NodeAlias;

[Custom]
typedef string OrderId;
typedef string LSPS1OrderId;

[Custom]
typedef string DateTime;
typedef string LSPSDateTime;
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ match_block_trailing_comma = true
# UNSTABLE: format_macro_matchers = true
# UNSTABLE: format_strings = true
# UNSTABLE: group_imports = "StdExternalCrate"
# UNSTABLE: reorder_imports = true
# UNSTABLE: imports_granularity = "Module"
Loading
Loading