2. Methods
Here we detail the Setup
Setup
Setup defines the shared parameters for all other methods
#![allow(unused)] fn main() { Setup(max_coeffs: usize, point_sets: Vec<Vec<Scalar>>) -> Parameters }
max_coeffs
is the maximum number of coefficiens we will commit/open to at a time. For most curve choices, this should be a power of 2.point_sets
lists different sets of points where we can open a grid to.- This is done so we can do ahead-of-time computation that only depends on which set of points we are opening at, and not on the actual contents of the data at those indicies.
Ex:
point_sets = [[0, 4], [1, 2]]
means I can open any rows of the grid at[0, 4]
or[1, 2]
. We can only open at both[0, 4]
at the same time, and not0
or4
individually.
Setup
does the following
- Samples a random
- Computes
- Computes 1
- For the -th set of points in
point_sets
- Enumerates the points at the given indicies from the FFT domain. Call them .
- Constructs the unique degree Lagrange polynomials for each
- If the denominator is zero due to a repeated point, setup errors
- Constructs the vanishing polynomial
- Computes
1
For method 1, we only need as many powers of as points we open to. For method 2, we only need .
Commit
Commiting is exactly the same as in KZG10
#![allow(unused)] fn main() { Commit(p: Parameters, poly: Polynomial) -> Commitment }
Takes the polynomial and computes .