vote-commitment-tree 0.1.0

Append-only Poseidon Merkle tree for Vote Authority Notes and Vote Commitments in the Zcash shielded-voting protocol.
Documentation

vote-commitment-tree

Append-only Poseidon Merkle tree for Vote Authority Notes (VANs) and vote commitments in the Zcash shielded-voting protocol.

The tree is maintained per vote round. Each delegation appends a VAN leaf; each cast-vote appends a new VAN plus a vote-commitment leaf. The chain publishes the tree root at every block height, which wallets use as a public input to ZKP2 (vote-commitment proof).

Usage

Sibling crate of zcash_voting; typically consumed transitively by wallets that pull that top-level crate. Standalone usage:

use vote_commitment_tree::TreeHandle;

let mut tree = TreeHandle::open("/path/to/tree.kv")?;
tree.append(&leaf_cmx)?;
let root = tree.root()?;
let path = tree.path(leaf_position)?;

See vote-commitment-tree-client for the HTTP/CLI client that syncs this tree from a running Zcash voting chain node.

License

Dual-licensed under MIT or Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.