You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning/src/sign/mod.rs
+7-21Lines changed: 7 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -833,24 +833,10 @@ pub trait NodeSigner {
833
833
///
834
834
/// Implementations of this method must derive a secure encryption key.
835
835
/// The key is used to encrypt or decrypt backups of our state stored with our peers.
836
-
/// Thus, if you wish to rely on recovery using this method, you should use a key which can be re-derived from data which would be available after state loss (eg the wallet seed)
837
836
///
838
-
/// # Implementation Details
839
-
///
840
-
/// - The key must be derived from a node-specific secret to ensure uniqueness.
841
-
/// - The derived key must be exactly **32 bytes** and suitable for symmetric
842
-
/// encryption algorithms.
843
-
///
844
-
/// # Returns
845
-
///
846
-
/// A [`SecretKey`] representing the encryption key for peer storage.
847
-
///
848
-
/// # Usage
849
-
///
850
-
/// This method is invoked when encrypting or decrypting peer storage data.
851
-
/// It must return the same key every time it is called, ensuring consistency
852
-
/// for encryption and decryption operations.
853
-
fnget_peer_storage_key(&self) -> SecretKey;
837
+
/// Thus, if you wish to rely on recovery using this method, you should use a key which
838
+
/// can be re-derived from data which would be available after state loss (eg the wallet seed)
839
+
fnget_peer_storage_key(&self) -> [u8;32];
854
840
855
841
/// Get node id based on the provided [`Recipient`].
856
842
///
@@ -2116,8 +2102,8 @@ impl NodeSigner for KeysManager {
2116
2102
self.inbound_payment_key.clone()
2117
2103
}
2118
2104
2119
-
fnget_peer_storage_key(&self) -> SecretKey{
2120
-
self.peer_storage_key
2105
+
fnget_peer_storage_key(&self) -> [u8;32]{
2106
+
self.peer_storage_key.secret_bytes()
2121
2107
}
2122
2108
2123
2109
fnsign_invoice(
@@ -2281,8 +2267,8 @@ impl NodeSigner for PhantomKeysManager {
0 commit comments