halo2_base::utils::halo2

Trait KeygenCircuitIntent

Source
pub trait KeygenCircuitIntent<F: Field> {
    type ConcreteCircuit: Circuit<F>;
    type Pinning;

    // Required methods
    fn get_k(&self) -> u32;
    fn build_keygen_circuit(self) -> Self::ConcreteCircuit;
    fn get_pinning_after_keygen(
        self,
        kzg_params: &ParamsKZG<Bn256>,
        circuit: &Self::ConcreteCircuit,
    ) -> Self::Pinning;
}
Expand description

This trait should be implemented on the minimal circuit configuration data necessary to completely determine a circuit (independent of circuit inputs). This is used to generate a dummy instantiation of a concrete Circuit type for the purposes of key generation. This dummy instantiation just needs to have the correct arithmetization format, but the witnesses do not need to satisfy constraints.

Required Associated Types§

Source

type ConcreteCircuit: Circuit<F>

Concrete circuit type

Source

type Pinning

Additional data that “pins” down the circuit. These can always to deterministically rederived from Self, but storing the Pinning saves recomputations in future proof generations.

Required Methods§

Source

fn get_k(&self) -> u32

The intent must include the log_2 domain size of the circuit. This is used to get the correct trusted setup file.

Source

fn build_keygen_circuit(self) -> Self::ConcreteCircuit

Builds a dummy instantiation of Self::ConcreteCircuit for the purposes of key generation. This dummy instantiation just needs to have the correct arithmetization format, but the witnesses do not need to satisfy constraints.

Source

fn get_pinning_after_keygen( self, kzg_params: &ParamsKZG<Bn256>, circuit: &Self::ConcreteCircuit, ) -> Self::Pinning

Pinning is only fully computed after synthesize has been run during keygen

Implementors§