]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Update docs for slightly more clarity on channel key derivation
authorMatt Corallo <git@bluematt.me>
Mon, 27 Nov 2023 18:32:08 +0000 (18:32 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 9 Jan 2024 22:24:59 +0000 (22:24 +0000)
lightning/src/ln/channel_keys.rs

index 3ea9ac01a65cce40991036e299e64ad9a039ed4c..fbb0162e93c6f9243fba3add6d5ce1f96618b0b3 100644 (file)
@@ -50,18 +50,18 @@ macro_rules! basepoint_impl {
 macro_rules! key_impl {
        ($BasepointT:ty, $KeyName:expr) => {
                doc_comment! {
-                       concat!("Generate ", $KeyName, " using per_commitment_point"),
+                       concat!("Derive a public ", $KeyName, " using one node's `per_commitment_point` and its countersignatory's `basepoint`"),
                        pub fn from_basepoint<T: secp256k1::Signing>(
                                secp_ctx: &Secp256k1<T>,
-                               basepoint: &$BasepointT,
+                               countersignatory_basepoint: &$BasepointT,
                                per_commitment_point: &PublicKey,
                        ) -> Self {
-                               Self(derive_public_key(secp_ctx, per_commitment_point, &basepoint.0))
+                               Self(derive_public_key(secp_ctx, per_commitment_point, &countersignatory_basepoint.0))
                        }
                }
 
                doc_comment! {
-                       concat!("Generate ", $KeyName, " from privkey"),
+                       concat!("Build a ", $KeyName, " directly from an already-derived private key"),
                        pub fn from_secret_key<T: secp256k1::Signing>(secp_ctx: &Secp256k1<T>, sk: &SecretKey) -> Self {
                                Self(PublicKey::from_secret_key(&secp_ctx, &sk))
                        }