Try   HackMD

Note - Plonk / TurboPlonk / UltraPlonk

Plonk

Rsnark(λ)={(x,w,crs)=((wi)i[],(wi)i=1,i[]3n,(qMi,qLi,qRi,qOi,qCi)i=1n,n,σ(x))For all i{1,,3n}:wiFp,andfor all i{1,,3n}:wi=wσ(i),andfor all i{1,,n}:wiwn+iqMi+wiqLi+wn+iqRi+w2n+iqOi+qCi=0}

Setup

TODO

Prove

  1. Compute wire polynomials

    a(X),
    b(X)
    ,
    c(X)
    with randomnesses
    b16

    a(X)=(b1X+b2)ZH(X)+i=1nwiLi(X)b(X)=(b3X+b4)ZH(X)+i=1nwn+iLi(X)c(X)=(b5X+b6)ZH(X)+i=1nw2n+iLi(X)

    Output

    [a]1=[a(x)]1,
    [b]1=[b(x)]1
    ,
    [c]1=[c(x)]1

  2. Compute permutation polynomial

    z(X) with randomnesses
    b79
    and challenge
    (β,γ)

    z(X)=(b7X2+b8X+b9)ZH(X)+L1(X)+i=1n1(Li+1(X)j=1iwj+βωj1+γwj+σ(j)β+γwn+j+βk1ωj1+γwn+j+σ(n+j)β+γw2n+j+βk2ωj1+γw2n+j+σ(2n+j)β+γ)

    Output

    [z]1=[z(x)]1

  3. Compute quotient polynomial

    t(X) with challenge
    α

    t(X)=(a(X)b(X)qM(X)+a(X)qL(X)+b(X)qR(X)+c(X)qO(X)+PI(X)+qC(X))1ZH(X)+((a(X)+βX+γ)(b(X)+βk1X+γ)(c+βk2X+γ)z(X))αZH(X)((a(X)+βSσ1(X)+γ)(b(X)+βSσ2(X)+γ)(c+βSσ3(X)+γ)z(Xω))αZH(X)+(z(X)1)L1(X)α2ZH(X)

    Output

    [tlo]1=[tlo(x)]1,
    [tmid]1=[tmid(x)]1
    ,
    [thi]1=[thi(x)]1

  4. Compute linearisation polynomial

    r(X) with challenge
    z

    a¯=a(z)b¯=b(z)c¯=c(z)s¯σ1=Sσ1(z)s¯σ2=Sσ2(z)t¯=t(z)z¯ω=z(zω)
    r(X)=(a¯b¯qM(X)+a¯qL(X)+b¯qR(X)+c¯qO(X)+qC(X))+((a¯+βz+γ)(b¯+βk1z+γ)(c¯+βk2z+γ)z(X))α((a¯+βs¯σ1+γ)(a¯+βs¯σ2+γ)βz¯ωSσ3(X))α+z(X)L1(z)α2

    Output

    a¯,
    b¯
    ,
    c¯
    ,
    s¯σ1
    ,
    s¯σ2
    ,
    t¯
    ,
    z¯ω
    ,
    r¯=r(z)

  5. Compute opening proof polynomial

    Wz(X) with challenge
    v

    Wz(X)=1Xz((tlo(X)+zntmid(X)+z2nthi(X)t¯)+v(r(X)r¯)+v2(a(X)a¯)+v3(b(X)b¯)+v4(c(X)c¯)+v5(Sσ1(X)s¯σ1)+v6(Sσ2(X)s¯σ2))Wzω(X)=z(X)z¯ωXzω

    Output

    [Wz]1=[Wz(x)]1,
    [Wzω]1=[Wzω(x)]1

    When we want to access adjacent gate, for example

    a(Xω), we only need to add extra evaluations and aggregate them in commit
    [Wzω]1
    .
    For Dusk Network's implementation as example, they access next gate's
    wl
    ,
    wr
    ,
    w4
    , so they have to aggregate them into
    [Wzω]1
    .

  6. Submit proof

    πSNARK=([a]1,[b]1,[c]1,[z]1,[tlo]1,[tmid]1,[thi]1,[Wz]1,[Wzω]1,a¯,b¯,c¯,s¯σ1,s¯σ2,r¯,z¯ω)

Verify

TODO

Question

  • Why is

    L1(z)=zn1n(z1) (Why is
    L1(X)=Xn1n(X1)
    )

    liangcc

    Xn1=(X1)(Xω)(Xω2)(Xωn1) Xn1=(X1)(Xn1+Xn2++1)Xn1X1=(Xn1+Xn2++1)=(Xω)(Xω2)(Xωn1)
    L1(X)=(Xω)(Xω2)(Xωn1)(1ω)(1ω2)(1ωn1)=Xn1X1(1ω)(1ω2)(1ωn1)=Xn1X11n1+1n2++1=Xn1n(X1)

  • Why we use

    2 randomnesses in
    a(X)
    ,
    b(X)
    and
    c(X)
    but
    3
    in
    z(X)
    ?

    Cited Ariel Gabizon from <a href="https://www.plonk.cafe/t/noob-questions-plonk-paper/73">plonk.cafe #73</a> The rule is that if the poly is opened at

    d points you need
    d+1
    blinding factors; to hide both the commitment (which is an evaluation at a secret point in the exponent, but still to prove zk holds you’ll need this to be totally random, this proof that zk holds is quite similar to existing proofs - e.g. in Marlin, but is a missing hole in the paper right now) and the
    d
    evaluation points.
    So
    z(X)
    is opened at
    2
    points and hence needs
    3
    blinding factors.

  • Why bother including

    s¯σ1 and
    s¯σ2
    in proof and check them in pairing if verifier can calculate himself.

    han Guessing it's the reason that verification complexity is polylogarithmic

    O((logn)k), because evaluation is linear time.

  • Why

    r(X) is lack of
    ((a¯+βs¯σ1+γ)(b¯+βs¯σ2+γ)(c¯+γ)z¯ω)α
    and
    L1(z)α2

    han Guessing it's because we need to ensure prover is using the

    α,
    Sσ1(X)
    and
    Sσ2(X)
    as we expected, so we let verifier compute these part.

  • How to constraint prover to use right

    Sσ1(X) and
    Sσ2(X)
    in
    t(X)
    and
    r(X)
    as verifier expected

    han Guessing it's constrainted by the lack part of

    r(X). If prover uses different
    Sσ1(X)
    and
    Sσ2(X)
    , then reconstructed
    t¯
    by verifier will not equal to prover's
    t¯
    .

