ZKP15.1 Secure ZK Circuits via Formal Methods

ZKP学习笔记

ZK-Learning MOOC课程笔记

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

  • Motivation
    ZKP15.1 Secure ZK Circuits via Formal Methods_第1张图片

    • Bugs in blockchain software are extremely dangers and costly.
    • Smart Contract Bugs, Blockchain Protocol Bugs, ZK Bugs…
    • Formal methods can eradicate these bugs

15.1 Formal Methods in a Nutshell

  • What is Formal Method

    • Set of mathematically rigorous techniques for finding bugs and constructing proofs about software
      ZKP15.1 Secure ZK Circuits via Formal Methods_第2张图片
  • Fundamentals of Static Analysis

    • Abstract Inter-pretation

      • Cannot reason about the exact program behavior due to undecidability
      • Obtain a conservative over-approximation and this can be enough to prove program correctness
      • Abstract interpretation is a framework for computing overapproximations of program states
    • Example
      ZKP15.1 Secure ZK Circuits via Formal Methods_第3张图片

      • Program is safe: the intersection between the green and red regions is empty
        ZKP15.1 Secure ZK Circuits via Formal Methods_第4张图片
    • Concrete Interpretation is Easy
      ZKP15.1 Secure ZK Circuits via Formal Methods_第5张图片

  • Abstract Interpretation
    ZKP15.1 Secure ZK Circuits via Formal Methods_第6张图片

ZKP15.1 Secure ZK Circuits via Formal Methods_第7张图片

ZKP15.1 Secure ZK Circuits via Formal Methods_第8张图片

  • Example: Detect Reentrancy via Abstract Interpretation
    ZKP15.1 Secure ZK Circuits via Formal Methods_第9张图片

    • External call followed by a storage update
  • Other vulnerabilities

    • Integer Overflow
    • Transaction Order Dependence
    • Flashloan Attack
  • Abstract Interpretation Tools in Web3

    • Slither (TrailOfBits)
    • Sailfish (Bose et al, Oakland’ 22)
    • Vanguard (Veridise)
    • Securify (CCS '19)
  • Shortcomings
    ZKP15.1 Secure ZK Circuits via Formal Methods_第10张图片

  • Static Analysis via Formal Verification
    ZKP15.1 Secure ZK Circuits via Formal Methods_第11张图片

    • Overview
      ZKP15.1 Secure ZK Circuits via Formal Methods_第12张图片

    • Example
      ZKP15.1 Secure ZK Circuits via Formal Methods_第13张图片

    • When Formal Verification Fails
      ZKP15.1 Secure ZK Circuits via Formal Methods_第14张图片

    • Bounded and Unbounded Verification
      ZKP15.1 Secure ZK Circuits via Formal Methods_第15张图片

    • Different Flavors of Static Analysis
      ZKP15.1 Secure ZK Circuits via Formal Methods_第16张图片

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