What changed, and why it matters
This commit only adds a documentation comment to the Target type explaining that it does not enforce a maximum value limit. No code behavior was changed, and no security vulnerability is present in the commit itself.
No action needed; this is a documentation-only commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a four-line documentation addition to bitcoin/src/pow.rs on the Target struct. It notes that Target constructors do not enforce a network-specific maximum value invariant and advises users to compare against MAX_ATTAINABLE_* constants if they need that invariant. The diff contains no logic, validation, or API changes.
Changed components
bitcoin/src/pow.rs documentationInspect captured patch +4 / −0
diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs
index 22b9d950..18dc07cc 100644
--- a/bitcoin/src/pow.rs
+++ b/bitcoin/src/pow.rs
@@ -135,6 +135,10 @@ impl Sub for Work {
/// block to be accepted by the network. The lower the target, the more difficult it is to generate
/// a block. (See also [`Work`].)
///
+/// [`Target`] does not limit its value to the maximum attainable value for any network when it
+/// is constructed. If you need to enforce that invariant, you should compare the constructed value
+/// against the required network's `MAX_ATTAINABLE_*` target constant.
+///
/// ref: <https://en.bitcoin.it/wiki/Target>
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
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.