1- Setup Phase

The first phase in our system is the setup phase. This phase should be run by a trusted party.

The setup phase is crucial for generating the necessary cryptographic parameters. During this phase, a trusted party generates public parameters, pppp. We have defined 18 setting classes for our proving system.

Fields utilized in ZKP:

  • (Goldilock- ϕ\phi): p=ϕ2ϕ+1p=\phi^2-\phi+1 where ϕ2=ϕ1modp\phi^2 = \phi-1 \hspace{1mm} mod \hspace{1mm} p

  • (Sophie Germain- ϕ\phi): a prime number where both p and (2p+1) are prime. ϕ2=ϕ1modp\phi^2 = \phi-1 \hspace{1mm} mod \hspace{1mm} p

Condition for the field utilized in function-hiding ZKP system:

  • m(p1)m | (p-1) and n(p1)n | (p-1)

Class
Number of gates, ng
Number of inputs, ni
n=ni+ng+1
m=2*ng
Field size, prime number p
Condition for function-hiding system ZKP
Generator, g

1

2

32

35

4

(Goldilock-1261) = (1261)21261+1=1,588,861(1261)^2-1261+1 = 1,588,861

4 | (1,588,861 -1 ) 35 | (1,588,861 -1 )

17

2

4

32

37

8

(Goldilock-1296) = (1296)21296+1=1,678,321(1296)^2-1296+1 = 1,678,321

8 | (1,678,321-1 ) 37 | (1,678,321-1 )

11

3

8

32

41

16

(Goldilock-2256) = (2256)22256+1=5,087,281(2256)^2-2256+1 = 5,087,281

16 | (5,087,281 -1 ) 41 | (5,087,281 -1 )

17

4

16

32

49

32

(Goldilock-1569) = (1569)21569+1=2,460,193(1569)^2-1569+1 = 2,460,193

32 | (2,460,193 -1 ) 49 | (2,460,193 -1 )

5

5

32

32

65

64

(Goldilock-2496) = (2496)22496+1=6,227,521(2496)^2-2496+1 = 6,227,521

64 | (6,227,521 -1 ) 65 | (6,227,521 -1 )

7

6

64

32

97

128

(Goldilock-3201) = (3201)23201+1=10,243,201(3201)^2-3201+1 = 10,243,201

128 | (10,243,201 -1 ) 97 | (10,243,201 -1 )

21

7

128

32

161

256

2,060,801 (Sophie Germain)

256 | (2,060,801 -1 ) 161 | (2,060,801 -1 )

3

8

256

32

289

512

14,056,961 (Sophie Germain)

512 | (14,056,961 -1 ) 289 | (14,056,961 -1 )

11

9

512

32

545

1,024

138,403,841 (Sophie Germain)

1,024 | (138,403,841 -1 ) 545 | (138,403,841 -1 )

15

10

1,024

32

1,057

2,048

270,592,001 (sophie Germain)

2,048 | (270,592,001 -1 ) 1,057 | (270,592,001 -1 )

15

11

2,048

32

2,081

4,096

272,760,833 (Sophie Germain)

4,096 | (272,760,833 -1 ) 2,081 | (272,760,833 -1 )

13

12

4,096

32

4,129

8,192

14,071,103,489 (Sophie Germain)

8,192 | (14,071,103,489 -1 ) 4,129 | (14,071,103,489 -1 )

3

13

8,192

32

8,225

16,384

673,792,001 (Sophie Germain)

16,384 | (673,792,001 -1 ) 8,225 | (673,792,001 -1 )

17

14

16,384

32

16,417

32,768

59,174,748,161 (Sophie Germain)

32,768 | (59,174,748,16 -1 ) 16,417 | (59,174,748,16 -1 )

3

15

32,768

32

32,801

65,536

236,461,096,961 (Sophie Germain)

65,536 | (236,461,096,961 -1 ) 32,801 | (236,461,096,961 -1 )

3

16

65,536

32

65,569

131,072

42,971,299,841 (Sophie Germain)

131,072 | (42,971,299,841 -1 ) 65,569 | (42,971,299,841 -1 )

3

Function-hiding functional commitment Scheme

Function-hiding functional commitment scheme enables the Prover to commit to a secret function ff and later without revealing any other information about ff, proves that y=f(x)y=f(x) for public xx and yy. This scheme is a tuple (Setup,Commitment,ProofGeneration,ProofVerification)(Setup,\, Commitment,ProofGeneration, ProofVerification) that contains two major phases, proof of function relation (PFR) phase and algebraic holographic proof (AHP) phase.

Major Phase 1 - A proof of function relation (PFR)

