Remove public re-exports of old consenus traits
What changed, and why it matters
This commit removes an accidental public re-export of internal Bitcoin data-encoding traits from a module that should not have exposed them. It is a minor API cleanup that slightly reduces the library's public surface area. There is no direct security vulnerability in the code itself, but cleaning up unintended public exports is a defensive hardening practice that prevents future misuse or confusion.
No urgent action required. Treat as a normal API cleanup; downstream users relying on the re-exported `Decodable`/`Encodable` from this module will need to import them from `bitcoin::consensus::encode` instead. Review other modules for similar accidental public re-exports as a hardening exercise.
Security signals we found
Unintended public API surface reduction
Defensive API-hardening change
No memory-safety, cryptographic, or consensus-bug signals in diff
Evidence from the diff
In bitcoin/src/blockdata/mod.rs, the absolute locktime submodule was publicly re-exporting crate::consensus::encode::{self, Decodable, Encodable} via pub use. The commit changes this to a private use import, keeping the traits available inside the module while removing them from the crate’s public API. The change was discussed during PR 5965 between contributors Andrew and Nymius.
Changed components
bitcoin/src/blockdata/mod.rsabsolute locktime module public APIInspect captured patch +1 / −1
diff --git a/bitcoin/src/blockdata/mod.rs b/bitcoin/src/blockdata/mod.rs
index 6b1d75d8..526189ed 100644
--- a/bitcoin/src/blockdata/mod.rs
+++ b/bitcoin/src/blockdata/mod.rs
@@ -39,7 +39,7 @@ pub mod locktime {
use io::{BufRead, Write};
- pub use crate::consensus::encode::{self, Decodable, Encodable};
+ use crate::consensus::encode::{self, Decodable, Encodable};
// Re-export everything from the `units::locktime::absolute` module.
#[rustfmt::skip] // Keep public re-exports separate.
Why this scored 18/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.