Testnet 5 (BIP95) #35861

Open
fjahr wants to merge 29 commits from 2026-07-t5-draft into 32.x AGit
fjahr commented 2026-08-01 18:44:56 +00:00 (Migrated from github.com)

Implements BIP 95 (Testnet 5). Relative to Testnet 4 it removes the 20-minute minimum-difficulty exception, raises the minimum difficulty, and enforces BIP 54 from block 1. The Genesis block has not been mined yet.

Based on #35793, only the top five commits belong to this PR.

Per the discussion in a recent IRC meeting: since BIP 95 activates BIP 54 from block 1, this depends on #35793 and won't make the v32 feature freeze. So we can review and settle the changes now, but leave this in draft until #35793 lands. Once reviewers are happy with the state of the draft here we can add the Genesis block and the network can get started without being included in a release. We can then ship a patched v32 release with Testnet 5 included. A solo-mining ckpool endpoint is likely being set up and will be advertised here. There are no DNS or fixed seeds yet.

Implements [BIP 95](https://github.com/bitcoin/bips/blob/master/bip-0095.md) (Testnet 5). Relative to Testnet 4 it removes the 20-minute minimum-difficulty exception, raises the minimum difficulty, and enforces [BIP 54](https://github.com/bitcoin/bips/blob/master/bip-0054.md) from block 1. The Genesis block has not been mined yet. Based on #35793, only the top five commits belong to this PR. Per the [discussion in a recent IRC meeting](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2026-07-30#1242502;): since BIP 95 activates BIP 54 from block 1, this depends on #35793 and won't make the v32 feature freeze. So we can review and settle the changes now, but leave this in draft until #35793 lands. Once reviewers are happy with the state of the draft here we can add the Genesis block and the network can get started without being included in a release. We can then ship a patched v32 release with Testnet 5 included. A solo-mining ckpool endpoint is likely being set up and will be advertised here. There are no DNS or fixed seeds yet.
DrahtBot commented 2026-08-01 18:45:03 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK polespinasa, fanquake
Stale ACK johnnyasantoss

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35852 (scripted-diff: Use inline const(expr) over static constexpr in headers by maflcko)
  • #35657 (refactor: avoid redundant input lookup in CheckTxInputs by arejula27)
  • #35570 (refactor: Change some validation.cpp methods to return BlockValidationState by optout21)
  • #35569 (Encapsulation for CTransaction by purpleKarrot)
  • #35301 (Silent Payments: Implement bip352 (take 2) by Eunovo)
  • #34864 (coins: tighten cache entry state invariants by l0rinc)
  • #32729 (test,refactor: extract script template helpers and expand sigop coverage by l0rinc)
  • #32468 (rpc: generateblock to allow multiple outputs by polespinasa)
  • #29491 ([EXPERIMENTAL] Schnorr batch verification for blocks by fjahr)
  • #28690 (build: Introduce internal kernel library by sedited)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • src/kernel/chainparams.cpp: CreateGenesisBlock(testnet5_genesis_msg, testnet5_genesis_script, 1794632593, 0x653d9131, 0x1a0fffff, 0x2230c000, 50 * COIN)
  • src/test/bip54_tests.cpp: AddCoins(coins, CTransaction(tx_create), 0, false)
  • src/test/bip54_tests.cpp: Coin(spent_txo, 0, false)

Possible places where comparison-specific test macros should replace generic comparisons:

  • test/functional/data/invalid_txs.py: assert len(tx.serialize_without_witness()) == 63 → Prefer assert_equal(len(tx.serialize_without_witness()), 63).
  • test/functional/data/invalid_txs.py: assert MIN_STANDARD_TX_NONWITNESS_SIZE - 1 == 64 → Prefer assert_equal(MIN_STANDARD_TX_NONWITNESS_SIZE - 1, 64).

2026-11-22 11:23:43

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35861 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35861.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35861#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Concept ACK | [polespinasa](https://github.com/bitcoin/bitcoin/pull/35861#issuecomment-6635789149), [fanquake](https://github.com/bitcoin/bitcoin/pull/35861#issuecomment-6833179237) | | Stale ACK | [johnnyasantoss](https://github.com/bitcoin/bitcoin/pull/35861#pullrequestreview-5893631869) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35852](https://github.com/bitcoin/bitcoin/pull/35852) (scripted-diff: Use inline const(expr) over static constexpr in headers by maflcko) * [#35657](https://github.com/bitcoin/bitcoin/pull/35657) (refactor: avoid redundant input lookup in `CheckTxInputs` by arejula27) * [#35570](https://github.com/bitcoin/bitcoin/pull/35570) (refactor: Change some validation.cpp methods to return BlockValidationState by optout21) * [#35569](https://github.com/bitcoin/bitcoin/pull/35569) (Encapsulation for CTransaction by purpleKarrot) * [#35301](https://github.com/bitcoin/bitcoin/pull/35301) (Silent Payments: Implement bip352 (take 2) by Eunovo) * [#34864](https://github.com/bitcoin/bitcoin/pull/34864) (coins: tighten cache entry state invariants by l0rinc) * [#32729](https://github.com/bitcoin/bitcoin/pull/32729) (test,refactor: extract script template helpers and expand sigop coverage by l0rinc) * [#32468](https://github.com/bitcoin/bitcoin/pull/32468) (rpc: generateblock to allow multiple outputs by polespinasa) * [#29491](https://github.com/bitcoin/bitcoin/pull/29491) ([EXPERIMENTAL] Schnorr batch verification for blocks by fjahr) * [#28690](https://github.com/bitcoin/bitcoin/pull/28690) (build: Introduce internal kernel library by sedited) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3--> ### LLM Linter (✨ experimental) Possible places where named args for integral literals may be used (e.g. `func(x, /*named_arg=*/0)` in C++, and `func(x, named_arg=0)` in Python): - `src/kernel/chainparams.cpp`: `CreateGenesisBlock(testnet5_genesis_msg, testnet5_genesis_script, 1794632593, 0x653d9131, 0x1a0fffff, 0x2230c000, 50 * COIN)` - `src/test/bip54_tests.cpp`: `AddCoins(coins, CTransaction(tx_create), 0, false)` - `src/test/bip54_tests.cpp`: `Coin(spent_txo, 0, false)` Possible places where comparison-specific test macros should replace generic comparisons: - `test/functional/data/invalid_txs.py`: `assert len(tx.serialize_without_witness()) == 63` → Prefer `assert_equal(len(tx.serialize_without_witness()), 63)`. - `test/functional/data/invalid_txs.py`: `assert MIN_STANDARD_TX_NONWITNESS_SIZE - 1 == 64` → Prefer `assert_equal(MIN_STANDARD_TX_NONWITNESS_SIZE - 1, 64)`. <sup>2026-11-22 11:23:43</sup>
DrahtBot commented 2026-08-01 19:16:38 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/30713233158/job/91404317894
LLM reason (✨ experimental): CI failed because IWYU (include-what-you-use) reported a failure and forced the job to exit with “Failure generated from IWYU.”

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `iwyu`: https://github.com/bitcoin/bitcoin/actions/runs/30713233158/job/91404317894</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU (include-what-you-use) reported a failure and forced the job to exit with “Failure generated from IWYU.”</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
DrahtBot commented 2026-08-14 17:49:54 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
darosior (Migrated from github.com) reviewed 2026-10-02 07:34:53 +00:00
darosior (Migrated from github.com) commented 2026-10-02 07:34:54 +00:00

This clashes with testnet3's Tor port?

This clashes with testnet3's Tor port?
First-time contributor

Earlier concerns remain unresolved; see the Run archive linked from the Review report.

🟠 Minor · The future-leaf Taproot vector duplicates the preceding Tapscript spend

The future-leaf case in bip54_legacy_sigops repeats the 0xc0 witness, leaving 0xc2 untested and producing a mislabeled duplicate if JSON vectors are exported.

Location: src/test/bip54_tests.cpp:1104 (head).

🔵 Suggestion · Release notes omit BIP54 compatibility changes outside Testnet5

The release notes omit BIP54's regtest, getblocktemplate, and mempool compatibility changes; default mainnet mempool acceptance is unchanged.

Location: src/kernel/chainparams.cpp:745 (head).

🔵 Suggestion · BIP54 sigops rejections lose witness-independent txid caching

Changing the BIP54 sigops failure from TX_INPUTS_NOT_STANDARD to TX_CONSENSUS can cause redundant parent downloads and retained orphans for witness transactions instead of immediately rejecting their children.

Location: src/consensus/tx_verify.cpp:205 (head).

🔵 Suggestion · doc/bips.md omits the 32.x backport versions for BIP54 and BIP95

Both new doc/bips.md entries list only v33.0, omitting availability in the intended 32.x backport release, whose exact patch version still needs confirmation.

Location: doc/bips.md:35 (head).

🔵 Suggestion · BIP54 reorg reinsertion and descendant cleanup lack coverage

Although reinsertion currently looks correct, tests do not verify that disconnecting a valid pre-activation block rejects its over-limit transaction from the mempool and removes descendants under the now-unconditional BIP54 sigops policy.

Location: src/validation.cpp:894 (head).

Backport verdict: Needs clarification

I could not establish that this backport matches the upstream originals. It also has target-branch problems that need fixing or justifying. The packet bundles 29 commits that look like two upstream PRs: the BIP 54 implementation (#35793, 22 commits) and Testnet 5 (#35861, 7 commits). None of the commits has a resolved upstream original, so I could not check fidelity, adaptations or omitted dependencies commit by commit. The head is the 32.x release branch (CMakeLists.txt: version 32.1.0, CLIENT_VERSION_IS_RELEASE true). The PR's stated goal is a patched v32 release, but some user-visible changes are not adapted or documented for a point release. Regtest now always enforces BIP 54. As a result, getblocktemplate rejects any client that does not list the 'consensuscleanup' rule, and blocks whose coinbase lacks the nLockTime/nSequence pattern are rejected. Mempool reject reasons change, the BIP 54 sigops limit can no longer be bypassed with -acceptnonstdtxn, and doc/bips.md says 'v33.0' on a 32.x branch. Nothing I read in the code shows a consensus defect for mainnet, testnet3/4 or signet, where the deployment is NEVER_ACTIVE.

Review coverage was incomplete.


Reviewed: f57b52aeea41 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:3705f06c6a27c475c77f2533c4d016ac03c829c839b7b538bba5e4768ccf54f1:1ed10c4979af6fc548d6b8d4534d505e02e84ac4b0aa4f8633555b2ba75119e8 --> <!-- ralph-base:99618d123cc8717e93b0488c182e14827e806fc0 --> <!-- ralph-head:f57b52aeea413e92394a740dd1fb562cbaa4c25c --> <!-- ralph-case:64ad02c11b3ddff55bd4bcba367062c7eec9b073918adb8177aa30944dc0cb81 --> Earlier concerns remain unresolved; see the Run archive linked from the Review report. **🟠 Minor · The future-leaf Taproot vector duplicates the preceding Tapscript spend** The future-leaf case in `bip54_legacy_sigops` repeats the `0xc0` witness, leaving `0xc2` untested and producing a mislabeled duplicate if JSON vectors are exported. Location: [`src/test/bip54_tests.cpp:1104`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c/src/test/bip54_tests.cpp#L1104>) (head). **🔵 Suggestion · Release notes omit BIP54 compatibility changes outside Testnet5** The release notes omit BIP54's regtest, `getblocktemplate`, and mempool compatibility changes; default mainnet mempool acceptance is unchanged. Location: [`src/kernel/chainparams.cpp:745`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c/src/kernel/chainparams.cpp#L745>) (head). **🔵 Suggestion · BIP54 sigops rejections lose witness-independent `txid` caching** Changing the BIP54 sigops failure from `TX_INPUTS_NOT_STANDARD` to `TX_CONSENSUS` can cause redundant parent downloads and retained orphans for witness transactions instead of immediately rejecting their children. Location: [`src/consensus/tx_verify.cpp:205`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c/src/consensus/tx_verify.cpp#L205>) (head). **🔵 Suggestion · `doc/bips.md` omits the 32.x backport versions for BIP54 and BIP95** Both new `doc/bips.md` entries list only v33.0, omitting availability in the intended 32.x backport release, whose exact patch version still needs confirmation. Location: [`doc/bips.md:35`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c/doc/bips.md#L35>) (head). **🔵 Suggestion · BIP54 reorg reinsertion and descendant cleanup lack coverage** Although reinsertion currently looks correct, tests do not verify that disconnecting a valid pre-activation block rejects its over-limit transaction from the mempool and removes descendants under the now-unconditional BIP54 sigops policy. Location: [`src/validation.cpp:894`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c/src/validation.cpp#L894>) (head). Backport verdict: **Needs clarification** I could not establish that this backport matches the upstream originals. It also has target-branch problems that need fixing or justifying. The packet bundles 29 commits that look like two upstream PRs: the BIP 54 implementation (#35793, 22 commits) and Testnet 5 (#35861, 7 commits). None of the commits has a resolved upstream original, so I could not check fidelity, adaptations or omitted dependencies commit by commit. The head is the 32.x release branch (CMakeLists.txt: version 32.1.0, CLIENT_VERSION_IS_RELEASE true). The PR's stated goal is a patched v32 release, but some user-visible changes are not adapted or documented for a point release. Regtest now always enforces BIP 54. As a result, getblocktemplate rejects any client that does not list the 'consensuscleanup' rule, and blocks whose coinbase lacks the nLockTime/nSequence pattern are rejected. Mempool reject reasons change, the BIP 54 sigops limit can no longer be bypassed with -acceptnonstdtxn, and doc/bips.md says 'v33.0' on a 32.x branch. Nothing I read in the code shows a consensus defect for mainnet, testnet3/4 or signet, where the deployment is NEVER_ACTIVE. Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`f57b52aeea41`](<https://git.fish.foo/bitcoin/bitcoin/commit/f57b52aeea413e92394a740dd1fb562cbaa4c25c>) · [Review report](<https://review.fish.foo/report/35861-f57b52aeea413e92394a740dd1fb562cbaa4c25c-2934-5.html>) · [Previous reports](<https://review.fish.foo/traces/35861/>) [permalink](<https://review.fish.foo/report/35861-f57b52aeea413e92394a740dd1fb562cbaa4c25c-2934-5.html>)
polespinasa (Migrated from github.com) reviewed 2026-11-02 20:47:05 +00:00
polespinasa (Migrated from github.com) left a comment

Approach ACK

Can we use this PR to also add the bash completation? See bitcoin-cli.bash.

Should we add tests for the restored difficulty behavior?

Maybe also some activation unit tests? Maybe test that block1 has bip54 active?

diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp
index 7dcc5c676c..361be3f3d6 100644
--- a/src/test/versionbits_tests.cpp
+++ b/src/test/versionbits_tests.cpp
@@ -5,6 +5,7 @@
 #include <chain.h>
 #include <chainparams.h>
 #include <consensus/params.h>
+#include <deploymentstatus.h>
 #include <test/util/random.h>
 #include <test/util/common.h>
 #include <test/util/setup_common.h>
@@ -492,4 +493,20 @@ BOOST_FIXTURE_TEST_CASE(versionbits_computeblockversion, BlockVersionTest)
     }
 }
 
+BOOST_AUTO_TEST_CASE(testnet5_consensuscleanup_activation)
+{
+    for (const auto chain_type : {ChainType::TESTNET4, ChainType::TESTNET5}) {
+        BOOST_TEST_CONTEXT(ChainTypeToString(chain_type)) {
+            const auto chain_params{CreateChainParams(ArgsManager{}, chain_type)};
+            // Evaluate block 1 with the default deployment parameters, without mining genesis.
+            CBlockIndex genesis{chain_params->GenesisBlock()};
+            genesis.nHeight = 0;
+            VersionBitsCache cache;
+            BOOST_CHECK_EQUAL(DeploymentActiveAfter(&genesis, chain_params->GetConsensus(),
+                                                   Consensus::DEPLOYMENT_CONSENSUSCLEANUP, cache),
+                              chain_type == ChainType::TESTNET5);
+        }
+    }
+}

Approach ACK Can we use this PR to also add the bash completation? See `bitcoin-cli.bash`. Should we add tests for the restored difficulty behavior? Maybe also some activation unit tests? Maybe test that block1 has bip54 active? ```diff diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp index 7dcc5c676c..361be3f3d6 100644 --- a/src/test/versionbits_tests.cpp +++ b/src/test/versionbits_tests.cpp @@ -5,6 +5,7 @@ #include <chain.h> #include <chainparams.h> #include <consensus/params.h> +#include <deploymentstatus.h> #include <test/util/random.h> #include <test/util/common.h> #include <test/util/setup_common.h> @@ -492,4 +493,20 @@ BOOST_FIXTURE_TEST_CASE(versionbits_computeblockversion, BlockVersionTest) } } +BOOST_AUTO_TEST_CASE(testnet5_consensuscleanup_activation) +{ + for (const auto chain_type : {ChainType::TESTNET4, ChainType::TESTNET5}) { + BOOST_TEST_CONTEXT(ChainTypeToString(chain_type)) { + const auto chain_params{CreateChainParams(ArgsManager{}, chain_type)}; + // Evaluate block 1 with the default deployment parameters, without mining genesis. + CBlockIndex genesis{chain_params->GenesisBlock()}; + genesis.nHeight = 0; + VersionBitsCache cache; + BOOST_CHECK_EQUAL(DeploymentActiveAfter(&genesis, chain_params->GetConsensus(), + Consensus::DEPLOYMENT_CONSENSUSCLEANUP, cache), + chain_type == ChainType::TESTNET5); + } + } +} ```
fjahr (Migrated from github.com) reviewed 2026-11-04 09:05:03 +00:00
fjahr (Migrated from github.com) commented 2026-11-04 09:05:03 +00:00

Ugh, I thought I had taken everything into account but I guess I didn't look at T3 seriously enough. I moved T5 to 18352/18353/18354 (RPC/P2P/onion), so 183N3 scheme that keeps our existing pattern for RPC = P2P-1 and onion = P2P+1 and that testnet3 already follows with N=3. This means we need changes the P2P port in BIP95, so I'll push an update for that. I think the BIP change is fine since there is no other implementation yet and I think there is some value in keeping the pattern in place.

Ugh, I thought I had taken everything into account but I guess I didn't look at T3 seriously enough. I moved T5 to 18352/18353/18354 (RPC/P2P/onion), so 183N3 scheme that keeps our existing pattern for RPC = P2P-1 and onion = P2P+1 and that testnet3 already follows with N=3. This means we need changes the P2P port in BIP95, so I'll push an update for that. I think the BIP change is fine since there is no other implementation yet and I think there is some value in keeping the pattern in place.
fjahr commented 2026-11-04 09:05:44 +00:00 (Migrated from github.com)

Rebased on v32.1 with the latest state of the BIP 54 pull.

Can we use this PR to also add the bash completation?

Done

Should we add tests for the restored difficulty behavior?

Added two cases: no 20-minute exception on testnet5, and the raised powLimit.

Maybe also some activation unit tests? Maybe test that block1 has bip54 active?

Taken with small tweaks, thanks!

Rebased on v32.1 with the latest state of the BIP 54 pull. > Can we use this PR to also add the bash completation? Done > Should we add tests for the restored difficulty behavior? Added two cases: no 20-minute exception on testnet5, and the raised `powLimit`. > Maybe also some activation unit tests? Maybe test that block1 has bip54 active? Taken with small tweaks, thanks!
polespinasa commented 2026-11-04 16:18:27 +00:00 (Migrated from github.com)

looks pretty good to me right now.
If it was not a draft I would directly ACK it ;)

