/zendoo-cctp-lib

Primary LanguageRustMIT LicenseMIT

zendoo-cctp-lib

zendoo-cctp-lib exposes all the common Rust crypto components and data structures needed to support Zendoo in Mainchain and Sidechain.

In particular it exposes interfaces to:

  • build and compute the root of the BitVectorTree (as described in Appendix A of the Zendoo paper) starting from the BitVector itself, with additional compression/decompression capabilities allowing its cheap inclusion into Mainchain and Sidechain transactions
  • build the SCTxsCommitmentTree, as described in section 4.1.3 of the Zendoo paper, with additional functions to compute proofs of sidechain existence/absence
  • verify a single or a batch of Zendoo SNARK proofs related to backward transfer certificates and ceased sidechain withdrawals transactions. We provide support for verifying (Coboundary Marlin) proofs, our Marlin variant, and Final Darlin proofs, the proving system used in the last step of our recursive PCD scheme (See HGB for details)
  • generate and manage the DLOG verifier keys needed for the verification of such SNARK proofs

Please note: the code is in development. No guarantees are provided about its security and functionality

Build guide

The library compiles on the stable toolchain of the Rust compiler. To install Rust, first install rustup by following the instructions here, or via your platform's package manager. After that, use cargo, the standard Rust build tool, to build the library:

git clone https://github.com/HorizenOfficial/zendoo-cctp-lib.git
cd zendoo-cctp-lib
cargo build --release

This library comes with unit tests for each of the provided crates. Run the tests with:

cargo test --all-features

More detailed build guide can be found in in our build guide.