@@ -196,9 +196,10 @@ pub trait ChannelKeys : Send+Clone {
196196 fn funding_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
197197 /// Gets the local secret key for blinded revocation pubkey
198198 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 ;
202203 /// Gets the local secret key used in HTLC-Success/HTLC-Timeout txn and to_local output
203204 fn delayed_payment_base_key < ' a > ( & ' a self ) -> & ' a SecretKey ;
204205 /// Gets the local htlc secret key used in commitment tx htlc outputs
@@ -275,8 +276,8 @@ pub struct InMemoryChannelKeys {
275276 funding_key : SecretKey ,
276277 /// Local secret key for blinded revocation pubkey
277278 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 ,
280281 /// Local secret key used in HTLC tx
281282 delayed_payment_base_key : SecretKey ,
282283 /// Local htlc secret key used in commitment tx htlc outputs
@@ -297,19 +298,19 @@ impl InMemoryChannelKeys {
297298 secp_ctx : & Secp256k1 < C > ,
298299 funding_key : SecretKey ,
299300 revocation_base_key : SecretKey ,
300- payment_base_key : SecretKey ,
301+ payment_key : SecretKey ,
301302 delayed_payment_base_key : SecretKey ,
302303 htlc_base_key : SecretKey ,
303304 commitment_seed : [ u8 ; 32 ] ,
304305 channel_value_satoshis : u64 ) -> InMemoryChannelKeys {
305306 let local_channel_pubkeys =
306307 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,
308309 & htlc_base_key) ;
309310 InMemoryChannelKeys {
310311 funding_key,
311312 revocation_base_key,
312- payment_base_key ,
313+ payment_key ,
313314 delayed_payment_base_key,
314315 htlc_base_key,
315316 commitment_seed,
@@ -322,14 +323,14 @@ impl InMemoryChannelKeys {
322323 fn make_local_keys < C : Signing > ( secp_ctx : & Secp256k1 < C > ,
323324 funding_key : & SecretKey ,
324325 revocation_base_key : & SecretKey ,
325- payment_base_key : & SecretKey ,
326+ payment_key : & SecretKey ,
326327 delayed_payment_base_key : & SecretKey ,
327328 htlc_base_key : & SecretKey ) -> ChannelPublicKeys {
328329 let from_secret = |s : & SecretKey | PublicKey :: from_secret_key ( secp_ctx, s) ;
329330 ChannelPublicKeys {
330331 funding_pubkey : from_secret ( & funding_key) ,
331332 revocation_basepoint : from_secret ( & revocation_base_key) ,
332- payment_basepoint : from_secret ( & payment_base_key ) ,
333+ payment_point : from_secret ( & payment_key ) ,
333334 delayed_payment_basepoint : from_secret ( & delayed_payment_base_key) ,
334335 htlc_basepoint : from_secret ( & htlc_base_key) ,
335336 }
@@ -339,7 +340,7 @@ impl InMemoryChannelKeys {
339340impl ChannelKeys for InMemoryChannelKeys {
340341 fn funding_key ( & self ) -> & SecretKey { & self . funding_key }
341342 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 }
343344 fn delayed_payment_base_key ( & self ) -> & SecretKey { & self . delayed_payment_base_key }
344345 fn htlc_base_key ( & self ) -> & SecretKey { & self . htlc_base_key }
345346 fn commitment_seed ( & self ) -> & [ u8 ; 32 ] { & self . commitment_seed }
@@ -424,7 +425,7 @@ impl Writeable for InMemoryChannelKeys {
424425 fn write < W : Writer > ( & self , writer : & mut W ) -> Result < ( ) , Error > {
425426 self . funding_key . write ( writer) ?;
426427 self . revocation_base_key . write ( writer) ?;
427- self . payment_base_key . write ( writer) ?;
428+ self . payment_key . write ( writer) ?;
428429 self . delayed_payment_base_key . write ( writer) ?;
429430 self . htlc_base_key . write ( writer) ?;
430431 self . commitment_seed . write ( writer) ?;
@@ -439,7 +440,7 @@ impl Readable for InMemoryChannelKeys {
439440 fn read < R : :: std:: io:: Read > ( reader : & mut R ) -> Result < Self , DecodeError > {
440441 let funding_key = Readable :: read ( reader) ?;
441442 let revocation_base_key = Readable :: read ( reader) ?;
442- let payment_base_key = Readable :: read ( reader) ?;
443+ let payment_key = Readable :: read ( reader) ?;
443444 let delayed_payment_base_key = Readable :: read ( reader) ?;
444445 let htlc_base_key = Readable :: read ( reader) ?;
445446 let commitment_seed = Readable :: read ( reader) ?;
@@ -448,13 +449,13 @@ impl Readable for InMemoryChannelKeys {
448449 let secp_ctx = Secp256k1 :: signing_only ( ) ;
449450 let local_channel_pubkeys =
450451 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,
452453 & htlc_base_key) ;
453454
454455 Ok ( InMemoryChannelKeys {
455456 funding_key,
456457 revocation_base_key,
457- payment_base_key ,
458+ payment_key ,
458459 delayed_payment_base_key,
459460 htlc_base_key,
460461 commitment_seed,
@@ -600,15 +601,15 @@ impl KeysInterface for KeysManager {
600601 }
601602 let funding_key = key_step ! ( b"funding key" , commitment_seed) ;
602603 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 ) ;
605606 let htlc_base_key = key_step ! ( b"HTLC base key" , delayed_payment_base_key) ;
606607
607608 InMemoryChannelKeys :: new (
608609 & self . secp_ctx ,
609610 funding_key,
610611 revocation_base_key,
611- payment_base_key ,
612+ payment_key ,
612613 delayed_payment_base_key,
613614 htlc_base_key,
614615 commitment_seed,
0 commit comments