TurboPlonk

Take Dusk Network implementation as an example

Relation in paper's notations

Rsnark(λ)={(x,w,crs)=((wi)i[],(wi)i=1,i[]4n,(qMi,qLi,qRi,qOi,qCi,q4i,qArithi,qRangei,qLogici,qFixedGroupAddi,qVariableGroupAddi)i=1n,n,σ(x))For all i{1,,4n}:wiFp,andfor all i{1,,4n}:wi=wσ(i),andfor all i{1,,n}:qArithi=0(wiwn+iqMi+wiqLi+wn+iqRi+w2n+iqOi+w3n+iq4i+qCi)=0,andfor all i{1,,n1}:qRangei=0((w2n+i4w3n+i){0,1,2,3} (wn+i4w2n+i){0,1,2,3} (wi4wn+i){0,1,2,3} (w3n+i+14wi){0,1,2,3}   ),andfor all i{1,,n1}:qLogici=0((wi+14wi){0,1,2,3} (wn+i+14wn+i){0,1,2,3} (w3n+i+14w3n+i){0,1,2,3} (w2n+iwiwn+i)=0 (qCi[9w3n+i3(wi+wn+i)]+3(wi+wn+i+w3n+i)2w2n+i(w2n+i(4w2n+i18(wi+wn+i)+81)+18(wi2+wn+i2)81(wi+wn+i)+83))=0   ),andfor all i{1,,n1}:qFixedGroupAddi=0((w3n+i+12w3n+i){1,0,1} (qCi(w3n+i+12w3n+i)w2n+i)=0 (wi+1(1+Dwiwn+iw2n+i)wn+i(w3n+i+12w3n+i)qLiwi((w3n+i+12w3n+i)2(qRi1)+1))=0 (wn+i+1(1Dwiwn+iw2n+i)wi(w3n+i+12w3n+i)qLiwn+i((w3n+i+12w3n+i)2(qRi1)+1))=0   ),andfor all i{1,,n1}:qVariableGroupAddi=0((w3n+i+1wiw3n+i)=0 (wiw3n+i+wn+iw2n+iwi+1(1+Dwiwn+iw2n+iw3n+i))=0 (wiw2n+i+wn+iw3n+iwn+i+1(1Dwiwn+iw2n+iw3n+i))=0   )}

Relation in more readable notations

Rsnark(λ)={(x,w,crs)=((wi)i[],(wi)i=1,i[]4n=(ai)i=1,i[]n||(bi)i=1,i[]n||(ci)i=1,i[]n||(di)i=1,i[]n,(qMi,qLi,qRi,qOi,qCi,q4i,qArithi,qRangei,qLogici,qFixedGroupAddi,qVariableGroupAddi)i=1n,n,σ(x))For all i{1,,4n}:wiFp,andfor all i{1,,4n}:wi=wσ(i),andfor all i{1,,n}:qArithi=0(aibiqMi+aiqLi+biqRi+ciqOi+diq4i+qCi)=0,andfor all i{1,,n1}:qRangei=0((ci4di){0,1,2,3} (bi4ci){0,1,2,3} (ai4bi){0,1,2,3} (di+14ai){0,1,2,3}   ),andfor all i{1,,n1}:qLogici=0((ai+14ai){0,1,2,3} (bi+14bi){0,1,2,3} (di+14di){0,1,2,3} (ciaibi)=0 (qCi[9di3(ai+bi)]+3(ai+bi+di)2ci(ci(4ci18(ai+bi)+81)+18(ai2+bi2)81(ai+bi)+83))=0   ),andfor all i{1,,n1}:qFixedGroupAddi=0((di+12di){1,0,1} (qCi(di+12di)ci)=0 (ai+1(1+Daibici)bi(di+12di)qLiai((di+12di)2(qRi1)+1))=0 (bi+1(1Daibici)ai(di+12di)qLibi((di+12di)2(qRi1)+1))=0   ),andfor all i{1,,n1}:qVariableGroupAddi=0((di+1aidi)=0 (aidi+biciai+1(1+Daibicidi))=0 (aici+bidibi+1(1Daibicidi))=0   )}


They split wire value into base-4, which makes

x=i=0nqi4i, in range widget and logic widget to reduce gate number. For the reason that using base-4 is to make use of the max available degree of the permutation grand product in
t(X)
, which
4n
(4 wires).

Setup

TODO

Prove

TODO

Verify

TODO

Question

  • How does logic widget work? (It checks AND and XOR at the same time)
  • Why adding dummy gates like this can serve as blind factor? How could it be used to prove Zero-Knowledge property of
    PlonK
    ?
    Compared to barretenberg's implementation, they use randomness wire values and cut the
    ZH(X)
    's last
    k
    roots to achieve Zero-Knowledge and not make
    ZH(X)
    's degree over
    4n
    at the same time. See Adding zero-knowledge into PLONK by @zacwilliamson for more details.

UltraPlonk

TODO

Reference