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 2

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 32. Hence, ni=32n_i=32ni​=32. Considering a program which requires 4 gates for its arithmatization, we have ng=4n_g=4ng​=4. In this example, the maximum number of registers which are changed during the execution is nr=2n_r=2nr​=2 (Please see Example 2 in the Commitment phase). If the computation is done in F\mathbb{F}F of order p=1,678,321p=1,678,321p=1,678,321, ∣F∣=1678321|\mathbb{F}|=1678321∣F∣=1678321. Also, ∣H∣=n=ng+ni+1=37|\mathbb{H}|=n=n_g+n_i+1=37∣H∣=n=ng​+ni​+1=37. Also, bbb is a random number in { 1,...,∣F∣−∣H∣1,...,|\mathbb{F}|-|\mathbb{H}|1,...,∣F∣−∣H∣} = { 1,...,1678321−37=16782841,...,1678321-37=16782841,...,1678321−37=1678284 } such as b=2b=2b=2. Also, m=2ng=8m=2n_g=8m=2ng​=8, ∣w∣=ng−nr=2|w|=n_g-n_r=2∣w∣=ng​−nr​=2, ∣K∣=m=8|\mathbb{K}|=m=8∣K∣=m=8. 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)}^{}$ = { 8,8,8,8,8,8,8,8,8,4,39,39,39,40,75,36,38,36,36,7,42 }

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=11g=11g=11, for each element in ddd:

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

that for secret element τ=119\tau=119τ=119 and generator g=11g=11g=11 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{137}$ =(11,1309,...)=(11,1309,...)=(11,1309,...) and vk=1309vk=1309vk=1309.

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=11g=11g=11 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{3}$ =(11,1309,...)=(11,1309,...)=(11,1309,...) and vk=1309vk=1309vk=1309.

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

that for secret element τ=119\tau=119τ=119 and generator g=11g=11g=11 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{38}$ =(11,1309,...)=(11,1309,...)=(11,1309,...) and vk=1309vk=1309vk=1309.

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

that for secret element τ=119\tau=119τ=119 and generator g=11g=11g=11 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{39}$ =(11,1309,...)=(11,1309,...)=(11,1309,...) and vk=1309vk=1309vk=1309.

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

that for secret element τ=119\tau=119τ=119 and generator g=11g=11g=11 outputs ck=ck=ck= { gτig\tau^igτi } $_{i=0}^{74}$ =(11,1309,...)=(11,1309,...)=(11,1309,...) and vk=1309vk=1309vk=1309.

PreviousExample 1Next2-commitment-phase

Last updated 2 months ago