Try   HackMD

Notation:
The fold operation:
Given a polynomial

h and
uF
we define

fold(h,u)=u¯heven+uhodd,
where
u¯=1u
.
Crucial relation:
Given
r,uF
and polynomial
h
, define
α=h(r),α¯=h(r)
and
β=fold(h,u)(r2)
. Then
β=u¯α+α¯2+uαα¯2r.

In our version of Gemini, we mostly use this equality in the reverse direction deriving

h(r) from
h(r)
and
fold(h,u)(r2)
. Precisely, we see from the above equation that
α=(uu¯r)α¯+2rβ(u¯r+u)

For brevity, we denote below this RHS by

derive(u,α¯,β)

Let

d=logn
Given this notation, we can concisely describe our optimized Gemini protocol:
(Sidenote: I think there are some confusing typos in the version here)

Given polynomial

f of degree
<n
and opening point
(u0,ud1)
and the purported value
v=ml(f)(u0,,ud1)

  1. We define for each
    j[d]
    gj=fold(gj1,uj1)
  2. P
    sends commitments to
    g1,,gd1
  3. V
    chooses random
    r
  4. P
    sends for
    i[d1]
    ,
    α¯i=gi(r2i)
    . And
    α¯0=f(r)
    .
  5. V
    sets
    αd=v
  6. V
    derives the values
    α0,α1,,αd1
    going "backwards" via
    αi=derive(ui,α¯i,αi+1)
  7. Using shplonk
    P
    proves to
    V
    the correctness of
    f(r)=α0,f(r)=α¯0,g1(r2)=α¯1,g2(r4)=α¯2,,gd1(r2d1)=α¯d1

Soundness issue:

In the above we don't check

α1,,αd1 using shplonk.

We give an example of why these checks should be added and how we can open to the wrong value.

We use

n=8 so
d=3
.
We fix any
u=(u0,u1,u2)
.
We take
f=0
.
we show we can successfully open
ml(f)(u)=v
for any
v
.
It will be convenient to use the notations
g=g1
,
h=g2
. Also, to start use a challenge
r
and set
r=r2
(so that
g
is evaluated at
r
rather than
r2
)

We set

α0=α¯0=α1=0,
as an honest
P
would get when starting with
f=0
.

we'll choose the coefficients of

g,h via a system of linear equations so that,
when setting "honestly"
α¯1=g(r),α2=h(r2),α¯2=h(r2)

we get

derive(u1,α¯1,α2)=0=α1

We denote by

g0,g1,g2,g3, and
h0,h1
the coefficients of
g,h
respectively.

Let's set

α=α1,β=α2,u=u1.
We have according to the derive formula:
(u¯r+u)α=(uu¯r)α¯+2rβ

So it suffices for us that

(uu¯r)α¯+2rβ=0
Equivalently
P(r):=(uu¯r)g(r)+2rh(r2)=0

Since
r
is chosen after
g,h
are committed we want to make
P
identically zero.
P
has degree four, and its coefficients are linear combinations of
g0,g1,g2,g3,h0,h1
.
Explicitly, if
P(X)=P0+P1X+P2X2+P3X3+P4X4
then

calculation shows

P0=ug0,P1=2h0u¯g0ug1,
P2=u¯g1+ug2,P3=2h1u¯g2ug3,P4=u¯g3

To zero out all coefficients of

P, we can thus set
g0=0,g1=2h0/u,g2=u¯g1/u=u¯2h0/u2

g3=0,h1=u¯g2/2=u¯2h0/u2

Note that

h0 is still a free variable.

We choose

h0 so that
u¯2h0+u2h1=v

P will send commitments to
g,h
, and the "honest" values
α¯0=0,α¯1=g(r)α¯2=h(r2)

The application of

derive by
V
will set
α0=0=f(r)
.

So all shplonk checks will pass. It follows that

V will accept the proof for output
v
.

Converging to the implemented version (case d=2)

(Written by Sergei before massive edit of the above, so might be out of context)

Say

(u0,u1) is the evaluation point, and
v
the claimed evaluation
ml(f)(u0,u1)
.
Then,

  1. P
    sends a commitment to
    g1
    .
  2. V
    sends
    r
    .
  3. P
    sends the values
    α¯0=f(r),α¯1=g(r2)
    .
  4. V
    computes
    α1=g(r2)=2r2vα¯1(r2(1u1)u1)r2(1u1)+u1

    α0=f(r)=2rα1α¯1(r(1u0)u0)r(1u0)+u0
  5. KZG check the values
    α0
    ,
    α¯0
    , and
    α¯1

Note that the honest prover sends a commitment to

g=fold(f,u0):=(1u0)feven+u0fodd