A proof of function relation, PFRPFR, shows that a committed relation is a function.

Major Phase 2 - An algebraic holographic proof (AHP)

An algebraic holographic proof, AHPAHP, is scheme where the prover without revealing any information about function ff, proves that y=f(x)y=f(x) for public xx and yy.

Both PFR and AHP will be compiled to a standard interactive protocol using a univariate polynomial commitment, PCPC, scheme. A PCPC is a commitment scheme for Fd[X]\mathbb{F}^{\leq d}[X] with maximum degree dNd\in\mathbb{N} and coefficients in the field F\mathbb{F}. It supports an argument of knowledge for proving the correct evaluation of a committed polynomial at a given point. This scheme is a tuple PC=(PC.Setup,PC.Commit,PC.Eval,PC.Check)PC=(PC.Setup,PC.Commit,PC.Eval,PC.Check).

In the following section, we will review the setup phase of our system. We also provide an example to clarify the method.

1-1- PFR and AHP Setup

Setup(1λ,N)Setup(1^{\lambda},N): This function outputs pp=PC.Setup(1λ,d)pp=PC.Setup(1^{\lambda},d) where λ\lambda is security parameter and the set

d=d= { dAHP(N,i,j)d_{AHP}(N,i,j) } $_{i=0,1,...,k_AHP, j=1,2,..,s_AHP(i)}^{}$

\bigcup { df(N,i,j)d_f(N,i,j) } $_{i=1,2,...,k_f, j=1,2,..,s_f(i)}^{}$

where NN is the maximum supported index size. Also, considering dAHP:N3Nd_{AHP}:\mathbb{N}^3\to\mathbb{N}, dAHP(N,i,j)d_{AHP}(N,i,j) is the degree bound for jthj^{th} polynomial in round ii of AHPAHP. kAHPk_{AHP} is the number of rounds in AHPAHP. Moreover, considering sAHP:NNs_{AHP}:\mathbb{N}\to\mathbb{N}, sAHP(i)s_{AHP}(i) is the number of polynomials that the Prover sends to the Verifier in round ii of AHPAHP. Considering df:N3Nd_f:\mathbb{N}^3\to\mathbb{N}, df(N,i,j)d_f(N,i,j) is the degree bound for jthj^{th} polynomial that the Prover sends to the Verifier in round ii of PFRPFR. kfk_f is the number of rounds in PFRPFR. Considering sf:NNs_f:\mathbb{N}\to\mathbb{N}, where sf(i)s_f(i) is the number polynomials that the Prover sends to the Verifier in round ii of PFRPFR.

Note that sAHP(0)=sf(0)s_{AHP}(0)=s_{f}(0) and for all ii\in { 1,2,...,sAHP(0)1,2,...,s_{AHP}(0) }, dAHP(N,0,i)=df(N,0,i)d_{AHP}(N,0,i)=d_{f}(N,0,i). Also, there are kAHP=4k_{AHP}=4 rounds in AHPAHP where in

Round 00: sAHP(0)=9s_{AHP}(0)=9, dAHP(N,0,j)=md_{AHP}(N,0,j)=m for jj\in { 1,2,...,sAHP(0)=91,2,...,s_{AHP}(0)=9 }, Round 1: sAHP(1)=6s_{AHP}(1)=6, dAHP(N,1,1)=w+bd_{AHP}(N,1,1)=|w|+b, dAHP(N,1,2)=H+bd_{AHP}(N,1,2)=|\mathbb{H}|+b, dAHP(N,1,3)=H+bd_{AHP}(N,1,3)=|\mathbb{H}|+b, dAHP(N,1,4)=H+bd_{AHP}(N,1,4)=|\mathbb{H}|+b, dAHP(N,1,5)=H+2b1d_{AHP}(N,1,5)=|\mathbb{H}|+2b-1, dAHP(N,1,6)=2H+b1d_{AHP}(N,1,6)=2|\mathbb{H}|+b-1, Round 2: sAHP(2)=2s_{AHP}(2)=2, dAHP(N,2,1)=H1d_{AHP}(N,2,1)=|\mathbb{H}|-1, dAHP(N,2,2)=H+b1d_{AHP}(N,2,2)=|\mathbb{H}|+b-1, Round 3: sAHP(3)=2s_{AHP}(3)=2, dAHP(N,3,1)=H1d_{AHP}(N,3,1)=|\mathbb{H}|-1, dAHP(N,3,2)=H1d_{AHP}(N,3,2)=|\mathbb{H}|-1, Round 4: sAHP(4)=2s_{AHP}(4)=2, dAHP(N,4,1)=K1d_{AHP}(N,4,1)=|\mathbb{K}|-1 and dAHP(N,4,2)=6K6d_{AHP}(N,4,2)=6|\mathbb{K}|-6.

