What changed, and why it matters
This is a routine Rust API improvement that lets two small data types be copied implicitly instead of requiring an explicit clone. It does not fix a security bug and does not introduce an obvious vulnerability.
No action required. Treat as a normal API-quality commit.
Security signals we found
No security-relevant code change
No change to cryptographic logic
No change to input validation or serialization
No unsafe code added
Evidence from the diff
The commit adds the Copy derive macro to Prevouts<'u, T> and ScriptPath<'s> in bitcoin/src/crypto/sighash.rs. Both types contain only integers or references, so Copy is safe under Rust’s ownership rules. The change is purely ergonomic and has no functional effect on signature hashing logic.
Changed components
bitcoin/src/crypto/sighash.rsPrevouts enumScriptPath structInspect captured patch +2 / −2
diff --git a/bitcoin/src/crypto/sighash.rs b/bitcoin/src/crypto/sighash.rs
index 26c43cce..8a91607e 100644
--- a/bitcoin/src/crypto/sighash.rs
+++ b/bitcoin/src/crypto/sighash.rs
@@ -140,7 +140,7 @@ struct TaprootCache {
/// Contains outputs of previous transactions. In the case [`TapSighashType`] variant is
/// `SIGHASH_ANYONECANPAY`, [`Prevouts::One`] may be used.
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Prevouts<'u, T>
where
T: 'u + Borrow<TxOut>,
@@ -159,7 +159,7 @@ const KEY_VERSION_0: u8 = 0u8;
/// Information related to the script path spending.
///
/// This can be hashed into a [`TapLeafHash`].
-#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
+#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct ScriptPath<'s> {
script: &'s TapScript,
leaf_version: LeafVersion,
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.