Skip to content

Add Zcash testnet (tZEC) network symbol for address generation#430

Merged
richardkiss merged 4 commits intomainfrom
copilot/generate-zec-testnet-addresses
Jan 11, 2026
Merged

Add Zcash testnet (tZEC) network symbol for address generation#430
richardkiss merged 4 commits intomainfrom
copilot/generate-zec-testnet-addresses

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

Adds support for generating Zcash testnet addresses. Parameters extracted from src/chainparams.cpp in the Zcash repository.

Changes

  • pycoin/symbols/tzec.py: New network symbol with testnet parameters:

    • Address prefix 0x1D25 (tm addresses)
    • Script prefix 0x1CBA (t2 addresses)
    • WIF prefix 0xEF
    • BIP32 prefixes 0x04358394/0x043587CF (tprv/tpub)
  • tests/cmds/test_cases/ku/bip32_subpaths_tzec.txt: Test coverage using ku test format for address generation, WIF, and BIP32

Usage

from pycoin.symbols.tzec import network

key = network.keys.private(secret_exponent=12345)
print(key.address())  # tmBe4yt4qKAwAa5jCZ5nT2ECR5Yt372bNXP

bip32 = network.keys.bip32_seed(b"seed phrase")
print(bip32.hwif(as_private=1))  # tprv...

Follows the same pattern as other testnet implementations (e.g., tdash.py, xtn.py).

Original prompt

This section details on the original issue you should resolve

<issue_title>How to generate ZEC testnet addresses?</issue_title>
<issue_description>

symbol="ZEC", network_name="Zcash", subnet_name="mainnet",
</issue_description>

Comments on the Issue (you are @copilot in this section)

@richardkiss For coins that fork the bitcoin source code, this information can often be found in src/chainparams.cpp. Patches welcome! @richardkiss @copilot Want to give this a crack?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 7, 2026 20:15
- Created pycoin/symbols/tzec.py with testnet parameters from chainparams.cpp
- Testnet addresses start with 'tm' (prefix 0x1D25)
- Script addresses start with 't2' (prefix 0x1CBA)
- WIF prefix: 0xEF
- BIP32 prefixes: tprv/tpub (0x04358394/0x043587CF)
- Added comprehensive tests in tests/tzec_test.py

Co-authored-by: richardkiss <5336+richardkiss@users.noreply.github.com>
Co-authored-by: richardkiss <5336+richardkiss@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to generate ZEC testnet addresses Add Zcash testnet (tZEC) network symbol for address generation Jan 7, 2026
Copilot AI requested a review from richardkiss January 7, 2026 20:19
@richardkiss
Copy link
Owner

@copilot Can you add a ku test similar to the existing tests that use ku? Should require just text files, no code changes. We don't need the tzec_test.py file if you do it this way

- Removed tests/tzec_test.py
- Added tests/cmds/test_cases/ku/bip32_subpaths_tzec.txt
- Tests now use text file format like other networks

Co-authored-by: richardkiss <5336+richardkiss@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot Can you add a ku test similar to the existing tests that use ku? Should require just text files, no code changes. We don't need the tzec_test.py file if you do it this way

Done! Replaced tests/tzec_test.py with tests/cmds/test_cases/ku/bip32_subpaths_tzec.txt that uses the ku test format like other networks. The test passes successfully. (commit ee4a6d8)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • blockchain.info
    • Triggering command: /usr/bin/python3 python3 -m unittest tests.cmds.cmdline_test -v (dns block)
  • blockexplorer.com
    • Triggering command: /usr/bin/python3 python3 -m unittest tests.cmds.cmdline_test -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@richardkiss richardkiss marked this pull request as ready for review January 11, 2026 20:12
@richardkiss richardkiss merged commit 8036d56 into main Jan 11, 2026
7 of 9 checks passed
@richardkiss richardkiss deleted the copilot/generate-zec-testnet-addresses branch January 11, 2026 20:17
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.

How to generate ZEC testnet addresses?

2 participants