looks pretty good to me right now. If it was not a draft I would directly ACK it ;)
ajtowns (Migrated from github.com) reviewed 2026-11-09 16:54:35 +00:00
ajtowns (Migrated from github.com) commented 2026-11-09 16:54:34 +00:00

After https://github.com/bitcoin/bips/pull/2347 expect this to change to something like

        // TODO: these are placeholders
        const char* testnet5_genesis_msg = "2026-11-09 975190 0000000000000000000153b627e5d18a5b7f2e1b4d601c7abaf5889c1af136ca";
        const CScript testnet5_genesis_script = CScript() << OP_RETURN << "ffebf16a00000000"_hex;
        genesis = CreateGenesisBlock(testnet5_genesis_msg,
                testnet5_genesis_script,
                1794239567, // nTime
                0x14eab764, // nNonce
                0x1b01fffe, // nBits (nb: placeholder has wrong difficulty)
                0x20066000, // nVersion
                50 * COIN);
After https://github.com/bitcoin/bips/pull/2347 expect this to change to something like ```c++ // TODO: these are placeholders const char* testnet5_genesis_msg = "2026-11-09 975190 0000000000000000000153b627e5d18a5b7f2e1b4d601c7abaf5889c1af136ca"; const CScript testnet5_genesis_script = CScript() << OP_RETURN << "ffebf16a00000000"_hex; genesis = CreateGenesisBlock(testnet5_genesis_msg, testnet5_genesis_script, 1794239567, // nTime 0x14eab764, // nNonce 0x1b01fffe, // nBits (nb: placeholder has wrong difficulty) 0x20066000, // nVersion 50 * COIN); ```
fanquake commented 2026-11-12 19:04:37 +00:00 (Migrated from github.com)

