Skip to content

Add Zcash "transparent" adapter (no shielded addresses)Β #27

@IkerAlus

Description

@IkerAlus

It would be interesting to add a Chain Adapter for Zcash chain to the library. Note that while Zcash is based on the Bitcoin codebase (and also uses Secp256k1 as signature scheme), it has diverged significantly regarding transaction serialization and signature hashing (due to the Overwinter and Sapling network upgrades). Standard bitcoinjs-lib adapters will not work; we need an adapter specifically handling Zcash consensus rules.

Scope:

  • Support for Transparent Addresses (t-addrs) only. Shielded z-addr support requires heavy client-side zk-SNARK generation and is out of scope here.
  • Support for Mainnet and Testnet.

Main Differences with Bitcoin Adapter:

  • Library Requirement: We cannot use standard bitcoinjs-lib. bitgo-utxo-lib (used by BitGo and others) is probably the go-to dependency, which supports the specific Zcash logic.
  • Transaction Versioning: Zcash transactions must use Version 4 (Sapling) or Version 5 (Nu5). Legacy Bitcoin versions (1 or 2) will be rejected by the network.
  • Version Group ID: Zcash transactions require a nVersionGroupId field (introduced in Overwinter) to prevent replay attacks across forks.
  • Signature Hashing: Zcash uses ZIP 243 (Signature Hash for Overwinter/Sapling). This algorithm requires the amount (value) of the input being spent to be included in the pre-image hash. (Legacy Bitcoin only requires the script).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions