Add encoding dep to taproot-primitives
What changed, and why it matters
This commit simply adds a new internal software building block (a Rust crate dependency called bitcoin-consensus-encoding) to another internal crate (taproot-primitives). It updates package lists and feature flags so the new dependency can be used in future work, but it does not change any actual logic, data handling, or security behavior. There is nothing here that directly fixes or introduces a vulnerability.
No security action required. Review the follow-up commits that actually implement encoding for the hash types, as those may carry security implications.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is a pure build/configuration update: taproot_primitives/Cargo.toml gains a dependency on bitcoin-consensus-encoding, feature forwarding is updated (std/alloc/hex), the crate is re-exported in src/lib.rs, and lock files are regenerated. No executable code, parsing routines, cryptographic operations, or API behavior are modified. It is preparatory refactoring for future encoding support of hash types in taproot-primitives.
Changed components
taproot_primitives/Cargo.tomltaproot_primitives/src/lib.rsCargo-minimal.lockCargo-recent.lockInspect captured patch +23 / −5
diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock
index 38770007..1b86d558 100644
--- a/Cargo-minimal.lock
+++ b/Cargo-minimal.lock
@@ -259,11 +259,18 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "bitcoin-private"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57"
+
[[package]]
name = "bitcoin-taproot-primitives"
version = "0.1.0"
dependencies = [
"arbitrary",
+ "bitcoin-consensus-encoding 1.1.0",
"bitcoin-crypto",
"bitcoin-internals 0.6.0",
"bitcoin_hashes 1.1.0",
@@ -294,6 +301,15 @@ dependencies = [
"serde_test",
]
+[[package]]
+name = "bitcoin_hashes"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501"
+dependencies = [
+ "bitcoin-private",
+]
+
[[package]]
name = "bitcoin_hashes"
version = "0.14.101"
@@ -507,7 +523,7 @@ version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3"
dependencies = [
- "bitcoin_hashes 0.14.101",
+ "bitcoin_hashes 0.12.0",
"secp256k1-sys 0.10.0",
"serde",
]
diff --git a/Cargo-recent.lock b/Cargo-recent.lock
index 37cbaf76..b6055911 100644
--- a/Cargo-recent.lock
+++ b/Cargo-recent.lock
@@ -263,6 +263,7 @@ name = "bitcoin-taproot-primitives"
version = "0.1.0"
dependencies = [
"arbitrary",
+ "bitcoin-consensus-encoding 1.1.0",
"bitcoin-crypto",
"bitcoin-internals 0.6.0",
"bitcoin_hashes 1.1.0",
diff --git a/taproot_primitives/Cargo.toml b/taproot_primitives/Cargo.toml
index c5d42dce..c2371246 100644
--- a/taproot_primitives/Cargo.toml
+++ b/taproot_primitives/Cargo.toml
@@ -14,14 +14,15 @@ exclude = ["tests", "contrib"]
[features]
default = ["std", "hex"]
-std = ["alloc", "crypto/std", "hashes/std", "internals/std", "serde?/std", "secp256k1/std"]
-alloc = ["crypto/alloc", "hashes/alloc", "internals/alloc", "secp256k1/alloc"]
+std = ["alloc", "crypto/std", "encoding/std", "hashes/std", "internals/std", "serde?/std", "secp256k1/std"]
+alloc = ["crypto/alloc", "encoding/alloc", "hashes/alloc", "internals/alloc", "secp256k1/alloc"]
serde = ["dep:serde", "crypto/serde", "hashes/serde", "internals/serde", "secp256k1/serde"]
arbitrary = ["dep:arbitrary", "crypto/arbitrary", "secp256k1/arbitrary"]
-hex = ["crypto/hex", "hashes/hex"]
+hex = ["crypto/hex", "encoding/hex", "hashes/hex"]
[dependencies]
crypto = { package = "bitcoin-crypto", path = "../crypto", version = "0.2.0", default-features = false }
+encoding = { package = "bitcoin-consensus-encoding", path = "../consensus_encoding", version = "1.1.0", default-features = false, features = [] }
hashes = { package = "bitcoin_hashes", path = "../hashes", version = "1.0.0", default-features = false }
internals = { package = "bitcoin-internals", path = "../internals", version = "0.6.0" }
diff --git a/taproot_primitives/src/lib.rs b/taproot_primitives/src/lib.rs
index b01ae263..57442e46 100644
--- a/taproot_primitives/src/lib.rs
+++ b/taproot_primitives/src/lib.rs
@@ -21,7 +21,7 @@ extern crate std;
#[cfg(feature = "arbitrary")]
pub extern crate arbitrary;
-
+pub extern crate encoding;
pub extern crate hashes;
pub extern crate secp256k1;
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.