What changed, and why it matters
This commit is a simple variable rename from 'pk' to 'key' in two Rust functions because 'pk' is commonly understood to mean public key, while the parameter is actually a private key. There is no change to program logic, no security fix, and no behavior change.
No security action needed. Treat as a normal code-quality/documentation improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In bitcoin/src/crypto/sighash.rs, the parameter name in LegacySighash::sign and SegwitV0Sighash::sign is renamed from ‘pk’ to ‘key’, and the corresponding doc comments are updated. The type remains &PrivateKey and the implementation is otherwise identical. This is a cosmetic/documentation clarity change only.
Changed components
bitcoin/src/crypto/sighash.rsInspect captured patch +6 / −6
diff --git a/bitcoin/src/crypto/sighash.rs b/bitcoin/src/crypto/sighash.rs
index 5caf9493..bab0d585 100644
--- a/bitcoin/src/crypto/sighash.rs
+++ b/bitcoin/src/crypto/sighash.rs
@@ -84,22 +84,22 @@ impl LegacySighash {
fn engine() -> sha256d::HashEngine { sha256d::Hash::engine() }
fn from_engine(e: sha256d::HashEngine) -> Self { Self(sha256d::Hash::from_engine(e)) }
- /// Signs this sighash using `pk`.
+ /// Signs this sighash using `key`.
///
/// `sighash_type` must be the same as that used to create the sighash.
- pub fn sign(&self, pk: &PrivateKey, sighash_type: EcdsaSighashType) -> ecdsa::Signature {
- ecdsa::Signature { signature: pk.raw_ecdsa_sign(*self), sighash_type }
+ pub fn sign(&self, key: &PrivateKey, sighash_type: EcdsaSighashType) -> ecdsa::Signature {
+ ecdsa::Signature { signature: key.raw_ecdsa_sign(*self), sighash_type }
}
}
impl SegwitV0Sighash {
fn engine() -> sha256d::HashEngine { sha256d::Hash::engine() }
fn from_engine(e: sha256d::HashEngine) -> Self { Self(sha256d::Hash::from_engine(e)) }
- /// Signs this sighash using `pk`.
+ /// Signs this sighash using `key`.
///
/// `sighash_type` must be the same as that used to create the sighash.
- pub fn sign(&self, pk: &PrivateKey, sighash_type: EcdsaSighashType) -> ecdsa::Signature {
- ecdsa::Signature { signature: pk.raw_ecdsa_sign(*self), sighash_type }
+ pub fn sign(&self, key: &PrivateKey, sighash_type: EcdsaSighashType) -> ecdsa::Signature {
+ ecdsa::Signature { signature: key.raw_ecdsa_sign(*self), sighash_type }
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.