Skip to content

feat(zclassic): Add Zclassic (ZCL) support#4152

Open
lelonex wants to merge 6 commits intobitpay:masterfrom
lelonex:submit/zcl-bitcore
Open

feat(zclassic): Add Zclassic (ZCL) support#4152
lelonex wants to merge 6 commits intobitpay:masterfrom
lelonex:submit/zcl-bitcore

Conversation

@lelonex
Copy link
Copy Markdown

@lelonex lelonex commented May 1, 2026

Summary

This PR adds full support for Zclassic (ZCL) — a community-driven, open-source fork of Zcash — to the Bitcore monorepo.

Zclassic was created in 2016 by removing the 20% founder's reward from Zcash, making it a purely community-owned coin. It uses the Equihash proof-of-work algorithm, supports transparent (t1/t3) and shielded addresses, and is fully compatible with the Zcash transaction format (ZIP-205/Sapling).

Note: This submission is made on behalf of the Zclassic community. There is no company or organization behind it. We are requesting review and merge on technical merit and ask for no preferential treatment — only fair consideration.


Changes

New Packages

  • packages/zclassic-bitcore-lib — Core JavaScript library for Zclassic. Handles key derivation, address encoding/decoding, transaction building and signing, Equihash block header parsing, and ZIP-205 Sapling signature hash computation.
  • packages/zclassic-bitcore-p2p — P2P networking layer for Zclassic. Implements the Zclassic wire protocol (magic bytes 0x24e92764, port 8033, protocol version 170011).

Modified Packages

packages/bitcore-node

  • Added modules/zclassic/ — ZCL chain module, P2P sync worker, and verification peer
  • Added providers/chain-state/zcl/ — chain state provider for ZCL
  • Modified providers/libs/index.ts — register zclassic-bitcore-lib and zclassic-bitcore-p2p
  • Modified modules/index.ts — register ZCL module
  • Fixed models/block.ts — skip transactions with negative fees in fee statistics (affects Sapling shielded transactions)
  • Fixed models/transaction.ts — clamp negative fee values to 0 (Sapling valueBalance caused incorrect negative fees)

packages/crypto-wallet-core

  • Added src/constants/chains.ts — ZCL chain identifier
  • Added src/derivation/zcl/ — BIP44 derivation path m/44'/147'/0'/0/0
  • Added src/transactions/zcl/ — transaction builder
  • Added src/validation/zcl/ — address validation
  • Added src/message/zcl.ts — message signing
  • Added src/types/zcl-modules.d.ts — TypeScript ambient declarations

packages/insight

  • Added ZCL to supported currencies and coin selector
  • Added ZCL logo
  • Updated constants.ts — ZCL API routing
  • Updated helper-methods.tsgetApiRoot() returns correct endpoint for ZCL
  • TypeScript type declarations for zclassic-bitcore-lib

Technical Details

Property Value
Coin ID (SLIP-0044) 147
Symbol ZCL
Decimals 8
Network magic 0x24e92764
P2P port 8033
RPC port 8023
Protocol version 170011
P2PKH prefix 0x1C 0xB8 — t1 addresses
P2SH prefix 0x1C 0xBD — t3 addresses
Transaction format Zcash v4 / ZIP-205 (Sapling)
Derivation path m/44'/147'/0'/0/0
Explorer https://explorer.zcl.zelcore.io

Testing

The implementation has been tested against a live Zclassic mainnet node (zclassicd v2.1.1-10):

  • Full blockchain sync completed (3,070,000+ blocks indexed)
  • P2P connection stable with protocol version 170011
  • Address derivation, transaction building and broadcasting verified
  • Insight explorer fully functional with live ZCL data
  • Fee calculation correctly handles Sapling valueBalance edge cases

References

Lelonex added 4 commits May 1, 2026 08:52
Add full ZCL support including:
- zclassic-bitcore-lib: core library (Equihash, ZIP-205, transparent addresses)
- zclassic-bitcore-p2p: P2P networking layer
- bitcore-node: ZCL chain module, P2P worker, chain-state provider
- crypto-wallet-core: ZCL derivation, transaction builder, address validation
- insight: ZCL UI support, logo, constants
- Fix negative fee calculation for Sapling/shielded transactions
…ore-lib, regenerate lock file

Resolves CI failure: npm ci could not find zclassic-bitcore-lib in registry.
Changed dependency from npm semver to file:../zclassic-bitcore-lib (local monorepo package).
…as local dependencies

Required by src/providers/libs/index.ts at runtime.
Both resolved as file: references to local monorepo packages.
…back

In environments where zclassic packages are not installed (e.g. CI
running npm ci on individual packages), the eager require was crashing
at module load time. Now ZCL libs are loaded lazily and silently skipped
if not available.
@lelonex
Copy link
Copy Markdown
Author

lelonex commented May 1, 2026

Note: the test:crypto-rpc CI failure seems a pre-existing flaky test unrelated to this PR. The error is ProviderError: transaction indexing is in progress on the geth node — a race condition in the test environment during startup.

ZCL (Zclassic) is a Bitcoin-protocol chain and uses its own node (zclassicd) via the existing bitcore-node P2P infrastructure, completely independent from EVM/geth. The ZCL integration adds zclassic-bitcore-lib and zclassic-bitcore-p2p as local monorepo packages, with no impact on the Ethereum stack.

Lelonex added 2 commits May 1, 2026 17:29
Prevents flaky CI failure where hardhat:deploy runs before geth has
finished transaction indexing. Polls eth_blockNumber with retries
(60x2s) before proceeding. Also adds .eslintignore for blockchain/ dir.
Replaces custom polling script with battle-tested wait-on package.
Waits up to 2 minutes for geth:8545 to be ready before deploying contracts,
fixing flaky CI failure (ProviderError: transaction indexing is in progress).
@kajoseph
Copy link
Copy Markdown
Collaborator

kajoseph commented May 1, 2026

Hey @lelonex , thanks for the PR! Before I can even consider this work, please review the CONTRIBUTING.md doc, specifically the part about commit signing. I can't merge this PR until all your commits are signed & verified.

Also, in keeping with the pattern of this repo, please rename zclassic-bitcore-lib and zclassic-bitcore-p2p to bitcore-lib-zcl and bitcore-p2p-zcl.

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.

2 participants