Adjust CompressedPublicKey Display impl
What changed, and why it matters
This is a tiny internal code cleanup that changes how a compressed Bitcoin public key is printed as text. It swaps one standard way of turning bytes into hex for another equivalent way. There is no security issue here.
No action needed. Treat as a normal non-security refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes CompressedPublicKey’s Display implementation from calling LowerHex::fmt to Display::fmt on the same DisplayArray/as_hex() output. In the hex_conservative crate, both LowerHex and Display on DisplayArray ultimately produce the same hex rendering, so this is a non-functional refactor to remove an unnecessary trait indirection and match the existing PublicKey implementation. No behavior, API, or cryptographic property changes.
Changed components
bitcoin/src/crypto/key.rsCompressedPublicKey Display formattingInspect captured patch +1 / −1
diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs
index 364801fd..285bb3de 100644
--- a/bitcoin/src/crypto/key.rs
+++ b/bitcoin/src/crypto/key.rs
@@ -862,7 +862,7 @@ impl CompressedPublicKey {
impl fmt::Display for CompressedPublicKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- fmt::LowerHex::fmt(&self.to_bytes().as_hex(), f)
+ fmt::Display::fmt(&self.to_bytes().as_hex(), f)
}
}
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.