@@ -195,9 +195,10 @@ pub trait ChannelKeys : Send+Clone {
195
195
fn funding_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
196
196
/// Gets the local secret key for blinded revocation pubkey
197
197
fn revocation_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
198
- /// Gets the local secret key used in to_remote output of remote commitment tx
199
- /// (and also as part of obscured commitment number)
200
- fn payment_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
198
+ /// Gets the local secret key used in the to_remote output of remote commitment tx (ie the
199
+ /// output to us in transactions our counterparty broadcasts).
200
+ /// Also as part of obscured commitment number.
201
+ fn payment_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
201
202
/// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
202
203
fn delayed_payment_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
203
204
/// Gets the local htlc secret key used in commitment tx htlc outputs
@@ -244,8 +245,8 @@ pub struct InMemoryChannelKeys {
244
245
funding_key : SecretKey ,
245
246
/// Local secret key for blinded revocation pubkey
246
247
revocation_base_key : SecretKey ,
247
- /// Local secret key used in commitment tx htlc outputs
248
- payment_base_key : SecretKey ,
248
+ /// Local secret key used in commitment txn generated by us (for broadcast by our counterparty)
249
+ payment_key : SecretKey ,
249
250
/// Local secret key used in HTLC tx
250
251
delayed_payment_base_key : SecretKey ,
251
252
/// Local htlc secret key used in commitment tx htlc outputs
@@ -266,19 +267,19 @@ impl InMemoryChannelKeys {
266
267
secp_ctx : & Secp256k1 < C > ,
267
268
funding_key : SecretKey ,
268
269
revocation_base_key : SecretKey ,
269
- payment_base_key : SecretKey ,
270
+ payment_key : SecretKey ,
270
271
delayed_payment_base_key : SecretKey ,
271
272
htlc_base_key : SecretKey ,
272
273
commitment_seed : [ u8 ; 32 ] ,
273
274
channel_value_satoshis : u64 ) -> InMemoryChannelKeys {
274
275
let local_channel_pubkeys =
275
276
InMemoryChannelKeys :: make_local_keys ( secp_ctx, & funding_key, & revocation_base_key,
276
- & payment_base_key , & delayed_payment_base_key,
277
+ & payment_key , & delayed_payment_base_key,
277
278
& htlc_base_key) ;
278
279
InMemoryChannelKeys {
279
280
funding_key,
280
281
revocation_base_key,
281
- payment_base_key ,
282
+ payment_key ,
282
283
delayed_payment_base_key,
283
284
htlc_base_key,
284
285
commitment_seed,
@@ -291,14 +292,14 @@ impl InMemoryChannelKeys {
291
292
fn make_local_keys < C : Signing > ( secp_ctx : & Secp256k1 < C > ,
292
293
funding_key : & SecretKey ,
293
294
revocation_base_key : & SecretKey ,
294
- payment_base_key : & SecretKey ,
295
+ payment_key : & SecretKey ,
295
296
delayed_payment_base_key : & SecretKey ,
296
297
htlc_base_key : & SecretKey ) -> ChannelPublicKeys {
297
298
let from_secret = |s : & SecretKey | PublicKey :: from_secret_key ( secp_ctx, s) ;
298
299
ChannelPublicKeys {
299
300
funding_pubkey : from_secret ( & funding_key) ,
300
301
revocation_basepoint : from_secret ( & revocation_base_key) ,
301
- payment_basepoint : from_secret ( & payment_base_key ) ,
302
+ payment_point : from_secret ( & payment_key ) ,
302
303
delayed_payment_basepoint : from_secret ( & delayed_payment_base_key) ,
303
304
htlc_basepoint : from_secret ( & htlc_base_key) ,
304
305
}
@@ -308,7 +309,7 @@ impl InMemoryChannelKeys {
308
309
impl ChannelKeys for InMemoryChannelKeys {
309
310
fn funding_key ( & self ) -> & SecretKey { & self . funding_key }
310
311
fn revocation_base_key ( & self ) -> & SecretKey { & self . revocation_base_key }
311
- fn payment_base_key ( & self ) -> & SecretKey { & self . payment_base_key }
312
+ fn payment_key ( & self ) -> & SecretKey { & self . payment_key }
312
313
fn delayed_payment_base_key ( & self ) -> & SecretKey { & self . delayed_payment_base_key }
313
314
fn htlc_base_key ( & self ) -> & SecretKey { & self . htlc_base_key }
314
315
fn commitment_seed ( & self ) -> & [ u8 ; 32 ] { & self . commitment_seed }
@@ -372,7 +373,7 @@ impl Writeable for InMemoryChannelKeys {
372
373
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
373
374
self . funding_key . write ( writer) ?;
374
375
self . revocation_base_key . write ( writer) ?;
375
- self . payment_base_key . write ( writer) ?;
376
+ self . payment_key . write ( writer) ?;
376
377
self . delayed_payment_base_key . write ( writer) ?;
377
378
self . htlc_base_key . write ( writer) ?;
378
379
self . commitment_seed . write ( writer) ?;
@@ -387,7 +388,7 @@ impl Readable for InMemoryChannelKeys {
387
388
fn read < R : :: std:: io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
388
389
let funding_key = Readable :: read ( reader) ?;
389
390
let revocation_base_key = Readable :: read ( reader) ?;
390
- let payment_base_key = Readable :: read ( reader) ?;
391
+ let payment_key = Readable :: read ( reader) ?;
391
392
let delayed_payment_base_key = Readable :: read ( reader) ?;
392
393
let htlc_base_key = Readable :: read ( reader) ?;
393
394
let commitment_seed = Readable :: read ( reader) ?;
@@ -396,13 +397,13 @@ impl Readable for InMemoryChannelKeys {
396
397
let secp_ctx = Secp256k1 :: signing_only ( ) ;
397
398
let local_channel_pubkeys =
398
399
InMemoryChannelKeys :: make_local_keys ( & secp_ctx, & funding_key, & revocation_base_key,
399
- & payment_base_key , & delayed_payment_base_key,
400
+ & payment_key , & delayed_payment_base_key,
400
401
& htlc_base_key) ;
401
402
402
403
Ok ( InMemoryChannelKeys {
403
404
funding_key,
404
405
revocation_base_key,
405
- payment_base_key ,
406
+ payment_key ,
406
407
delayed_payment_base_key,
407
408
htlc_base_key,
408
409
commitment_seed,
@@ -548,15 +549,15 @@ impl KeysInterface for KeysManager {
548
549
}
549
550
let funding_key = key_step ! ( b"funding key" , commitment_seed) ;
550
551
let revocation_base_key = key_step ! ( b"revocation base key" , funding_key) ;
551
- let payment_base_key = key_step ! ( b"payment base key" , revocation_base_key) ;
552
- let delayed_payment_base_key = key_step ! ( b"delayed payment base key" , payment_base_key ) ;
552
+ let payment_key = key_step ! ( b"payment base key" , revocation_base_key) ;
553
+ let delayed_payment_base_key = key_step ! ( b"delayed payment base key" , payment_key ) ;
553
554
let htlc_base_key = key_step ! ( b"HTLC base key" , delayed_payment_base_key) ;
554
555
555
556
InMemoryChannelKeys :: new (
556
557
& self . secp_ctx ,
557
558
funding_key,
558
559
revocation_base_key,
559
- payment_base_key ,
560
+ payment_key ,
560
561
delayed_payment_base_key,
561
562
htlc_base_key,
562
563
commitment_seed,
0 commit comments