Merge rust-bitcoin/rust-bitcoin#6998: Fix regtest parameters to match Bitcoin Core
What changed, and why it matters
This commit updates the built-in 'regtest' network parameters in the rust-bitcoin library so they match Bitcoin Core's current regtest defaults. Regtest is a private test network used only for local development and automated testing, not for real money. The changes make several Bitcoin protocol rules active from block 1 and shorten the difficulty adjustment window from two weeks to one day. There is no indication this fixes a security vulnerability; it is a compatibility/maintenance fix.
No security action required. Treat as a routine compatibility update. Users relying on regtest parameters should verify the new values match their local Bitcoin Core test setup, but this is a functional/testing concern rather than a security one.
Security signals we found
No security-relevant language in commit title, message, or PR description
Change affects only regtest (private testing network) parameters
No memory safety, cryptographic, or consensus validation code changed
No CVE, advisory, or security advisory references present in supplied materials
Evidence from the diff
The patch modifies Params::REGTEST in bitcoin/src/network/params.rs. It sets bip34_height, bip65_height, and bip66_height to 1 (previously 100000000/1351/1251) and changes pow_target_timespan from 14 days to 1 day. These values now align with Bitcoin Core’s regtest chainparams. The commit message and PR description frame this as a parameter alignment fix for issue #6997, not as a security fix.
Changed components
bitcoin/src/network/params.rsParams::REGTESTInspect captured patch +6 / −6
### bitcoin/src/network/params.rs
@@ -233,17 +233,17 @@ impl Params {
/// The regtest parameters.
pub const REGTEST: Self = Self {
network: Network::Regtest,
- bip16_time: 1333238400, // Apr 1 2012
- bip34_height: BlockHeight::from_u32(100000000), // not activated on regtest
- bip65_height: BlockHeight::from_u32(1351),
- bip66_height: BlockHeight::from_u32(1251), // used only in rpc tests
+ bip16_time: 1333238400, // Apr 1 2012
+ bip34_height: BlockHeight::from_u32(1), // Always active unless overridden
+ bip65_height: BlockHeight::from_u32(1), // Always active unless overridden
+ bip66_height: BlockHeight::from_u32(1), // Always active unless overridden
enforce_bip94: false,
rule_change_activation_threshold: BlockHeightInterval::from_u32(108), // 75%
miner_confirmation_window: BlockHeightInterval::from_u32(144),
pow_limit: Target::MAX_ATTAINABLE_REGTEST,
max_attainable_target: Target::MAX_ATTAINABLE_REGTEST,
- pow_target_spacing: 10 * 60, // 10 minutes.
- pow_target_timespan: 14 * 24 * 60 * 60, // 2 weeks.
+ pow_target_spacing: 10 * 60, // 10 minutes.
+ pow_target_timespan: 24 * 60 * 60, // one day.
allow_min_difficulty_blocks: true,
no_pow_retargeting: true,
};Why this scored 19/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.