-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
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
nVersionGroupIdfield (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).
dawgster
Metadata
Metadata
Assignees
Labels
No labels