Remove outdated doc from `XOnlyPublicKey::from_secp`
What changed, and why it matters
This commit simply removes two outdated lines from a code comment. The removed text incorrectly claimed that the function always sets an even parity, but the function actually accepts a parity argument supplied by the caller. There is no code change and no security issue.
No security action needed. This is a documentation-only cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes documentation lines from XOnlyPublicKey::from_secp in bitcoin/src/crypto/key.rs. The removed doc comment stated the constructor sets an even parity and directed users to with_parity for a different parity. However, the function signature already takes an explicit parity: Parity parameter, so the documentation was misleading. No executable code was modified.
Changed components
bitcoin/src/crypto/key.rs documentation commentInspect captured patch +0 / −3
diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs
index b5b4265f..82f1fc41 100644
--- a/bitcoin/src/crypto/key.rs
+++ b/bitcoin/src/crypto/key.rs
@@ -52,9 +52,6 @@ mod encapsulate {
impl XOnlyPublicKey {
/// Constructs a new x-only public key from the provided secp256k1 x-only public key.
- ///
- /// This constructor sets an even parity. Use [`XOnlyPublicKey::with_parity`] if you need
- /// a different parity value.
pub fn from_secp(key: impl Into<secp256k1::XOnlyPublicKey>, parity: Parity) -> Self {
Self { inner: key.into(), parity }
}
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.