@@ -241,10 +241,13 @@ typedef struct LDKPublicKey {
241241 uint8_t compressed_form [33 ];
242242} LDKPublicKey ;
243243
244- typedef struct LDKC2Tuple_u64u64Z {
245- uint64_t a ;
246- uint64_t b ;
247- } LDKC2Tuple_u64u64Z ;
244+ /**
245+ * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
246+ * look up the corresponding function in rust-lightning's docs.
247+ */
248+ typedef struct LDKThirtyTwoBytes {
249+ uint8_t data [32 ];
250+ } LDKThirtyTwoBytes ;
248251
249252/**
250253 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
@@ -255,9 +258,9 @@ typedef struct LDKC2Tuple_u64u64Z {
255258 */
256259typedef enum LDKSpendableOutputDescriptor_Tag {
257260 /**
258- * An output to a script which was provided via KeysInterface, thus you should already know
259- * how to spend it. No keys are provided as rust-lightning was never given any keys - only the
260- * script_pubkey as it appears in the output .
261+ * An output to a script which was provided via KeysInterface directly, either from
262+ * `get_destination_script()` or `get_shutdown_pubkey()`, thus you should already know how to
263+ * spend it. No secret keys are provided as rust-lightning was never given any key .
261264 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
262265 * on-chain using the payment preimage or after it has timed out.
263266 */
@@ -319,14 +322,16 @@ typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body {
319322 struct LDKPublicKey per_commitment_point ;
320323 uint16_t to_self_delay ;
321324 struct LDKTxOut output ;
322- struct LDKC2Tuple_u64u64Z key_derivation_params ;
323325 struct LDKPublicKey revocation_pubkey ;
326+ struct LDKThirtyTwoBytes channel_keys_id ;
327+ uint64_t channel_value_satoshis ;
324328} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body ;
325329
326330typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body {
327331 struct LDKOutPoint outpoint ;
328332 struct LDKTxOut output ;
329- struct LDKC2Tuple_u64u64Z key_derivation_params ;
333+ struct LDKThirtyTwoBytes channel_keys_id ;
334+ uint64_t channel_value_satoshis ;
330335} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body ;
331336
332337typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
@@ -889,14 +894,6 @@ typedef struct LDKCVec_MessageSendEventZ {
889894 uintptr_t datalen ;
890895} LDKCVec_MessageSendEventZ ;
891896
892- /**
893- * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
894- * look up the corresponding function in rust-lightning's docs.
895- */
896- typedef struct LDKThirtyTwoBytes {
897- uint8_t data [32 ];
898- } LDKThirtyTwoBytes ;
899-
900897/**
901898 * An Event which you should probably take some action in response to.
902899 *
@@ -1349,11 +1346,11 @@ typedef struct LDKChannelKeys {
13491346 */
13501347 void (* set_pubkeys )(const struct LDKChannelKeys * NONNULL_PTR );
13511348 /**
1352- * Gets arbitrary identifiers describing the set of keys which are provided back to you in
1353- * some SpendableOutputDescriptor types. These should be sufficient to identify this
1349+ * Gets an arbitrary identifier describing the set of keys which are provided back to you in
1350+ * some SpendableOutputDescriptor types. This should be sufficient to identify this
13541351 * ChannelKeys object uniquely and lookup or re-derive its keys.
13551352 */
1356- struct LDKC2Tuple_u64u64Z (* key_derivation_params )(const void * this_arg );
1353+ struct LDKThirtyTwoBytes (* channel_keys_id )(const void * this_arg );
13571354 /**
13581355 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
13591356 *
@@ -1849,26 +1846,39 @@ typedef struct LDKu8slice {
18491846typedef struct LDKKeysInterface {
18501847 void * this_arg ;
18511848 /**
1852- * Get node secret key (aka node_id or network_key)
1849+ * Get node secret key (aka node_id or network_key).
1850+ *
1851+ * This method must return the same value each time it is called.
18531852 */
18541853 struct LDKSecretKey (* get_node_secret )(const void * this_arg );
18551854 /**
1856- * Get destination redeemScript to encumber static protocol exit points.
1855+ * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
1856+ *
1857+ * This method should return a different value each time it is called, to avoid linking
1858+ * on-chain funds across channels as controlled to the same user.
18571859 */
18581860 struct LDKCVec_u8Z (* get_destination_script )(const void * this_arg );
18591861 /**
1860- * Get shutdown_pubkey to use as PublicKey at channel closure
1862+ * Get a public key which we will send funds to (in the form of a P2WPKH output) when closing
1863+ * a channel.
1864+ *
1865+ * This method should return a different value each time it is called, to avoid linking
1866+ * on-chain funds across channels as controlled to the same user.
18611867 */
18621868 struct LDKPublicKey (* get_shutdown_pubkey )(const void * this_arg );
18631869 /**
18641870 * Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
18651871 * restarted with some stale data!
1872+ *
1873+ * This method must return a different value each time it is called.
18661874 */
18671875 struct LDKChannelKeys (* get_channel_keys )(const void * this_arg , bool inbound , uint64_t channel_value_satoshis );
18681876 /**
18691877 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
18701878 * onion packets and for temporary channel IDs. There is no requirement that these be
18711879 * persisted anywhere, though they must be unique across restarts.
1880+ *
1881+ * This method must return a different value each time it is called.
18721882 */
18731883 struct LDKThirtyTwoBytes (* get_secure_random_bytes )(const void * this_arg );
18741884 /**
@@ -3548,12 +3558,6 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_B
35483558
35493559void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free (struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res );
35503560
3551- struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone (const struct LDKC2Tuple_u64u64Z * NONNULL_PTR orig );
3552-
3553- struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new (uint64_t a , uint64_t b );
3554-
3555- void C2Tuple_u64u64Z_free (struct LDKC2Tuple_u64u64Z _res );
3556-
35573561struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok (struct LDKSpendableOutputDescriptor o );
35583562
35593563struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err (struct LDKDecodeError e );
@@ -4686,7 +4690,7 @@ void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONN
46864690/**
46874691 * Create a new InMemoryChannelKeys
46884692 */
4689- MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new (struct LDKSecretKey funding_key , struct LDKSecretKey revocation_base_key , struct LDKSecretKey payment_key , struct LDKSecretKey delayed_payment_base_key , struct LDKSecretKey htlc_base_key , struct LDKThirtyTwoBytes commitment_seed , uint64_t channel_value_satoshis , struct LDKC2Tuple_u64u64Z key_derivation_params );
4693+ MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new (struct LDKSecretKey funding_key , struct LDKSecretKey revocation_base_key , struct LDKSecretKey payment_key , struct LDKSecretKey delayed_payment_base_key , struct LDKSecretKey htlc_base_key , struct LDKThirtyTwoBytes commitment_seed , uint64_t channel_value_satoshis , struct LDKThirtyTwoBytes channel_keys_id );
46904694
46914695/**
46924696 * Counterparty pubkeys.
@@ -4765,10 +4769,10 @@ MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], en
47654769 * Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
47664770 * parameters.
47674771 * Key derivation parameters are accessible through a per-channel secrets
4768- * ChannelKeys::key_derivation_params and is provided inside DynamicOuputP2WSH in case of
4772+ * ChannelKeys::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
47694773 * onchain output detection for which a corresponding delayed_payment_key must be derived.
47704774 */
4771- MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys (const struct LDKKeysManager * NONNULL_PTR this_arg , uint64_t channel_value_satoshis , uint64_t params_1 , uint64_t params_2 );
4775+ MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys (const struct LDKKeysManager * NONNULL_PTR this_arg , uint64_t channel_value_satoshis , const uint8_t ( * params )[ 32 ] );
47724776
47734777struct LDKKeysInterface KeysManager_as_KeysInterface (const struct LDKKeysManager * NONNULL_PTR this_arg );
47744778
0 commit comments