David Wong

cryptologie.net

cryptography, security, and random thoughts

Hey! I'm David, cofounder of zkSecurity, research advisor at Archetype, and author of the Real-World Cryptography book. I was previously a cryptography architect of Mina at O(1) Labs, the security lead for Libra/Diem at Facebook, and a security engineer at the Cryptography Services of NCC Group. Welcome to my blog about cryptography, security, and other related topics.

← back to all posts

Pairing-based polynomial commitments and Kate polynomial commitments

blog

There’s this thing called a Kate polynomial commitment, which is a polynomial commitment primitive that makes use of pairings. There’s an excellent post from Dankrad which I would recommend reading instead of this post. I wrote this as a shorter summary of how you can commit to a polynomial, and then prove any evaluation f(x)=y.

Here’s how it works:

You have a polynomial f(x)=x2+3x

and some public parameters:

SRS={[1],[s],[s2],[s3]}={G,sG,s2G,s3G}

where [x]:=xG for some generator G of an elliptic curve group.

and s is a toxic waste (something that no one should know) hidden behind an elliptic curve point G (some people call that “hidden in the exponent”).

to commit to f

To commit to this polynomial, evaluate it at the unknown point s. You can do that by playing with the SRS:

[f(s)]:=[s2]+3[s]=s2G+3sG=(s2+3s)G

to prove that f(ζ)=a

One day, the verifier asks “what’s the evaluation at ζ?” And the prover responds by sending the answer, a, and a proof (h(s), see below).

The idea behind the proof

Notice that because ζ is a root of f(x)f(ζ), then for some polynomial h(x):

f(x)f(ζ)=(xζ)·h(x)

Due to this, h(x)=f(x)f(ζ)xζ must be a valid polynomial.

At a high-level:

  • the verifier will compute what they think [h(x)] should be at some random point s
  • the prover will send the actual value [h(s)]
  • the verifier will check if they match

This works because the Schartz-Zippel lemma tells us that two polynomials that are different are different in most points.

The proof

Here’s the protocol:

  1. the prover sends the verifier a commitment [f(s)f(ζ)sζ]=[h(s)] evaluated at some random point s (the toxic waste).
  2. the verifier constructs a similar h(s) but with the expected value of f(ζ) instead: [f(s)asζ]. The verifier then checks if it’s equal to [h(s)].

Note:

  1. The prover can compute [h(s)] easily, because they can just compute the polynomial h(x) first, and then reconstruct it at s with the SRS. h(x)=f(x)f(ζ)xζ=a0+a1x+a2x2+ and then [h(s)]:=a0[1]+a1[s]+a2[s2]+

    for example with our previous f(x) and ζ=3

  2. The verifier cannot compute their own [h(s)] because they cannot divide by s (remember, nobody knows s). They need a pairing. Remember, you want to check the following identity hidden in the exponent (using commitments): [f(s)a][sζ]=[h(s)] But since you can’t divide with commitments, you can’t compute what’s on the left-hand side. You can multiply thanks to pairings though. So instead, you could check the following equation: [f(s)a]=[(sζ)h(s)] and with pairings, you can multiply [sζ] with the proof [h(s)]: e([f(s)][a],[1])=e([sζ],[h(s)])

PS: Thanks to h for pointing out a mistake

← back to all posts blog • 2021-06-23
currently reading:
Pairing-based polynomial commitments and Kate polynomial commitments
06-23 blog
📖 my book
Real-World Cryptography is available from Manning Publications.
A practical guide to applied cryptography for developers and security professionals.
🎙️ my podcast
Two And A Half Coins on Spotify.
Discussing cryptocurrencies, databases, banking, and distributed systems.
📺 my youtube
Cryptography videos on YouTube.
Video explanations of cryptographic concepts and security topics.