Concept ACK

Concept ACK
fjahr commented 2026-11-13 09:04:25 +00:00 (Migrated from github.com)

Adapted the Genesis block layout to BIP95 v0.3.0 with @ajtowns suggested height at 975,744. For anyone intersted, this is in roughly 15 hours, if you want to point some hash power at the pool and be part of (testnet) history, here is the relevant information: https://gist.github.com/ajtowns/ebb148819c6028387271e6f0dce5e1da

Also taken out of draft status.

Adapted the Genesis block layout to BIP95 v0.3.0 with @ajtowns suggested height at 975,744. For anyone intersted, this is in roughly 15 hours, if you want to point some hash power at the pool and be part of (testnet) history, here is the relevant information: https://gist.github.com/ajtowns/ebb148819c6028387271e6f0dce5e1da Also taken out of draft status.
johnnyasantoss (Migrated from github.com) reviewed 2026-11-13 15:22:25 +00:00
johnnyasantoss (Migrated from github.com) left a comment

cACK 987ddefe25

One minor inconvenience is that the boost tests are mostly comparing against testnet4 and a observer without external/historical context may not understand why.

cACK 987ddefe254165510673524d7f74ca050a65bf60 One minor inconvenience is that the boost tests are mostly comparing against testnet4 and a observer without external/historical context may not understand why.
ajtowns (Migrated from github.com) reviewed 2026-11-14 05:23:00 +00:00
ajtowns (Migrated from github.com) commented 2026-11-14 05:23:00 +00:00

