TurboPlonk
Findora's "triple masking" payment uses an optimized variant of TurboPlonk. The following equations summarize the structure.
We now describe the indexer, the prover, and the verifier.
The indexer in TurboPlonk computes the commitments and openings for indexer polynomials, which consist of the following:
- The fourteen selector polynomials:
- The five permutation polynomials:
First of all, let the number of gates be
, the constraint system should have indicated a permutation
, which fulfills the following requirements.
- Letbe the concatenated witness polynomial of. The concatenation is over the evaluation representation, not the coefficient representation.
- The evaluation ofremains unchanged after applyingas a permutation over the evaluation ofitself.
Now, given four different quadratic non-residues
and a generator
with order
, we define a mapping as follows.
where
. And we apply this mapping to each element in
, obtaining a map
. We split this map into five permutation polynomials, as follows.
- 's evaluation onequals's evaluation on.
- 's evaluation onequals's evaluation on.
- 's evaluation onequals's evaluation on.
- 's evaluation onequals's evaluation on.
- 's evaluation onequals's evaluation on.
Step 1: commit all polynomials
We first commit all these indexer polynomials. The commitments are included in the verifier parameters. We then perform some precomputation: we prepare a representation of these polynomials that are easy to be use later for proving, by doing a coset FFT over them. The prepared polynomials are included in the prover parameters.
Step 2: precompute the two helper polynomials
Compute the following polynomial defined on a domain
of size
:
and store its coset FFT representation. This is done by first observing that
evaluates to
on
and
otherwise in
. We can perform an inverse FFT to convert it back to the coefficient representation (which indeed looks nontrivial). Then, we perform a coset FFT, which gives us the prepared version of this polynomial.
Another polynomial we precompute is the vanishing polynomial of domain
of size
:
and we want to store its coset FFT representation. This is done by a coset FFT over the coefficient representation above. The representations for the two helper polynomials are included in the prover parameters.
Step 3: compute the Lagrange interpolation constants
Recall that the Lagrange interpolation from
where
is the generator for a domain
, into to a polynomial
of degree
is as follows:
We can rewrite it as follows.
Now, precompute
for every
.
This allows us to simplify
as follows.
These constants
are included in the verifier parameters. We conclude the description of the indexer.
The prover in TurboPlonk uses the prover parameters from the indexer and a complete constraint system with all the gate values and copy check information ready. It follows the following steps.
Step 1: assemble public inputs
The prover parameters have indicated which witness value indeed belongs to public inputs. The prover finds those witness values and stores them in a vector of length
, which is the number of field elements in public inputs. This is to enable us to calculate the state of the verifier.
Step 2: instantiate the verifier
For the purpose of the Fiat-Shamir transform, we create a cryptographic sponge, which will absorb the verifier's state as well as the messages that the verifier would receive from the prover in an interactive proof protocol.
After we create the sponge, we put the following two things into the sponge: (1) verifier parameters and (2) public inputs.
Step 3: commit witness polynomials with hiding
Given the witness polynomials
, we add a random blinding polynomial over each of them. The prover samples
and computes blinded witness polynomials.
We commit each of the polynomial above and put the polynomial commitments
into the sponge.
Step 4: build the sigma polynomial, for wiring
The prover squeezes out two challenges
from the sponge. We now need to build the sigma polynomial. It helps for us to first compute:
We can then define the permutation polynomial
with the following evaluations:
Step 5: commit the sigma polynomial, with hiding
The prover first samples
and apply them as blinding factors to the polynomial
.
We commit this polynomial and put the polynomial commitment
into the sponge.
Step 6: compute the quotient polynomial
The prover squeezes out a challenge
from the sponge. This is used to construct the following polynomial.
where
and
and
and
and
and
Then, in the coefficient representations, we split the polynomial into five parts:
,
,
,
, and
, where each polynomial has degree
. This is because
is expected to have degree
, and
.
Step 7: commit the split quotient polynomials, without hiding
We commit all these polynomials and put the commitments
,
,
,
, and
into the sponge.
Step 8: open the polynomials at a random point
The prover squeezes a random challenge
and compute the following opening evaluations:
And we remind the readers that some evaluations are over
instead of
. This is common in entry product arguments. The prover puts these, which are elements in
, into the sponge.
Step 9: compute the linearization polynomial
The linearization polynomial is, at a high level, to replace
,
,
,
,
,
,
,
,
,
,
,
,
,
, and
with the evaluations over that random point. More specifically,
reads as follows. Note that the locations of
are different now. The constant terms of
are removed here.
where
and
and
Note that
is not being replaced by its evaluation, and
and
and
Now we have the linearization polynomial. Although this polynomial is not linear, its degree is down from
to
, and one can see that the polynomial collapses to a small one.
We note that the evaluation of
at point
is as follows. The prover does not need to include this number in the proof because it can be computed by the verifier.
Step 10: compute the opening proof polynomials
Now we want to prove that the previous openings are correct, as well as
is actually vanishing in
. We first squeeze out a challenge
from the sponge. This is done by showing that one can find a polynomial
such that:
and similarly, another polynomial
as follows.
We commit these two polynomials as
and
.
Step 11: output the full proof
After the Fiat-Shamir transform, the final proof reads as follows.
The verifier reads the full proof above and proceeds as follows.
Step 1: compute all the challenges
For convenience, the verifier first computes all the random challenges in this protocol execution:
,
,
,
,
, and
.
- Initialize the same cryptographic sponge.
- Putinto the sponge and squeeze outfrom the sponge.
- Putinto the sponge and squeeze outfrom the sponge.
- Putinto the sponge and squeeze outfrom the sponge.
- Putinto the sponge and squeeze outfrom the sponge.
- Putandinto the sponge and squeeze outfrom the sponge.
Step 2: compute
Recall from the Step 9 of the prover,
can indeed be computed by the verifier.
Step 3: assemble
The verifier can also assemble the commitment of
from available commitments, as follows.
where
and
and
and
Step 4: compute linear combination of commitments
Let the cumulative commitment
be as follows. Note that the last one has a coefficient
.
Step 5: compute linear combination of evaluations
Let the cumulative evaluation
be as follows. Also, note the last one.
Step 6: pairing
Compute
as follows.
where
is the generator of
in the SRS and
is the secret in the SRS. The element
here is part of the SRS.
where
is the generator of
in the SRS.
Step 7: decision
The verifier accepts the proof if
and rejects otherwise.
Last modified 2mo ago