diff --git a/docs/key_management.md b/docs/key_management.md index e9aeb2cec..77e3c4804 100644 --- a/docs/key_management.md +++ b/docs/key_management.md @@ -1,8 +1,8 @@ # Key Management -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/chain/keysinterface/struct.KeysManager.html). +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). -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 `chain::keysinterface`. These traits include basic methods to provide public and private key material, as well as pseudorandom numbers. +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. A `KeysManager` can be constructed simply with only a 32-byte seed and some random integers which ensure uniqueness across restarts (defined as `starting_time_secs` and `starting_time_nanos`): @@ -13,7 +13,7 @@ A `KeysManager` can be constructed simply with only a 32-byte seed and some rand // Fill in random_32_bytes with secure random data, or, on restart, reload the seed from disk. let mut random_32_bytes = [0; 32]; let start_time = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap(); -let keys_interface_impl = lightning::chain::keysinterface::KeysManager::new(&random_32_bytes, start_time.as_secs(), start_time.subsec_nanos()); +let keys_interface_impl = lightning::sign::KeysManager::new(&random_32_bytes, start_time.as_secs(), start_time.subsec_nanos()); ``` @@ -181,7 +181,7 @@ An advantage to this approach is that the LDK entropy is contained within your i # Spending On-Chain Funds -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 `chain::keysinterface::SpendableOutputDescriptor` objects which describe the output and provide all necessary information to spend it. +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. If you're using `KeysManager` directly, a utility method is provided which can generate a signed transaction given a list of ` 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). diff --git a/docs/overview/private_key_management.md b/docs/overview/private_key_management.md index 8daeada34..8de382f19 100644 --- a/docs/overview/private_key_management.md +++ b/docs/overview/private_key_management.md @@ -4,4 +4,4 @@ LDK provides a default implementation for key management, but you can choose to While LDK's default implementation is currently located within the `rust-lightning` crate, it is still considered a sample module. -[LDK's `KeysManager` docs](https://docs.rs/lightning/*/lightning/chain/keysinterface/struct.KeysManager.html). +[LDK's `KeysManager` docs](https://docs.rs/lightning/*/lightning/sign/struct.KeysManager.html). diff --git a/docs/tutorials/build_a_node_in_java.md b/docs/tutorials/build_a_node_in_java.md index 05f1759c3..7f0508f77 100644 --- a/docs/tutorials/build_a_node_in_java.md +++ b/docs/tutorials/build_a_node_in_java.md @@ -310,7 +310,7 @@ generation is unique across restarts. **Dependencies:** random bytes -**References:** [Rust docs](https://docs.rs/lightning/*/lightning/chain/keysinterface/struct.KeysManager.html), [Java bindings](https://github.com/lightningdevkit/ldk-garbagecollected/blob/main/src/main/java/org/ldk/structs/KeysManager.java), [Key Management guide](/key_management.md) +**References:** [Rust docs](https://docs.rs/lightning/*/lightning/sign/struct.KeysManager.html), [Java bindings](https://github.com/lightningdevkit/ldk-garbagecollected/blob/main/src/main/java/org/ldk/structs/KeysManager.java), [Key Management guide](/key_management.md) ### 10. Read `ChannelMonitor`s from disk diff --git a/docs/tutorials/build_a_node_in_rust.md b/docs/tutorials/build_a_node_in_rust.md index 59ac1ee0a..99e3fe0bb 100644 --- a/docs/tutorials/build_a_node_in_rust.md +++ b/docs/tutorials/build_a_node_in_rust.md @@ -264,7 +264,7 @@ generation is unique across restarts. **Dependencies:** random bytes -**References:** [`KeysManager` docs](https://docs.rs/lightning/*/lightning/chain/keysinterface/struct.KeysManager.html), [Key Management guide](/key_management.md) +**References:** [`KeysManager` docs](https://docs.rs/lightning/*/lightning/sign/struct.KeysManager.html), [Key Management guide](/key_management.md) ### Step 7. Read `ChannelMonitor` state from disk