ZKP15.2 Formal Methods in ZK (Part I)

ZKP学习笔记

ZK-Learning MOOC课程笔记

Lecture 15: Secure ZK Circuits via Formal Methods (Guest Lecturer: Yu Feng (UCSB & Veridise))

15.2 Formal Methods in ZK (Part I)

  • Circuits Workflow
    ZKP15.2 Formal Methods in ZK (Part I)_第1张图片

    • Source Code: Witness Generation and Constraints
    • Witness Generation and Constraints should (generally) be equivalent!
  • What is Equivalence
    ZKP15.2 Formal Methods in ZK (Part I)_第2张图片

    • Every input-output of P must satisfy C
    • Every (x,y) which satisfies C must be an input-out pair of P
  • Equivalence Violations
    ZKP15.2 Formal Methods in ZK (Part I)_第3张图片

    • Underconstrained Bugs: Verifier can accept bad inputs/ outputs
  • A Taxonomy of ZK Bugs
    ZKP15.2 Formal Methods in ZK (Part I)_第4张图片

  • Unconstrained Signals

    • Corresponds to signals whose constraints always evaluate to true, accepting everything

    • Example: Underconstrained Output
      ZKP15.2 Formal Methods in ZK (Part I)_第5张图片

      • Error: for (var i = 0; i< n, i++)
      • No constrains over the last element of output
      • Attacker can pass in any value for out 2
  • Unsafe Component Usage

    • Sub-circuits often assume constraints are placed on inputs and outputs

    • Corresponds to cases where the use of a sub-circuit does not follow

    • Example: Under-Constrained Sub-Circuit Output
      ZKP15.2 Formal Methods in ZK (Part I)_第6张图片

      • Missing constraint lt.out === 0
      • Without the missing constraint, attackers can withdraw more funds than they have
  • Constraint/Computation Discrepancy

    • Not all computation can be directly expressed as a constraint

    • Corresponds to constraints that do not capture a computation’s semantics

    • Example: No Zero Inverse
      ZKP15.2 Formal Methods in ZK (Part I)_第7张图片

      • Accepts arbitrary out when a and b are 0!
  • Circuit Dependence Graphs (CDG)

    • Goal: Identify discrepancies between computation and constraints

    • Data dependence <–

    • Constrain ===
      ZKP15.2 Formal Methods in ZK (Part I)_第8张图片

    • CDG Example
      ZKP15.2 Formal Methods in ZK (Part I)_第9张图片

ZKP15.2 Formal Methods in ZK (Part I)_第10张图片

  • Vanguard Framework
    ZKP15.2 Formal Methods in ZK (Part I)_第11张图片

你可能感兴趣的:(零知识证明,零知识证明,笔记)