What if… verifying the execution of pairings inside SNARKs can be...

@__geometrydev__
Geometry Research@__geometrydev__
13 views May 01, 2024 ~3 min read
Advertisement
1
What if… verifying the execution of pairings inside SNARKs can be done much faster than already known?

@AndrijaNovakov6 and @LiamEagen have just published a paper on this!

Let’s explore this below 🧵

1/13
Media image
2
Paper: eprint.iacr.org/2024/640

Let’s say that you have an existing Groth16 or Plonk proof, and you want to verify them in a SNARK.

This is needed for a bunch of use cases:
* zk light clients
* zkzkrollups
* private voting
* aggregation of proofs
* games with private state

2/13
3
Naively, you would run the proving system’s verification algorithm as you would outside of a SNARK.

This works, but has a few efficiency downsides.

3/13
4
SNARKs can receive witness inputs, which allow you to verify results of operations instead of running them. E.g. z being the inverse of x can be “computed” by verifying z*x = 1, instead of a costly inversion process.

Shame not to use it.

4/13
5
Furthermore, when verifying an existing proof inside another SNARK, you often have to work over a field that is different from the SNARK’s native field. This increases the constants of every operation by a lot, making any improvement very meaningful.

5/13
6
So what can we do?

The paper introduces previously unexplored before methods, and combines them with existing methods, to achieve a significant improvement of pairing execution inside SNARKs.

Let’s see how.

6/13
7
First, observe that pairing execution is comprised of two steps - miller loop and final exponentiation. The final exp is needed since the miller loop output of computations that are eventually the same differ from each other by an element of order r, the order of the curve.

7/13
8
This suggests that instead of performing the expensive final exp, we can check that the miller loop result is an rth-residue by providing this element as witness. Concretely, instead of proving the pairing output is 1, we prove it lies in the same equivalence class of 1.

8/13
9
It turns out that, while good, the final exp is already optimized because of its structure, so doing that directly helps, but not as much as we want.

Instead, you can use the Frobenius operator, low hamming weight exponents and lattices to make this new check efficient.

9/13
10
Note that all of these methods are focused on using exponents that are the most efficient to exponentiate by, while saving unnecessary exponentiations in a SNARK context.

10/13
11
Second, miller loops consist of computing lines between elliptic curve points and then evaluating them at another point.

We can again use witness inputs to provide the line coefficients and, instead of computing, we verify that the line passes through the points.

11/13
12
We then combine these with using an affine representation of points and randomized big integer arithmetic, which are known to be efficient in SNARKs but not necessarily outside them.

Lastly, we batch miller loop squarings together with the new final-exp-saving element.

12/13
13
This method are applicable anywhere where pairings are verified inside SNARKs today. They can also be used in on chain contexts.

We're using this with @MinaFoundation and @CelestiaOrg to bring Celestia DA to Mina zkapps.

Read the full paper here: eprint.iacr.org/2024/640

13/13
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement