@@ -241,10 +241,13 @@ typedef struct LDKPublicKey {
241
241
uint8_t compressed_form [33 ];
242
242
} LDKPublicKey ;
243
243
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 ;
248
251
249
252
/**
250
253
* When on-chain outputs are created by rust-lightning (which our counterparty is not able to
@@ -255,9 +258,9 @@ typedef struct LDKC2Tuple_u64u64Z {
255
258
*/
256
259
typedef enum LDKSpendableOutputDescriptor_Tag {
257
260
/**
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 .
261
264
* These may include outputs from a transaction punishing our counterparty or claiming an HTLC
262
265
* on-chain using the payment preimage or after it has timed out.
263
266
*/
@@ -319,14 +322,16 @@ typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body {
319
322
struct LDKPublicKey per_commitment_point ;
320
323
uint16_t to_self_delay ;
321
324
struct LDKTxOut output ;
322
- struct LDKC2Tuple_u64u64Z key_derivation_params ;
323
325
struct LDKPublicKey revocation_pubkey ;
326
+ struct LDKThirtyTwoBytes channel_keys_id ;
327
+ uint64_t channel_value_satoshis ;
324
328
} LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body ;
325
329
326
330
typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body {
327
331
struct LDKOutPoint outpoint ;
328
332
struct LDKTxOut output ;
329
- struct LDKC2Tuple_u64u64Z key_derivation_params ;
333
+ struct LDKThirtyTwoBytes channel_keys_id ;
334
+ uint64_t channel_value_satoshis ;
330
335
} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body ;
331
336
332
337
typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
@@ -889,14 +894,6 @@ typedef struct LDKCVec_MessageSendEventZ {
889
894
uintptr_t datalen ;
890
895
} LDKCVec_MessageSendEventZ ;
891
896
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
-
900
897
/**
901
898
* An Event which you should probably take some action in response to.
902
899
*
@@ -1349,11 +1346,11 @@ typedef struct LDKChannelKeys {
1349
1346
*/
1350
1347
void (* set_pubkeys )(const struct LDKChannelKeys * NONNULL_PTR );
1351
1348
/**
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
1354
1351
* ChannelKeys object uniquely and lookup or re-derive its keys.
1355
1352
*/
1356
- struct LDKC2Tuple_u64u64Z (* key_derivation_params )(const void * this_arg );
1353
+ struct LDKThirtyTwoBytes (* channel_keys_id )(const void * this_arg );
1357
1354
/**
1358
1355
* Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
1359
1356
*
@@ -1849,26 +1846,39 @@ typedef struct LDKu8slice {
1849
1846
typedef struct LDKKeysInterface {
1850
1847
void * this_arg ;
1851
1848
/**
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.
1853
1852
*/
1854
1853
struct LDKSecretKey (* get_node_secret )(const void * this_arg );
1855
1854
/**
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.
1857
1859
*/
1858
1860
struct LDKCVec_u8Z (* get_destination_script )(const void * this_arg );
1859
1861
/**
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.
1861
1867
*/
1862
1868
struct LDKPublicKey (* get_shutdown_pubkey )(const void * this_arg );
1863
1869
/**
1864
1870
* Get a new set of ChannelKeys for per-channel secrets. These MUST be unique even if you
1865
1871
* restarted with some stale data!
1872
+ *
1873
+ * This method must return a different value each time it is called.
1866
1874
*/
1867
1875
struct LDKChannelKeys (* get_channel_keys )(const void * this_arg , bool inbound , uint64_t channel_value_satoshis );
1868
1876
/**
1869
1877
* Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
1870
1878
* onion packets and for temporary channel IDs. There is no requirement that these be
1871
1879
* persisted anywhere, though they must be unique across restarts.
1880
+ *
1881
+ * This method must return a different value each time it is called.
1872
1882
*/
1873
1883
struct LDKThirtyTwoBytes (* get_secure_random_bytes )(const void * this_arg );
1874
1884
/**
@@ -3548,12 +3558,6 @@ struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_B
3548
3558
3549
3559
void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free (struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res );
3550
3560
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
-
3557
3561
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok (struct LDKSpendableOutputDescriptor o );
3558
3562
3559
3563
struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err (struct LDKDecodeError e );
@@ -4686,7 +4690,7 @@ void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONN
4686
4690
/**
4687
4691
* Create a new InMemoryChannelKeys
4688
4692
*/
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 );
4690
4694
4691
4695
/**
4692
4696
* Counterparty pubkeys.
@@ -4765,10 +4769,10 @@ MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], en
4765
4769
* Derive an old set of ChannelKeys for per-channel secrets based on a key derivation
4766
4770
* parameters.
4767
4771
* 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
4769
4773
* onchain output detection for which a corresponding delayed_payment_key must be derived.
4770
4774
*/
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 ] );
4772
4776
4773
4777
struct LDKKeysInterface KeysManager_as_KeysInterface (const struct LDKKeysManager * NONNULL_PTR this_arg );
4774
4778
0 commit comments