Skip to content

Comments

Add testnet4 network support (Bitcoin Core 28.0+)#111

Open
al-munazzim wants to merge 2 commits intodiybitcoinhardware:developfrom
al-munazzim:testnet4-v2
Open

Add testnet4 network support (Bitcoin Core 28.0+)#111
al-munazzim wants to merge 2 commits intodiybitcoinhardware:developfrom
al-munazzim:testnet4-v2

Conversation

@al-munazzim
Copy link

Summary

Bitcoin Core 28.0 introduces testnet4 as the replacement for testnet3. This PR adds support for the new network.

Changes

  • Add testnet4 to NETWORKS with same address parameters as testnet3 (bech32 tb, tpub/tprv, coin_type 1)
  • Add get_network() helper function with testnet4 fallback
  • Only modifies Bitcoin networks (src/embit/networks.py); Liquid inherits via NETWORKS.update()
  • Add comprehensive tests for network definitions

Testing

PYTHONPATH=src python3 -m unittest tests.tests.test_networks -v

All 7 tests pass:

  • All expected networks present
  • testnet4 has correct parameters (matching testnet3)
  • get_network() works for direct lookup, testnet4, and returns None for unknown

References

  • Bitcoin Core 28.0 release notes (testnet4 activation)
  • [BIP-???] (testnet4 uses same address encoding as testnet3)

Fixes #108


Recreated from #109 against develop branch per maintainer feedback.

- Add testnet4 to NETWORKS with same params as testnet3
- Add get_network() helper with testnet4 fallback
- testnet4 uses identical address parameters (bech32 'tb', tpub/tprv)
- Only Bitcoin networks modified; Liquid inherits via NETWORKS.update()
- Add comprehensive tests for network definitions

Fixes diybitcoinhardware#108
- Run tests on Python 3.9-3.12
- Experimental MicroPython Unix port testing
- Triggers on push/PR to master and develop branches
- Updated test_networks.py to use MicroPython-compatible unittest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant