You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zero-Knowledge Proofs (ZKPs) rely on various types of gates to perform computations. Custom Gates are specialized tools that enforce specific polynomial relationships between their inputs and outputs. Lookup Gates, on the other hand, can manage any type of relationship between inputs and outputs. Both Halo2-lookup and Plookup are powerful tools for implementing lookup arguments in ZKPs.
Halo2 Lookup
The Halo2-lookup scheme demonstrates the implementation of lookup gates. It focuses on proving that a query vector's elements belong to a table vector, represented as $\vec{f} \subseteq \vec{t}$. The process involves:
Sorting (Polynomial Proof):
To ensure that the query vector $\vec{f}$ is sorted in the same order as the table vector $\vec{t},$ the Halo2-lookup scheme employs auxiliary vectors $\vec{f}'$ and $\vec{f}'.$ The rule is that each unmarked element in $\vec{f}'$ equals its left neighbor, and each marked element equals the corresponding element in $\vec{t}'$, $f'_i=f'_{i-1}$ or $f'_i=t'_i$. To prevent cyclic rollovers, $\vec{f}'$ and $\vec{t}'$ must start with the same element, $f'_0=t'_0$. Using Lagrange Basis for polynomial encoding, we get:
In the Plookup scheme, this proof transformation is not used. Instead, the order of $\beta$ and $\gamma$ is swapped: first, $\gamma$ is used for the product permutation, and then $\beta$ is used for folding:
Step 4: However, this introduces a new problem. The degree of the $\vec{s}$ polynomial exceeds the degree of $\vec{f}$ or $\vec{t}$. Plookup solves this by splitting $\vec{s}$ into two halves, $\vec{s}^{lo}$ and $\vec{s}^{hi}$, but the last element of $\vec{s}^{lo}$ must equal the first element of $\vec{s}^{hi}$:
$$
\vec{s}^{lo}_{N-1} = \vec{s}^{hi}_0
$$
Next, the Prover introduces an accumulator auxiliary vector $\vec{z}$ to prove the Grand Product:
In this approach, there's no need to limit the length of $\vec{f}$ to N-1; it can extend up to N. This allows the length of $\vec{s}$ to reach 2N. This is possible because the relationship between $(\vec{f}, \vec{t}, \vec{s}^{even}, \vec{s}^{odd})$ can wrap around to the starting position within the subgroup H.
Multi-Column Tables:Collapsing a multi-column table into a single column table using random challenge numbers.
Suppose the computation table is $(\vec{t}_1, \vec{t}_2, \vec{t}_3)$, then the corresponding lookup record should also be a three-column table, denoted as $(\vec{f}_1,\vec{f}_2,\vec{f}_3)$. If we want to prove that $(f_{1,i},f_{2,i},f_{3,i})=(t_{1,j},t_{2,j},f_{3,j})$, we can ask the Verifier for a random challenge number $\eta$, and collapse the computation table horizontally as follows: