Skip to main content
The ComponentProvers struct is similar to the Components struct but implements additional functions required by the prover, such as computing the composition polynomial. It is a collection of prover components as follows:
Here, components is a collection of objects that implement the ComponentProver trait. The ComponentProver trait is a wrapper around the Component trait with an additional function shown as follows:
We can convert the ComponentProvers into a Components struct as follows:
The main function defined on the ComponentProvers struct to compute the composition polynomial is implemented as follows:
Let us examine the above function for our example AIR containing two components. It takes the following three inputs:
  • &self: This is the ComponentProvers on which the function is called.
  • random_coeff: This is an element from the SecureField (i.e. QM31\mathsf{QM31}). In our example, this is represented as γ\gamma.
  • trace: The Trace struct which contains all the polynomials that make up the entire trace including all the components. For efficiency, it stores each polynomial in both coefficients and evaluations form.
Now let us examine the body of the function. First, we compute total_constraints and initialize an accumulator. The total_constraints determine the number of powers of γ\gamma (random_coeff) required for the random linear combination. For each component, we call evaluate_constraint_quotients_on_domain, which computes and accumulates the evaluations of that component’s quotients on their respective evaluation domains within the accumulator. For the 00th component, we add the evaluations of the quotient q0q_0 over its evaluation domain Dn0+βD_{n_0 + \beta} to the accumulator. Similarly, for the 11st component, we add the evaluations of the quotient q1q_1 over its evaluation domain Dn1+βD_{n_1 + \beta} to the accumulator. After adding all component quotient evaluations to the accumulator, we call the finalize() function, which:
  1. Combines the accumulated evaluations at different domain sizes to compute the evaluations of the quotient composition polynomial qq over the domain Dn+βD_{n + \beta} where n=max(n1,n2)n = \max{(n_1, n_2)}.
  2. Interpolates qq over Dn+βD_{n + \beta} using circle FFT to convert it into coefficient representation.
Note that the output is a SecureCirclePoly since the evaluations of qq are in the secure field QM31\mathsf{QM31} (as γ\gamma is randomly sampled from QM31\mathsf{QM31}).