Module kimchi::snarky

source ·
Expand description

Snarky is the front end to kimchi, allowing users to write their own programs and convert them to kimchi circuits.

See the Mina book for more detail about this implementation.

See the tests.rs file for examples of how to use snarky.

Modules

  • The main interface to using Snarky.
  • An ASM-like language to print a human-friendly version of a circuit.
  • The Boolean type is a snarky type that represents a boolean variable.
  • Constants used for poseidon.
  • The backend used by Snarky, gluing snarky to kimchi. This module holds the actual logic that constructs the circuit using kimchi’s gates, as well as the logic that constructs the permutation, and the symbolic execution trace table (both for compilation and at runtime).
  • Functions associated to the Poseidon hash function.
  • A handy module that you can import the content of to easily use snarky.
  • The circuit-generation and witness-generation logic.
  • The SnarkyType trait is a useful trait that allows us to define our own snarky variables on top of FieldVar. Without it, we’d be limited to using the FieldVar type directly, handling and returning arrays of FieldVars all the time. So this is useful for the same reason that programming languages allow users to define their own types, instead of relying only on usize.