Support testnet4 (BIP 94)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 68/100
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
--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 andSUPPORTED_NETWORKSbtc_toolkit/cli.py: explorer links and the per-network notes printed byverifybtc_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 checksbtc_toolkit/verify.py:_POW_LIMITcompletions/,docs/, README,CHANGELOG.md,SECURITY.md, thenetwork:docstrings inbalance.py,block.py,fees.py,tx.py,utxo.pyand the usage line at the top ofcli.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.
verifyonly 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. verifyfalls back silently to signet's limit for a network missing from_POW_LIMIT(.get(network, ...)), so add the key explicitly.- Keep
testnetmeaning testnet3 for now; changing that is a separate decision.
Done when
btc-toolkit block 0 --network testnet4 --jsonreturns the BIP 94 genesis block00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043.- Mocked unit tests cover the new network; the completions and the docs list it, and
tests/test_completions.pyis extended to check the completions' network values againstSUPPORTED_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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devdavidejesus/btc-toolkit
-
documentation good first issue
Difficulty 2/5 Half a day Newbie friendliness 78/100
devdavidejesus/btc-toolkit#63 ·
Maintainers usually reply within 1 day
-
enhancement question
Difficulty 5/5 Over a week Newbie friendliness 25/100
devdavidejesus/btc-toolkit#67 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 3/5 1-2 days Newbie friendliness 58/100
devdavidejesus/btc-toolkit#66 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 58/100
devdavidejesus/btc-toolkit#65 ·
Maintainers usually reply within 1 day
All issues in devdavidejesus/btc-toolkit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
pydot/pydot#601 · 4 comments ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
letsencrypt/cp-cps#361 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresPossibly taken @maykonmichel claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
linuxmint/mintupdate#1107 ·