Skip to content

feat: add zcash mainnet and testnet - #17

Merged
MatiasOS merged 6 commits into
openscan-explorer:mainfrom
MatiasOS:issue-397-add-zcash
Sep 14, 2026
Merged

MatiasOS merged 6 commits into
openscan-explorer:mainfrom
MatiasOS:issue-397-add-zcash

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Adds Zcash (mainnet + testnet) so the explorer can load it the way it loads Bitcoin and Solana.

Closes openscan-explorer/explorer#397. Unblocks openscan-explorer/explorer#398.

Changes

File Change
schemas/network.schema.json type enum → ["evm", "bitcoin", "solana", "zcash"]
data/networks.json Zcash mainnet + testnet entries
data/rpcs/zec/{mainnet,testnet}.json four free, key-less RPC endpoints
scripts/validate.ts zec branch asserting the bip122: namespace, mirroring btc
assets/networks/zcash-mainnet.svg 64×64 badge, shared by both entries
README.md network-type sentence, CAIP-2 table, dist tree
package.json 1.2.1-alpha.0 → 1.3.0-alpha.0

Zcash gets its own type rather than reusing bitcoin. It is a Bitcoin fork and shares
the bip122: CAIP-2 namespace, but its RPC surface differs enough — shielded pools,
hash_or_height as a string, numeric verbosity, object-bag address-index params — that the
explorer needs a separate adapter branch, and that branch keys off type.

No slug field: network.schema.json sets additionalProperties: false and has no
slug, and the explorer already maps networkId → route slug in its own
src/config/networks.json, exactly as it does for btc/tbtc.

Network identifiers

Both are CAIP-2 ids derived from the first 32 hex chars of each genesis block hash.
Zcash is not in the chainagnostic bip122 registry
(Bitcoin, Bitcoin Cash, Litecoin and Dogecoin only), so these follow the CAIP-4 rule rather
than being copied — same as how the Bitcoin entries were produced.

Network networkId Genesis hash Verified
Mainnet bip122:00040fe8ec8471911baa1db1266ea15d 00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08 live getblockhash(0)
Testnet bip122:05a60a92d99d85997cce3b87616c089f 05a60a92d99d85997cce3b87616c089f6124d7342af37106edc76126334a2c38 live getblockhash(0)

These match the ZCASH_MAINNET / ZCASH_TESTNET constants in openscan/network-connectors.

RPC endpoints

data/rpcs/zec/mainnet.json lists the same two hosts network-connectors uses as its
defaults, in the same order (zebrad host first); the testnet file adds the two matching
testnet hosts. All four answered getblockchaininfo live — mainnet at block 3483238,
testnet at 4346263.

https://zcash-mainnet-zebrad.gateway.tatum.io
https://zcash-mainnet.gateway.tatum.io
https://zcash-testnet-zebrad.gateway.tatum.io
https://zcash-testnet.gateway.tatum.io

Hosted Zcash RPC is genuinely thin — dRPC returns Unknown network, blockpi unknown host, lava.build 403s, and PublicNode, Ankr, GetBlock, Blockdaemon, OnFinality, Dwellir,
AllThatNode and BlastAPI have no Zcash host at all. Two constraints worth knowing:

  • All four share a single per-IP bucket of 5 req/min. Reproduced here: a 6th request
    inside a minute returned 429 regardless of which host it went to. Listing two per
    network buys redundancy, not throughput.
  • The gateway whitelists methods. Every z_* and getaddress* call returns -32601,
    along with getinfo, getpeerinfo, getmininginfo, getblocksubsidy and
    getstandardfee. The whitelist is fixed, not tier-based — an API key raises the rate
    limit and unlocks nothing.

Decision recorded for the last acceptance criterion: hosted-only for now. These
endpoints cover blocks, transactions, mempool and address validation. Shielded-pool and
address-index views need a self-hosted zebrad (mainnet RPC port 8232,
enable_cookie_auth = false); until one exists they stay gated in #398, which degrades
them on -32601.

Follow-up for the explorer (#398)

MetadataService.getRpcPathFromNetworkId routes every bip122: id to
rpcs/btc/{slug}.json through a hardcoded genesis-hash map and returns null on a miss.
Zcash shares that namespace, so the explorer needs a Zcash hash map → rpcs/zec/, plus a
METADATA_VERSION bump to the version this PR publishes.

Verification

  • npm run validate — 439 files, all valid
  • npm run lint / npm run format — clean
  • npm run build — 21 networks; dist/rpcs/zec/{mainnet,testnet}.json at 2 endpoints
    each; both Zcash ids present in dist/rpcs/all.json; logo copied to dist/assets/
  • All four endpoints smoke-tested live (see above)
  • Logo rendered at 128px and 32px and compared against bitcoin-mainnet.svg

The README also picks up the solana/ rows that were missing from the same two lists.

@MatiasOS
MatiasOS requested a review from AugustoL September 14, 2026 15:42
@MatiasOS
MatiasOS merged commit 8caba47 into openscan-explorer:main Sep 14, 2026
3 checks passed
@MatiasOS
MatiasOS deleted the issue-397-add-zcash branch September 14, 2026 19:25
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.

feat: add Zcash to explorer-metadata

1 participant