Therefore, { dAHP(N,i,j)d_{AHP}(N,i,j) } $_{i=0,1,...,k_AHP, j=1,2,...,s_AHP(i)}^{}$=

{ m,m,m,m,m,m,m,m,m,w+b,H+b,H+b,H+b,H+2b1,2H+b1,H1,H+b1,H1,m,m,m,m,m,m,m,m,m,|w|+b,|\mathbb{H}|+b,|\mathbb{H}|+b,|\mathbb{H}|+b,|\mathbb{H}|+2b-1,2|\mathbb{H}|+b-1,|\mathbb{H}|-1,|\mathbb{H}|+b-1,|\mathbb{H}|-1,

H1,K1,6K6|\mathbb{H}|-1,|\mathbb{K}|-1,6|\mathbb{K}|-6 } where m=2ngm=2n_g is maximum of number of non-zero entries of matrices AA, BB and CC corresponding with arithmetic circuit of function ff with ngn_g gates. Also, H\mathbb{H} and K\mathbb{K} are multiplicative subgroups of field F\mathbb{F} with order mm and nn, where n=ng+ni+1n=n_g+n_i+1 and nin_i is the the size of input xx. Note that all the computations are in filed F\mathbb{F} with order prime number pp. bb is a random number in { 1,2,..,FH1,2,..,|\mathbb{F}|-|\mathbb{H}| }. Also, ww are the intermediate values (witness) which are created when executing a program. w=ngnr|w|=n_g-n_r where nrn_r is the number of components in input xx which are changed during the program execution.

For example, if polynomial commitment scheme KZGKZG is used in our scheme, pp=KZG.Setup(1λ,d)=(ck,vk)=pp=KZG.Setup(1^{\lambda},d)=(ck,vk)= ({ gτig\tau^i } $_{i=0}^{d-1}$, gτg \tau) where ckck and vkvk are commitment key and verifying key, respectively. Here τ\tau is a secret element and must be discarded after the SetupSetup. Also, gg is a generator of field F\mathbb{F} with large prime order pp such that p>2λ>dp > 2^\lambda > d. Also, dd is maximum degree of polynomials that wants to be committed.

The above mentioned system is programmed in C++ and Rust. The code is available at: https://github.com/FidesInnova/zkiot

The output of this code are ckck and vkvk keys stored in a json file and formatted as below.

1-2- Setup.json File Format

{
    "class":  32-bit Integer,
    "ck": 64-bit Integer Array,
    "vk": 64-bit Integer
}
  • class: Represents the configuration's classification. It indicates the number of gates in the ZKP circuit, defining the complexity or size of the cryptographic proof structure.

  • ck:(Commitment Key) The Commitment Key is used by the prover to create commitments to the witness (private inputs).

  • vk(Verification Key): Used by the verifier to validate the proof against the public inputs and commitments. It allows the verifier to efficiently check the proof without accessing the underlying secret data.

References

[1] Function-hiding Paper: Boneh, Dan, Wilson Nguyen, and Alex Ozdemir. "Efficient functional commitments: How to commit to a private function." Cryptology ePrint Archive (2021).

[2] Marlin Paper: Chiesa, A., Hu, Y., Maller, M., Mishra, P., Vesely, N., & Ward, N. (2020). Marlin: Preprocessing zkSNARKs with universal and updatable SRS. In Advances in Cryptology–EUROCRYPT 2020: 39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Proceedings, Part I 39 (pp. 738-768). Springer International Publishing.‏‏

[3] Function-hiding with SIS Paper: de Castro, Leo, and Chris Peikert. "Functional commitments for all functions, with transparent setup and from SIS." Annual International Conference on the Theory and Applications of Cryptographic Techniques. Cham: Springer Nature Switzerland, 2023.‏

[4] Lookup table Paper: Gabizon, Ariel, and Zachary J. Williamson. "plookup: A simplified polynomial protocol for lookup tables." Cryptology ePrint Archive (2020).‏

[5] Lattice-based Function-hiding Paper: Wee, Hoeteck, and David J. Wu. "Lattice-based functional commitments: Fast verification and cryptanalysis." International Conference on the Theory and Application of Cryptology and Information Security. Singapore: Springer Nature Singapore, 2023.

[6] KZG Polynomial Commitment: A. Kate, G. M. Zaverucha, and I. Goldberg. Constant-size commitments to polynomials and their applications. In International conference on the theory and application of cryptology and information security, pages 177–194. Springer, 2010.

Last updated