Skip to main content

zkSNARKs & Circuits

There are two verifiers in the ZeroPool solution:

  • Transfer verifier is used to check transaction correctness. The associated proofs are generated by the user on transaction creation and calculated with the transaction circuit. The main question the verifier answers is whether the user is able to make the corresponding deposit\transfer\withdrawal.
  • Tree verifier is used to check the Merkle tree updating sequence. The transaction subtree (which should be added to the general tree) should be placed on the correct offset to update the Merkle tree root properly. The associated proofs are usually generated by the relayer (but the user should calculate the proof himself when he wants to interact with the Pool contract directly). The main question the verifier answers is whether the Merkle tree has been updated correctly.

Repositories‚Äč

  • Fawkes-Crypto zkSnarks framework: A lightweight framework for building circuits in bellman, using groth16 proving system and BN254 curve.library with circuits and cryptography of ZeroPool.
  • libzeropool: Library with circuits and cryptography of ZeroPool.
  • libzeropool-rs Rust library wrapper for libzeropool which includes:
    • libzeropool-rs::merkle - Merkle Tree implementation
    • libzeropool-rs::client - UserAccount implementation. Transaction data created here.