Repository navigation
feat: add zcash mainnet and testnet - #17
Merged
Merged
Conversation
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
schemas/network.schema.jsontypeenum →["evm", "bitcoin", "solana", "zcash"]data/networks.jsondata/rpcs/zec/{mainnet,testnet}.jsonscripts/validate.tszecbranch asserting thebip122:namespace, mirroringbtcassets/networks/zcash-mainnet.svgREADME.mdpackage.json1.2.1-alpha.0→1.3.0-alpha.0Zcash gets its own
typerather than reusingbitcoin. It is a Bitcoin fork and sharesthe
bip122:CAIP-2 namespace, but its RPC surface differs enough — shielded pools,hash_or_heightas a string, numeric verbosity, object-bag address-index params — that theexplorer needs a separate adapter branch, and that branch keys off
type.No
slugfield:network.schema.jsonsetsadditionalProperties: falseand has noslug, and the explorer already maps networkId → route slug in its ownsrc/config/networks.json, exactly as it does forbtc/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.
networkIdbip122:00040fe8ec8471911baa1db1266ea15d00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08getblockhash(0)bip122:05a60a92d99d85997cce3b87616c089f05a60a92d99d85997cce3b87616c089f6124d7342af37106edc76126334a2c38getblockhash(0)These match the
ZCASH_MAINNET/ZCASH_TESTNETconstants inopenscan/network-connectors.RPC endpoints
data/rpcs/zec/mainnet.jsonlists the same two hostsnetwork-connectorsuses as itsdefaults, in the same order (zebrad host first); the testnet file adds the two matching
testnet hosts. All four answered
getblockchaininfolive — mainnet at block 3483238,testnet at 4346263.
Hosted Zcash RPC is genuinely thin — dRPC returns
Unknown network, blockpiunknown host, lava.build 403s, and PublicNode, Ankr, GetBlock, Blockdaemon, OnFinality, Dwellir,AllThatNode and BlastAPI have no Zcash host at all. Two constraints worth knowing:
inside a minute returned
429regardless of which host it went to. Listing two pernetwork buys redundancy, not throughput.
z_*andgetaddress*call returns-32601,along with
getinfo,getpeerinfo,getmininginfo,getblocksubsidyandgetstandardfee. The whitelist is fixed, not tier-based — an API key raises the ratelimit 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 degradesthem on
-32601.Follow-up for the explorer (#398)
MetadataService.getRpcPathFromNetworkIdroutes everybip122:id torpcs/btc/{slug}.jsonthrough a hardcoded genesis-hash map and returnsnullon a miss.Zcash shares that namespace, so the explorer needs a Zcash hash map →
rpcs/zec/, plus aMETADATA_VERSIONbump to the version this PR publishes.Verification
npm run validate— 439 files, all validnpm run lint/npm run format— cleannpm run build— 21 networks;dist/rpcs/zec/{mainnet,testnet}.jsonat 2 endpointseach; both Zcash ids present in
dist/rpcs/all.json; logo copied todist/assets/bitcoin-mainnet.svgThe README also picks up the
solana/rows that were missing from the same two lists.