@@ -51,6 +51,7 @@ use crate::ln::channel_keys::{
51
51
add_public_key_tweak, DelayedPaymentBasepoint , DelayedPaymentKey , HtlcBasepoint , HtlcKey ,
52
52
RevocationBasepoint , RevocationKey ,
53
53
} ;
54
+ use crate :: ln:: inbound_payment:: ExpandedKey ;
54
55
#[ cfg( taproot) ]
55
56
use crate :: ln:: msgs:: PartialSignatureWithNonce ;
56
57
use crate :: ln:: msgs:: { UnsignedChannelAnnouncement , UnsignedGossipMessage } ;
@@ -820,7 +821,7 @@ pub trait EntropySource {
820
821
821
822
/// A trait that can handle cryptographic operations at the scope level of a node.
822
823
pub trait NodeSigner {
823
- /// Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
824
+ /// Get the [`ExpandedKey`] for use in encrypting and decrypting inbound payment data.
824
825
///
825
826
/// If the implementor of this trait supports [phantom node payments], then every node that is
826
827
/// intended to be included in the phantom invoice route hints must return the same value from
@@ -832,7 +833,7 @@ pub trait NodeSigner {
832
833
/// This method must return the same value each time it is called.
833
834
///
834
835
/// [phantom node payments]: PhantomKeysManager
835
- fn get_inbound_payment_key_material ( & self ) -> KeyMaterial ;
836
+ fn get_inbound_payment_key ( & self ) -> ExpandedKey ;
836
837
837
838
/// Get node id based on the provided [`Recipient`].
838
839
///
@@ -1852,7 +1853,7 @@ pub struct KeysManager {
1852
1853
secp_ctx : Secp256k1 < secp256k1:: All > ,
1853
1854
node_secret : SecretKey ,
1854
1855
node_id : PublicKey ,
1855
- inbound_payment_key : KeyMaterial ,
1856
+ inbound_payment_key : ExpandedKey ,
1856
1857
destination_script : ScriptBuf ,
1857
1858
shutdown_pubkey : PublicKey ,
1858
1859
channel_master_key : Xpriv ,
@@ -1938,7 +1939,7 @@ impl KeysManager {
1938
1939
secp_ctx,
1939
1940
node_secret,
1940
1941
node_id,
1941
- inbound_payment_key : KeyMaterial ( inbound_pmt_key_bytes) ,
1942
+ inbound_payment_key : ExpandedKey :: new ( & KeyMaterial ( inbound_pmt_key_bytes) ) ,
1942
1943
1943
1944
destination_script,
1944
1945
shutdown_pubkey,
@@ -2175,7 +2176,7 @@ impl NodeSigner for KeysManager {
2175
2176
Ok ( SharedSecret :: new ( other_key, & node_secret) )
2176
2177
}
2177
2178
2178
- fn get_inbound_payment_key_material ( & self ) -> KeyMaterial {
2179
+ fn get_inbound_payment_key ( & self ) -> ExpandedKey {
2179
2180
self . inbound_payment_key . clone ( )
2180
2181
}
2181
2182
@@ -2312,7 +2313,7 @@ pub struct PhantomKeysManager {
2312
2313
pub ( crate ) inner : KeysManager ,
2313
2314
#[ cfg( not( test) ) ]
2314
2315
inner : KeysManager ,
2315
- inbound_payment_key : KeyMaterial ,
2316
+ inbound_payment_key : ExpandedKey ,
2316
2317
phantom_secret : SecretKey ,
2317
2318
phantom_node_id : PublicKey ,
2318
2319
}
@@ -2344,7 +2345,7 @@ impl NodeSigner for PhantomKeysManager {
2344
2345
Ok ( SharedSecret :: new ( other_key, & node_secret) )
2345
2346
}
2346
2347
2347
- fn get_inbound_payment_key_material ( & self ) -> KeyMaterial {
2348
+ fn get_inbound_payment_key ( & self ) -> ExpandedKey {
2348
2349
self . inbound_payment_key . clone ( )
2349
2350
}
2350
2351
@@ -2444,7 +2445,7 @@ impl PhantomKeysManager {
2444
2445
let phantom_node_id = PublicKey :: from_secret_key ( & inner. secp_ctx , & phantom_secret) ;
2445
2446
Self {
2446
2447
inner,
2447
- inbound_payment_key : KeyMaterial ( inbound_key) ,
2448
+ inbound_payment_key : ExpandedKey :: new ( & KeyMaterial ( inbound_key) ) ,
2448
2449
phantom_secret,
2449
2450
phantom_node_id,
2450
2451
}
0 commit comments