ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)

ZKP学习笔记

ZK-Learning MOOC课程笔记

Lecture 9: SNARKs based on Linear PCP (Yupeng Zhang)

  • SNARKs learned so far
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第1张图片

  • Earliest Implemented SNARKs

    • Pros
      • Shortest proof size (3 elements [Groth16])
      • Fast verifier (bilinear pairing)
    • Cons
      • FFT and group exponentiations on the prover
      • Circuit-specific trusted setup
  • History of SNARKs
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第2张图片

9.1 Quadratic Arithmetic Program (QAP)

  • Recall: SNARKs for circuit-satisfiability
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第3张图片

  • Transcript/trace of Circuit

    • Interactive proof (lecture 4, slide 76): value of every gate
    • Plonk (lecture 5, slide 42): left input, right input, output of every gate
    • QAP: input + output of every multiplication gate
  • QAP

    • Ignore the output of the addition gates
      ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第4张图片

    • Labeling multiplication gates

    • Selector Polynomials

      • l i ( x ) l_i(x) li(x): is c i c_i ci the left input of gate , for = 1,2,3?

        • Examples:
          ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第5张图片

          For l 1 ( x ) l_1(x) l1(x):

          • 3 is the left input of gate 1? Yes! -> 1
          • 3 is the left input of gate 2? No! -> 0
          • 3 is the left input of gate 3? No! -> 0
            ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第6张图片

          For l 3 ( x ) l_3(x) l3(x):

          • 1 is the left input of gate 1? No! -> 0
          • 1 is the left input of gate 2? No! -> 0
          • 1 is the left input of gate 3?
            • Yes! -> 1
            • Because “1” is the input of the addition gate, and the addition gate is the left input of gate 3
              ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第7张图片
      • Properties of the selector polynomials
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第8张图片

      • More Selector Polynomials

        • r i ( x ) r_i(x) ri(x): is c i c_i ci the right input of gate , for = 1,2,3?
          ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第9张图片

        • o i ( x ) o_i(x) oi(x): is c i c_i ci the output of gate , for = 1,2,3?
          ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第10张图片

      • Master polynomial
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第11张图片

      • Vanishing polynomial
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第12张图片

  • Circuit-SAT to QAP [GGPR13, PGHR13]
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第13张图片

ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第14张图片

  • The table is sparse.

9.2 From QAP to SNARK

  • Probabilistically Checkable Proofs (PCP)
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第15张图片

  • IPCP [Kalai-Raz’08] and IOP [Ben-Sasson-Chiesa-Spooner’16]
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第16张图片

  • Polynomial IOP [Bünz-Fisch-Szepieniec’20]
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第17张图片

  • Linear PCP [Ishai-Kushilevitz-Ostrovsky’07]
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第18张图片

  • QAP and Linear PCP
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第19张图片

    • We don’t use random checks.
  • Key Generation

    • The c i c_i ci and q ( x ) q(x) q(x) are private
    • The selector polynomials and the vanishing polynomial are public.
    • The circuit can be pre-processed. (The preprocessing phase is circuit-dependent)
      ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第20张图片
  • Prove
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第21张图片

  • Verify
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第22张图片

  • Towards the real protocol

    • Q1: How to make sure π 1 \pi_1 π1 is computed from g l i ( τ ) g^{l_i(\tau)} gli(τ)

      • Solution: Knowledge of Exponent assumption (KoE) or Generic Group Model (GGM)

      • Recall: KoE
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第23张图片

      • Recall: GGM
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第24张图片

    • Q2: how to make sure the same c c c is used in π 1 \pi_1 π1, π 2 \pi_2 π2 and π 3 \pi_3 π3?

      • Solution
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第25张图片
    • Q3: What about public input and output?
      ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第26张图片

      • I m i d I_{mid} Imid: secret witness
      • I i o I_{io} Iio: public input and public output
  • Putting everything together
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第27张图片

  • Properties of SNARK [PGHR13]
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第28张图片

9.3 Other variants

  • Rank-1-Constraint-System (R1CS)

    • QAP
      ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第29张图片

    • R1CS:
      ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第30张图片

      • Advantages
        • Can support generalized constraints or gates
        • more convenient to use in practice
      • Matrix View of R1CS
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第31张图片
  • Groth16
    ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第32张图片

    • Combine the π 3 \pi_3 π3, π 4 \pi_4 π4, π 5 \pi_5 π5 of [PGHR13] together
      • α \alpha α and β \beta β are secret keys in the trusted key generation, and g α g^\alpha gα and g β g^\beta gβ are public parameters for the prover and the verifier
      • π 3 \pi_3 π3: move the Σ i = 1 m c i × o i ( x ) \Sigma_{i=1}^m c_i \times o_i(x) Σi=1mci×oi(x) to the right side of the equation -> Σ i = 1 m c i × o i ( x ) + V ( x ) q ( x ) \Sigma_{i=1}^m c_i \times o_i(x) + V(x)q(x) Σi=1mci×oi(x)+V(x)q(x)
    • Change the keygen accordingly
    • Proof size: 3 group elements, 144 bytes
    • Verifier time: 1 pairing equation
  • Achieving Zero-Knowledge

    • The above is not zero-knowledge, because the adversary can infer some information by brute force attack.
    • Solution: add some random values (times the vanishing polynomial)
      • The [PGHR13] version:
        ZKP9 SNARKs based on Linear PCP (Pinocchio & Groth16)_第33张图片

你可能感兴趣的:(零知识证明,零知识证明,1024程序员节,笔记)