What changed, and why it matters
This is a routine internal code reorganization. The project is moving the definition of Bitcoin network types (like Mainnet and Testnet) from one internal crate to another newly created crate. There are no user-facing behavior changes and no security fixes.
No security action needed. Treat as normal maintenance/refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors the p2p crate to depend on a new bitcoin-network-kind crate instead of re-exporting Network and TestnetVersion from the top-level bitcoin crate. It updates Cargo.toml, lock files, and two use statements in p2p/src/lib.rs and p2p/src/network_ext.rs. The change is purely structural dependency management.
Changed components
p2p crate dependency graphCargo-minimal.lockCargo-recent.lockp2p/Cargo.tomlp2p/src/lib.rsp2p/src/network_ext.rsInspect captured patch +6 / −3
diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock
index 950ab0a6..4e7c2dc4 100644
--- a/Cargo-minimal.lock
+++ b/Cargo-minimal.lock
@@ -141,6 +141,7 @@ dependencies = [
"bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-io",
+ "bitcoin-network-kind",
"bitcoin-primitives",
"bitcoin-units",
"bitcoin_hashes",
diff --git a/Cargo-recent.lock b/Cargo-recent.lock
index 6749a667..246d47db 100644
--- a/Cargo-recent.lock
+++ b/Cargo-recent.lock
@@ -140,6 +140,7 @@ dependencies = [
"bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-io",
+ "bitcoin-network-kind",
"bitcoin-primitives",
"bitcoin-units",
"bitcoin_hashes",
diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml
index 0335fecb..9b574850 100644
--- a/p2p/Cargo.toml
+++ b/p2p/Cargo.toml
@@ -14,13 +14,14 @@ exclude = ["tests", "contrib"]
[features]
default = ["std"]
-std = ["encoding/std", "hashes/std", "hex/std", "internals/std", "io/std", "units/std", "bitcoin/std", "primitives/std"]
+std = ["encoding/std", "hashes/std", "network/std", "hex/std", "internals/std", "io/std", "units/std", "bitcoin/std", "primitives/std"]
arbitrary = ["dep:arbitrary", "bitcoin/arbitrary"]
[dependencies]
bitcoin = { path = "../bitcoin/", default-features = false }
encoding = { package = "bitcoin-consensus-encoding", version = "=1.0.0-rc.3", path = "../consensus_encoding", default-features = false }
hashes = { package = "bitcoin_hashes", version = "0.19.0", path = "../hashes", default-features = false }
+network = { package = "bitcoin-network-kind", path = "../network", version = "0.1.0", default-features = false }
primitives = { package = "bitcoin-primitives", path = "../primitives", version = "=1.0.0-rc.2", default-features = false }
hex = { package = "hex-conservative", version = "0.3.0", default-features = false }
internals = { package = "bitcoin-internals", path = "../internals", default-features = false }
diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs
index 21b5a4d3..74b2fc52 100644
--- a/p2p/src/lib.rs
+++ b/p2p/src/lib.rs
@@ -36,7 +36,7 @@ use core::{fmt, ops};
#[cfg(feature = "arbitrary")]
use arbitrary::{Arbitrary, Unstructured};
use bitcoin::consensus::encode::{self, Decodable, Encodable};
-use bitcoin::network::{Network, TestnetVersion};
+use network::{Network, TestnetVersion};
use hex::FromHex;
use internals::impl_to_hex_from_lower_hex;
use io::{BufRead, Write};
diff --git a/p2p/src/network_ext.rs b/p2p/src/network_ext.rs
index b30e90bb..93aee0ab 100644
--- a/p2p/src/network_ext.rs
+++ b/p2p/src/network_ext.rs
@@ -4,7 +4,7 @@
//! with getter methods for the default P2P port and default
//! network [`Magic`] bytes.
-use bitcoin::{Network, TestnetVersion};
+use network::{Network, TestnetVersion};
use crate::Magic;
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.