You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(advanced-guides): audit Key Management, Fee Estimation, Probing for LDK 0.2
- Probing: fix `Event::ailed` typo (-> Event::ProbeFailed) and update the
outdated process_events_async call (add onion_messenger, liquidity manager,
and output sweeper arguments).
- Fee Estimation: bump the Cargo.toml example off 0.0.124 to lightning 0.2.2 /
siblings 0.2.0 / lightning-invoice 0.34.0, edition 2021. (ConfirmationTarget
coverage was already current.)
- Key Management: add the new KeysManager v2_remote_key_derivation flag
everywhere; update the custom SignerProvider wrapper to the 0.2 trait
(EcdsaSigner, get_destination_script(channel_keys_id) -> ScriptBuf,
drop channel_value_satoshis from generate_channel_keys_id/derive_channel_signer,
spend_spendable_outputs via OutputSpender with ScriptBuf/Option<LockTime>);
fix the events::Event path and docs.rs link; remove Swift tabs; add TypeScript
to the simple init examples; link to LDK Node's production wrapper.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LDK provides a simple default `KeysManager` implementation that takes a 32-byte seed for use as a BIP 32 extended key and derives keys from that. Check out the [Rust docs](https://docs.rs/lightning/*/lightning/sign/struct.KeysManager.html).
3
+
LDK provides a simple default `KeysManager` implementation that takes a 32-byte seed for use as a BIP 32 extended key and derives keys from that. Check out the [Rust docs](https://docs.rs/lightning/0.2.2/lightning/sign/struct.KeysManager.html).
4
4
5
5
However, LDK also allows to customize the way key material and entropy are sourced through custom implementations of the `NodeSigner`, `SignerProvider`, and `EntropySource` traits located in `sign`. These traits include basic methods to provide public and private key material, as well as pseudorandom numbers.
6
6
@@ -12,28 +12,32 @@ A `KeysManager` can be constructed simply with only a 32-byte seed and some rand
12
12
// Fill in random_32_bytes with secure random data, or, on restart, reload the seed from disk.
@@ -118,7 +117,7 @@ An advantage to this approach is that the LDK entropy is contained within your i
118
117
119
118
# Spending On-Chain Funds
120
119
121
-
When a channel has been closed and some outputs on chain are spendable only by us, LDK provides a `util::events::Event::SpendableOutputs` event in return from `ChannelMonitor::get_and_clear_pending_events()`. It contains a list of `sign::SpendableOutputDescriptor` objects which describe the output and provide all necessary information to spend it.
120
+
When a channel has been closed and some outputs on chain are spendable only by us, LDK provides a `events::Event::SpendableOutputs` event in return from `ChannelMonitor::get_and_clear_pending_events()`. It contains a list of `sign::SpendableOutputDescriptor` objects which describe the output and provide all necessary information to spend it.
122
121
123
122
If you're using `KeysManager` directly, a utility method is provided which can generate a signed transaction given a list of `
124
123
SpendableOutputDescriptor` objects. `KeysManager::spend_spendable_outputs` can be called any time after receiving the `SpendableOutputDescriptor` objects to build a spending transaction, including delaying until sending funds to an external destination or opening a new channel. Note that if you open new channels directly with `SpendableOutputDescriptor` objects, you must ensure all closing/destination scripts provided to LDK are SegWit (either native or P2SH-wrapped).
@@ -129,6 +128,15 @@ In order to make the outputs from channel closing spendable by a third-party wal
129
128
130
129
For example, a wrapper based on BDK's [`Wallet`](https://docs.rs/bdk/*/bdk/wallet/struct.Wallet.html) could look like this:
131
130
131
+
::: tip Note
132
+
The `SignerProvider` trait changed in 0.2: `generate_channel_keys_id` and
133
+
`derive_channel_signer` no longer take `channel_value_satoshis`,
134
+
`get_destination_script` now takes a `channel_keys_id` and returns `ScriptBuf`,
135
+
and `spend_spendable_outputs` lives on the separate `OutputSpender` trait
136
+
(implemented by `KeysManager`). For a production-grade wrapper, see
0 commit comments