Skip to content

Commit c404bd7

Browse files
Merge key mgmt + onchain funds pages
1 parent a37bbd7 commit c404bd7

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

docs/key_mgmt.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ let mut random_32_bytes = [0; 32];
1717
let start_time = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap();
1818
let keys_interface_impl = lightning::chain::keysinterface::KeysManager::new(random_32-bytes, bitcoin::network::constants::Network::Bitcoin, start_time.as_secs(), start_time.subsec_nanos());
1919
```
20+
21+
Spending On-Chain Funds
22+
=======================
23+
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. `ChannelKeys` objects provide a unique id via the `key_derivation_params` function, who's value is provided back to you in the `SpendableOutputs` objects. For users of a `KeysManager` object, you can re-construct the `InMemoryChannelKeys` object using this information and fetch the relevant private keys from that. A `SpendableOutputDescriptor::StaticOutput` element does not have this information as the output is sent to an output which used only `KeysInterface` data, not per-channel data.

docs/onchain_funds.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
someSidebar: {
33
'Lightning Development Kit': ['overview', 'getting_started', 'use_cases', 'references'],
4-
Guides: ['build_node', 'open_channel', 'key_mgmt', 'blockdata', 'onchain_funds'],
4+
Guides: ['build_node', 'open_channel', 'key_mgmt', 'blockdata'],
55
},
66
};

0 commit comments

Comments
 (0)