Params are here:

        const char* testnet5_genesis_msg = "2026-11-14 975744 0000000000000000000123e2681e2f82acdcb9430a15eec24cc85b400691d479";
        const CScript testnet5_genesis_script = CScript() << OP_RETURN << "95ebf76a02000000"_hex;
        genesis = CreateGenesisBlock(testnet5_genesis_msg,
                testnet5_genesis_script,
                1794632593, // nTime
                0x653d9131, // nNonce
                0x1a0fffff,
                0x2230c000, // nVersion
                50 * COIN);
        consensus.hashGenesisBlock = genesis.GetHash();
        assert(consensus.hashGenesisBlock == uint256{"00000000000008c1637e7d3252dc1c333d4546fd6fff6a474b200d674a91d497"});
        assert(genesis.hashMerkleRoot == uint256{"8c5899b65c5b0834adb17af314e22a9bf067e7ed8144c37967b5ec56b5a6e28d"});

Also here and here.

Params are [here](https://github.com/ajtowns/bitcoin/commit/6fd79a9efa1c492723972557bc4f01fe21c068e8): ```c++ const char* testnet5_genesis_msg = "2026-11-14 975744 0000000000000000000123e2681e2f82acdcb9430a15eec24cc85b400691d479"; const CScript testnet5_genesis_script = CScript() << OP_RETURN << "95ebf76a02000000"_hex; genesis = CreateGenesisBlock(testnet5_genesis_msg, testnet5_genesis_script, 1794632593, // nTime 0x653d9131, // nNonce 0x1a0fffff, 0x2230c000, // nVersion 50 * COIN); consensus.hashGenesisBlock = genesis.GetHash(); assert(consensus.hashGenesisBlock == uint256{"00000000000008c1637e7d3252dc1c333d4546fd6fff6a474b200d674a91d497"}); assert(genesis.hashMerkleRoot == uint256{"8c5899b65c5b0834adb17af314e22a9bf067e7ed8144c37967b5ec56b5a6e28d"}); ``` Also [here](https://github.com/bitcoin/bips/pull/2356) and [here](https://lapis.erisian.com.au/chain.html).
polespinasa (Migrated from github.com) reviewed 2026-11-14 08:15:48 +00:00
polespinasa (Migrated from github.com) commented 2026-11-14 08:15:48 +00:00
For reviewers, the params can be verified here: https://lapis.erisian.com.au/chain.json
fjahr commented 2026-11-14 11:23:03 +00:00 (Migrated from github.com)

Rebased on the latest version of #35793 and added the genesis block from bitcoin/bips#2356. The node can now sync the current chain when you have a node to manually connect to and -testnet5 -addnode=lapis.erisian.com.au:18353 works for now.

Rebased on the latest version of #35793 and added the genesis block from bitcoin/bips#2356. The node can now sync the current chain when you have a node to manually connect to and `-testnet5 -addnode=lapis.erisian.com.au:18353` works for now.
polespinasa commented 2026-11-21 07:43:20 +00:00 (Migrated from github.com)

Achow is already running a seeder that we can commit here so users can relay on.
Note that it has been running for a few hours and it takes time to start returning results.
Also we should update the generate fixed seeds script:

$ git diff
diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md
index 388ddd5453..5aa47b2477 100644
--- a/contrib/seeds/README.md
+++ b/contrib/seeds/README.md
@@ -20,6 +20,7 @@ curl https://mainnet.achownodes.xyz/seeds.txt.gz | gzip -dc >> seeds_main.txt
 curl https://signet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_signet.txt
 curl https://testnet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_test.txt
 curl https://testnet4.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_testnet4.txt
+curl https://testnet5.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_testnet5.txt
 curl https://raw.githubusercontent.com/asmap/asmap-data/main/latest_asmap.dat > asmap-filled.dat
 python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt
 python3 makeseeds.py -a asmap-filled.dat -s seeds_signet.txt -m 266000 > nodes_signet.txt
diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py
index ff2b4028f0..e3f3b1d786 100755
--- a/contrib/seeds/generate-seeds.py
+++ b/contrib/seeds/generate-seeds.py
@@ -5,13 +5,14 @@
 '''
 Script to generate list of seed nodes for kernel/chainparams.cpp.
 
-This script expects three text files in the directory that is passed as an
+This script expects five text files in the directory that is passed as an
 argument:
 
     nodes_main.txt
     nodes_signet.txt
     nodes_test.txt
     nodes_testnet4.txt
+    nodes_testnet5.txt
 
 These files must consist of lines in the format
 
@@ -22,7 +23,7 @@ These files must consist of lines in the format
 
 The output will be several data structures with the peers in binary format:
 
-   inline constexpr uint8_t chainparams_seed_{main,signet,test,testnet4}[]{
+   inline constexpr uint8_t chainparams_seed_{main,signet,test,testnet4,testnet5}[]{
        ...
    };
 
@@ -182,6 +183,9 @@ def main():
     g.write('\n')
     with open(os.path.join(indir,'nodes_testnet4.txt'), 'r') as f:
         process_nodes(g, f, 'chainparams_seed_testnet4')
+    g.write('\n')
+    with open(os.path.join(indir,'nodes_testnet5.txt'), 'r') as f:
+        process_nodes(g, f, 'chainparams_seed_testnet5')
     g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n')
 
 if __name__ == '__main__':
diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp
index f997be9372..189505662f 100644
--- a/src/kernel/chainparams.cpp
+++ b/src/kernel/chainparams.cpp
@@ -542,9 +542,10 @@ public:
         assert(consensus.hashGenesisBlock == uint256{"00000000000008c1637e7d3252dc1c333d4546fd6fff6a474b200d674a91d497"});
         assert(genesis.hashMerkleRoot == uint256{"8c5899b65c5b0834adb17af314e22a9bf067e7ed8144c37967b5ec56b5a6e28d"});
 
-        // No DNS or fixed seeds defined for Testnet 5 yet.
         vFixedSeeds.clear();
         vSeeds.clear();
+        // nodes with support for servicebits filtering should be at the top
+        vSeeds.emplace_back("seed.testnet5.achownodes.xyz."); // Ava Chow
 
         base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
         base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);

Achow is already running a seeder that we can commit here so users can relay on. Note that it has been running for a few hours and it takes time to start returning results. Also we should update the generate fixed seeds script: ```diff $ git diff diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md index 388ddd5453..5aa47b2477 100644 --- a/contrib/seeds/README.md +++ b/contrib/seeds/README.md @@ -20,6 +20,7 @@ curl https://mainnet.achownodes.xyz/seeds.txt.gz | gzip -dc >> seeds_main.txt curl https://signet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_signet.txt curl https://testnet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_test.txt curl https://testnet4.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_testnet4.txt +curl https://testnet5.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_testnet5.txt curl https://raw.githubusercontent.com/asmap/asmap-data/main/latest_asmap.dat > asmap-filled.dat python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt python3 makeseeds.py -a asmap-filled.dat -s seeds_signet.txt -m 266000 > nodes_signet.txt diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py index ff2b4028f0..e3f3b1d786 100755 --- a/contrib/seeds/generate-seeds.py +++ b/contrib/seeds/generate-seeds.py @@ -5,13 +5,14 @@ ''' Script to generate list of seed nodes for kernel/chainparams.cpp. -This script expects three text files in the directory that is passed as an +This script expects five text files in the directory that is passed as an argument: nodes_main.txt nodes_signet.txt nodes_test.txt nodes_testnet4.txt + nodes_testnet5.txt These files must consist of lines in the format @@ -22,7 +23,7 @@ These files must consist of lines in the format The output will be several data structures with the peers in binary format: - inline constexpr uint8_t chainparams_seed_{main,signet,test,testnet4}[]{ + inline constexpr uint8_t chainparams_seed_{main,signet,test,testnet4,testnet5}[]{ ... }; @@ -182,6 +183,9 @@ def main(): g.write('\n') with open(os.path.join(indir,'nodes_testnet4.txt'), 'r') as f: process_nodes(g, f, 'chainparams_seed_testnet4') + g.write('\n') + with open(os.path.join(indir,'nodes_testnet5.txt'), 'r') as f: + process_nodes(g, f, 'chainparams_seed_testnet5') g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') if __name__ == '__main__': diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index f997be9372..189505662f 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -542,9 +542,10 @@ public: assert(consensus.hashGenesisBlock == uint256{"00000000000008c1637e7d3252dc1c333d4546fd6fff6a474b200d674a91d497"}); assert(genesis.hashMerkleRoot == uint256{"8c5899b65c5b0834adb17af314e22a9bf067e7ed8144c37967b5ec56b5a6e28d"}); - // No DNS or fixed seeds defined for Testnet 5 yet. vFixedSeeds.clear(); vSeeds.clear(); + // nodes with support for servicebits filtering should be at the top + vSeeds.emplace_back("seed.testnet5.achownodes.xyz."); // Ava Chow base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196); ```
fjahr commented 2026-11-22 11:22:49 +00:00 (Migrated from github.com)

Also we should update the generate fixed seeds script

Thanks! I added Ava's seeder in one commit and kept the changes to the fixed seeds script as a separate commit. The reason is the script change didn't work just like that. generate-seeds.py would fail because nodes_testnet5.txt doesn't exist yet and the user agent filter in makeseeds.py stops at 31.x currently so it excludes all Testnet5 nodes run 32.x and an empty list doesn't compile once chainparams.cpp uses it.

I opted for a complete fix to these issues in the second commit which adds 32.x to the filter, adds nodes_testnet5.txt (currently 6 addresses) and regenerates chainparamsseeds.h with that included. The other networks seeds are untouched.

I was a bit unsure about this initially and kept it as a separate commit because the filter is usually updated in the seed update before each release and also the list is still extremely small. But the list can be refreshed once this moves closer to merge and I don't see any harm that could be caused by updating the filter now. But if I missed something the commit can also just be dropped for now.

> Also we should update the generate fixed seeds script Thanks! I added Ava's seeder in one commit and kept the changes to the fixed seeds script as a separate commit. The reason is the script change didn't work just like that. `generate-seeds.py` would fail because `nodes_testnet5.txt` doesn't exist yet and the user agent filter in `makeseeds.py` stops at 31.x currently so it excludes all Testnet5 nodes run 32.x and an empty list doesn't compile once `chainparams.cpp` uses it. I opted for a complete fix to these issues in the second commit which adds 32.x to the filter, adds `nodes_testnet5.txt` (currently 6 addresses) and regenerates `chainparamsseeds.h` with that included. The other networks seeds are untouched. I was a bit unsure about this initially and kept it as a separate commit because the filter is usually updated in the seed update before each release and also the list is still extremely small. But the list can be refreshed once this moves closer to merge and I don't see any harm that could be caused by updating the filter now. But if I missed something the commit can also just be dropped for now.
arejula27 commented 2026-11-24 21:32:55 +00:00 (Migrated from github.com)

I think the PR description is a bit out of date now. The genesis block was already added ( bitcoin/bips#2356), there is a DNS seed and fixed seeds (49a44031d2) and the PR is no longer in draft. It could be nice to update .

Thanks for working on this! I'm looking forward to finding some time to try mining on it with p2poolv2.

I think the PR description is a bit out of date now. The genesis block was already added ( bitcoin/bips#2356), there is a DNS seed and fixed seeds (49a44031d2) and the PR is no longer in draft. It could be nice to update . Thanks for working on this! I'm looking forward to finding some time to try mining on it with p2poolv2.
DrahtBot commented 2026-12-01 11:49:04 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35861
No description provided.