zcash_voting
Client-side library for integrating Zcash shielded voting into a wallet. Wraps the Halo 2 ZKPs, hotkey derivation, share construction, and governance-PCZT assembly that a wallet needs to participate in an on-chain voting round.
Usage
Wallets typically consume this through a language bridge:
- Rust wallets: add
zcash_voting = "0.1"toCargo.toml. - iOS wallets: depend on
valargroup/zcash-swift-wallet-sdkbranchshielded-vote, which bundles this crate.
See the wallet integration guide for the full flow.
Crate layout
| Crate | Purpose |
|---|---|
zcash_voting (this crate) |
Top-level API: proof generation, hotkey derivation, share construction, PCZT assembly, round-state storage. |
vote-commitment-tree |
Append-only Poseidon Merkle tree for VANs and vote commitments. |
vote-commitment-tree-client |
HTTP client + CLI for syncing the vote commitment tree from a running chain node. |
Dependency notes
zcash_voting tracks the upstream Zcash crates directly:
orchard 0.13— upstreamzcash/orchard, pinned via a[patch.crates-io]redirect to thevalargroup/orchardvalar/0.13-spend-auth-gbranch (tracked by valargroup/orchard PR #19). That branch carries orchard 0.13.0 plus theunstable-voting-circuitsfeature gate that exposes the governance-visibility APIs, plus cherry-picks of zcash/orchard #489 (SpendAuthG fixed-base multiplication) and zcash/orchard #495 (NoteValue::ZEROpublic associated constant). Once both upstream PRs land and anorchard 0.14ships, this pin will collapse to the published crate.pczt,zcash_keys,zcash_primitives,zcash_protocol,zcash_address,zcash_encoding,zcash_transparent— pinned to a recent commit of upstreamzcash/librustzcashmain. The previousvalargroup/librustzcashfork (with shielded-voting getters in PCZT and friends) has been fully retired now that the relevant PRs (#2281, #2283, #2284) have all merged upstream.
License
Dual-licensed under MIT or Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.