docs
  • README
  • Browsing the Fides Innova ZKP Network
  • Connecting Your MetaMask to the Network
  • Full Node
  • Introduction
  • Mobile App
  • Publishing Service Contracts on the Fides Innova Blockchain
  • Web App (User Panel, Admin Panel)
  • Fides Zero-Knowledge Proof (ZKP) Algorithm
    • 1- Setup Phase
      • 1- Setup Phase
      • Example 1
      • Example 2
    • 2-commitment-phase
      • 2- Commitment Phase
      • Example 1
      • Example 2
    • 3- Proof Generation Phase
      • 3- Proof Generation Phase
      • Example 1
      • Example 2
    • 4- Proof Verification Phase
      • 4- Proof Verification Phase
      • Example 1
      • Example 2
    • 5-target-architecture
      • Target architecture - RISC-V RV32IM
      • Target architecture - ARMv6-M Cortex-M0 32-bit ARM - RaspberryPi Pico
      • Target architecture - Cortex-A53 - for Siemens SIMATIC IOT2050
  • Tech Stack
    • Message Queuing Telemetry Transport (MQTT) protocol
    • Service Contract
    • Service Market
    • ZKP-enabled JavaScript Execution
  • ZKP and IoT Device Firmware Integration (zk-Device Design)
    • E-Card; a sample zk-Device
      • Installation
      • Instruction Set Architecture (ISA)
      • Mesh IoT Network
      • Reset
Powered by GitBook
On this page
  1. Fides Zero-Knowledge Proof (ZKP) Algorithm
  2. 1- Setup Phase

Example 1

In this section, we provide an example for the Setup phase settings.

Setup(1λ,N)Setup(1^{\lambda},N)Setup(1λ,N): This function outputs pp=PC.Setup(1λ,d)pp=PC.Setup(1^{\lambda},d)pp=PC.Setup(1λ,d).

We consider an input xxx with size of 1. Hence, ni=1n_i=1ni​=1. Considering a program which requires three gates for its arithmatization, we have ng=3n_g=3ng​=3. In this example, the maximum number of registers which are changed during the execution is nr=1n_r=1nr​=1. If the computation is done in F\mathbb{F}F of order p=181p=181p=181, ∣F∣=181|\mathbb{F}|=181∣F∣=181. Also, ∣H∣=n=ng+ni+1=5|\mathbb{H}|=n=n_g+n_i+1=5∣H∣=n=ng​+ni​+1=5. Also, bbb is a random number in { 1,...,∣F∣−∣H∣1,...,\mid\mathbb{F}\mid-\mid\mathbb{H}\mid1,...,∣F∣−∣H∣} ={ 1,...,1761,...,1761,...,176 } such as b=2b=2b=2. Also, m=2ng=6m=2n_g=6m=2ng​=6, ∣w∣=ng−nr=2|w|=n_g-n_r=2∣w∣=ng​−nr​=2, ∣K∣=m=6|\mathbb{K}|=m=6∣K∣=m=6. Hence:

d=d=d= { dAHP(N,i,j)d_{AHP}(N,i,j)dAHP​(N,i,j) } $_{i=0,1,...,k_AHP, j=1,2,..,s_AHP(i)}^{}$ = { 6,6,6,6,6,6,6,6,6,4,7,7,7,8,11,4,6,4,4,5,30 }

Now, we run KZG.Setup(1λ,d)KZG.\hspace{1mm}Setup(1^{\lambda},d)KZG.Setup(1λ,d), considering a generator of F\mathbb{F}F, g=2g=2g=2, for each element in ddd:

KZG.Setup(1λ,6)=(ck,vk)=KZG.Setup(1^{\lambda},6)=(ck,vk)=KZG.Setup(1λ,6)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^5$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^5$ =(2,57,86,98,78,51)=(2, 57, 86, 98, 78, 51)=(2,57,86,98,78,51) and vk=57vk=57vk=57.

KZG.Setup(1λ,4)=(ck,vk)=KZG.Setup(1^{\lambda},4)=(ck,vk)=KZG.Setup(1λ,4)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^3$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^3$ =(2,57,86,98)=(2,57,86,98)=(2,57,86,98) and vk=57vk=57vk=57.

KZG.Setup(1λ,7)=(ck,vk)=KZG.Setup(1^{\lambda},7)=(ck,vk)=KZG.Setup(1λ,7)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^6$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^6$ =(2,57,86,98,78,51,96)=(2,57,86,98,78,51,96)=(2,57,86,98,78,51,96) and vk=57vk=57vk=57.

KZG.Setup(1λ,8)=(ck,vk)=KZG.Setup(1^{\lambda},8)=(ck,vk)=KZG.Setup(1λ,8)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^7$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^7$ =(2,57,86,98,78,51,96,21)=(2,57,86,98,78,51,96,21)=(2,57,86,98,78,51,96,21) and vk=57vk=57vk=57.

KZG.Setup(1λ,11)=(ck,vk)=KZG.Setup(1^{\lambda},11)=(ck,vk)=KZG.Setup(1λ,11)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^{10}$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{10}$ =(2,57,86,98,78,51,96,21,146,179,124)=(2,57,86,98,78,51,96,21,146,179,124)=(2,57,86,98,78,51,96,21,146,179,124) and vk=57vk=57vk=57.

KZG.Setup(1λ,6)=(ck,vk)=KZG.Setup(1^{\lambda},6)=(ck,vk)=KZG.Setup(1λ,6)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^5$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^5$ =(2,57,86,98,78,51)=(2,57,86,98,78,51)=(2,57,86,98,78,51) and vk=57vk=57vk=57.

KZG.Setup(1λ,30)=(ck,vk)=KZG.Setup(1^{\lambda},30)=(ck,vk)=KZG.Setup(1λ,30)=(ck,vk)= ({ gτig\tau^igτi } $_{i=0}^{29}$, gτg \taugτ)

that for secret element τ=119\tau=119τ=119 and generator g=2g=2g=2 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{29}$ =(2,57,86,98,78,51,96,21,146,179,124,95,83,103,130,85,160,35,=(2, 57, 86, 98, 78, 51, 96, 21, 146, 179, 124, 95, 83, 103, 130, 85, 160, 35 ,=(2,57,86,98,78,51,96,21,146,179,124,95,83,103,130,85,160,35, 2,57,86,98,78,51,96,21,146,179,124,95)2, 57, 86, 98, 78, 51, 96, 21, 146, 179, 124, 95)2,57,86,98,78,51,96,21,146,179,124,95) and vk=57vk=57vk=57.

Previous1- Setup PhaseNextExample 2

Last updated 2 months ago