Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Support testnet4 (BIP 94)

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Start with btc_toolkit/api.py and SUPPORTED_NETWORKS, then trace network handling through cli.py, encoding.py, address.py, tx.py and verify.py; read CONTRIBUTING.md first. Run the mocked unit tests and extend tests/test_completions.py to check network values against SUPPORTED_NETWORKS. Done when the testnet4 genesis block is returned, tests cover the network, and completions and docs list it.

Written by the indexing model from the issue text.

Description

enhancement help wanted

--network accepts mainnet, testnet (testnet3) and signet (SUPPORTED_NETWORKS in btc_toolkit/api.py). Testnet3 is being phased out in favour of testnet4 (BIP 94), which mempool.space serves at https://mempool.space/testnet4/api.

Where networks are handled today

  • btc_toolkit/api.py: base URLs and SUPPORTED_NETWORKS
  • btc_toolkit/cli.py: explorer links and the per-network notes printed by verify
  • btc_toolkit/encoding.py: address encodings (testnet4 uses the same prefixes as testnet3: tb, m/n, 2)
  • btc_toolkit/address.py, btc_toolkit/tx.py: network checks
  • btc_toolkit/verify.py: _POW_LIMIT
  • completions/, docs/, README, CHANGELOG.md, SECURITY.md, the network: docstrings in balance.py, block.py, fees.py, tx.py, utxo.py and the usage line at the top of cli.py
  • .github/scripts/live_smoke.py: the weekly live test checks signet today; a testnet4 check fits there

Notes

  • BIP 94 changes the difficulty adjustment and adds a time-warp fix. verify only checks that the header hash is below the header's own target and that this target is not easier than the network's limit; testnet4's minimum difficulty (0x1d00ffff) is the same as testnet3's, so the check itself should not need new rules. Please confirm this in the pull request.
  • verify falls back silently to signet's limit for a network missing from _POW_LIMIT (.get(network, ...)), so add the key explicitly.
  • Keep testnet meaning testnet3 for now; changing that is a separate decision.

Done when

  • btc-toolkit block 0 --network testnet4 --json returns the BIP 94 genesis block 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043.
  • Mocked unit tests cover the new network; the completions and the docs list it, and tests/test_completions.py is extended to check the completions' network values against SUPPORTED_NETWORKS (today it checks only commands and flags).

See CONTRIBUTING.md. Comment below before starting.

Dominant language
Python
Stars
2
Forks
1
Avg merge
1h 22m
Merged PRs (30d)
41

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from devdavidejesus/btc-toolkit

All issues in devdavidejesus/btc-toolkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.