@@ -196,9 +196,10 @@ pub trait ChannelKeys : Send+Clone {
196
196
fn funding_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
197
197
/// Gets the local secret key for blinded revocation pubkey
198
198
fn revocation_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
199
- /// Gets the local secret key used in to_remote output of remote commitment tx
200
- /// (and also as part of obscured commitment number)
201
- fn payment_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
199
+ /// Gets the local secret key used in the to_remote output of remote commitment tx (ie the
200
+ /// output to us in transactions our counterparty broadcasts).
201
+ /// Also as part of obscured commitment number.
202
+ fn payment_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
202
203
/// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
203
204
fn delayed_payment_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
204
205
/// Gets the local htlc secret key used in commitment tx htlc outputs
@@ -275,8 +276,8 @@ pub struct InMemoryChannelKeys {
275
276
funding_key : SecretKey ,
276
277
/// Local secret key for blinded revocation pubkey
277
278
revocation_base_key : SecretKey ,
278
- /// Local secret key used in commitment tx htlc outputs
279
- payment_base_key : SecretKey ,
279
+ /// Local secret key used in commitment txn generated by us (for broadcast by our counterparty)
280
+ payment_key : SecretKey ,
280
281
/// Local secret key used in HTLC tx
281
282
delayed_payment_base_key : SecretKey ,
282
283
/// Local htlc secret key used in commitment tx htlc outputs
@@ -297,19 +298,19 @@ impl InMemoryChannelKeys {
297
298
secp_ctx : & Secp256k1 < C > ,
298
299
funding_key : SecretKey ,
299
300
revocation_base_key : SecretKey ,
300
- payment_base_key : SecretKey ,
301
+ payment_key : SecretKey ,
301
302
delayed_payment_base_key : SecretKey ,
302
303
htlc_base_key : SecretKey ,
303
304
commitment_seed : [ u8 ; 32 ] ,
304
305
channel_value_satoshis : u64 ) -> InMemoryChannelKeys {
305
306
let local_channel_pubkeys =
306
307
InMemoryChannelKeys :: make_local_keys ( secp_ctx, & funding_key, & revocation_base_key,
307
- & payment_base_key , & delayed_payment_base_key,
308
+ & payment_key , & delayed_payment_base_key,
308
309
& htlc_base_key) ;
309
310
InMemoryChannelKeys {
310
311
funding_key,
311
312
revocation_base_key,
312
- payment_base_key ,
313
+ payment_key ,
313
314
delayed_payment_base_key,
314
315
htlc_base_key,
315
316
commitment_seed,
@@ -322,14 +323,14 @@ impl InMemoryChannelKeys {
322
323
fn make_local_keys < C : Signing > ( secp_ctx : & Secp256k1 < C > ,
323
324
funding_key : & SecretKey ,
324
325
revocation_base_key : & SecretKey ,
325
- payment_base_key : & SecretKey ,
326
+ payment_key : & SecretKey ,
326
327
delayed_payment_base_key : & SecretKey ,
327
328
htlc_base_key : & SecretKey ) -> ChannelPublicKeys {
328
329
let from_secret = |s : & SecretKey | PublicKey :: from_secret_key ( secp_ctx, s) ;
329
330
ChannelPublicKeys {
330
331
funding_pubkey : from_secret ( & funding_key) ,
331
332
revocation_basepoint : from_secret ( & revocation_base_key) ,
332
- payment_basepoint : from_secret ( & payment_base_key ) ,
333
+ payment_point : from_secret ( & payment_key ) ,
333
334
delayed_payment_basepoint : from_secret ( & delayed_payment_base_key) ,
334
335
htlc_basepoint : from_secret ( & htlc_base_key) ,
335
336
}
@@ -339,7 +340,7 @@ impl InMemoryChannelKeys {
339
340
impl ChannelKeys for InMemoryChannelKeys {
340
341
fn funding_key ( & self ) -> & SecretKey { & self . funding_key }
341
342
fn revocation_base_key ( & self ) -> & SecretKey { & self . revocation_base_key }
342
- fn payment_base_key ( & self ) -> & SecretKey { & self . payment_base_key }
343
+ fn payment_key ( & self ) -> & SecretKey { & self . payment_key }
343
344
fn delayed_payment_base_key ( & self ) -> & SecretKey { & self . delayed_payment_base_key }
344
345
fn htlc_base_key ( & self ) -> & SecretKey { & self . htlc_base_key }
345
346
fn commitment_seed ( & self ) -> & [ u8 ; 32 ] { & self . commitment_seed }
@@ -424,7 +425,7 @@ impl Writeable for InMemoryChannelKeys {
424
425
fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
425
426
self . funding_key . write ( writer) ?;
426
427
self . revocation_base_key . write ( writer) ?;
427
- self . payment_base_key . write ( writer) ?;
428
+ self . payment_key . write ( writer) ?;
428
429
self . delayed_payment_base_key . write ( writer) ?;
429
430
self . htlc_base_key . write ( writer) ?;
430
431
self . commitment_seed . write ( writer) ?;
@@ -439,7 +440,7 @@ impl Readable for InMemoryChannelKeys {
439
440
fn read < R : :: std:: io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
440
441
let funding_key = Readable :: read ( reader) ?;
441
442
let revocation_base_key = Readable :: read ( reader) ?;
442
- let payment_base_key = Readable :: read ( reader) ?;
443
+ let payment_key = Readable :: read ( reader) ?;
443
444
let delayed_payment_base_key = Readable :: read ( reader) ?;
444
445
let htlc_base_key = Readable :: read ( reader) ?;
445
446
let commitment_seed = Readable :: read ( reader) ?;
@@ -448,13 +449,13 @@ impl Readable for InMemoryChannelKeys {
448
449
let secp_ctx = Secp256k1 :: signing_only ( ) ;
449
450
let local_channel_pubkeys =
450
451
InMemoryChannelKeys :: make_local_keys ( & secp_ctx, & funding_key, & revocation_base_key,
451
- & payment_base_key , & delayed_payment_base_key,
452
+ & payment_key , & delayed_payment_base_key,
452
453
& htlc_base_key) ;
453
454
454
455
Ok ( InMemoryChannelKeys {
455
456
funding_key,
456
457
revocation_base_key,
457
- payment_base_key ,
458
+ payment_key ,
458
459
delayed_payment_base_key,
459
460
htlc_base_key,
460
461
commitment_seed,
@@ -600,15 +601,15 @@ impl KeysInterface for KeysManager {
600
601
}
601
602
let funding_key = key_step ! ( b"funding key" , commitment_seed) ;
602
603
let revocation_base_key = key_step ! ( b"revocation base key" , funding_key) ;
603
- let payment_base_key = key_step ! ( b"payment base key" , revocation_base_key) ;
604
- let delayed_payment_base_key = key_step ! ( b"delayed payment base key" , payment_base_key ) ;
604
+ let payment_key = key_step ! ( b"payment base key" , revocation_base_key) ;
605
+ let delayed_payment_base_key = key_step ! ( b"delayed payment base key" , payment_key ) ;
605
606
let htlc_base_key = key_step ! ( b"HTLC base key" , delayed_payment_base_key) ;
606
607
607
608
InMemoryChannelKeys :: new (
608
609
& self . secp_ctx ,
609
610
funding_key,
610
611
revocation_base_key,
611
- payment_base_key ,
612
+ payment_key ,
612
613
delayed_payment_base_key,
613
614
htlc_base_key,
614
615
commitment_seed,
0 commit comments