> For the complete documentation index, see [llms.txt](https://fidesinnova.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fidesinnova.gitbook.io/docs/fides-zero-knowledge-proof-zkp-algorithm/2-commitment-phase/2-2-example-1.md).

# Example 1

Assume the following sample code:\
\
\
mul R1, R1, 5 => Gate 1, p=181\
add R1, R1, 11 => Gate 2, p=181\
mul R1, R1, 26 => Gate 3, p=181

The constraints are as follows considering $$p=181$$:

\
$$R\_1^{(2)}-5R\_1^{(1)}=0$$\
$$R\_1^{(3)}-R\_1^{(2)}-11=0$$\
$$R\_1^{(4)}-26R\_1^{(3)}=0$$

To keep the example simple and understandable, we continue with $$n\_g=3$$ and $$n\_i=1$$.

The Prover calculates square matrices $$A$$, $$B$$ and $$C$$ of order $$n\_g+n\_i+1=3+1+1=5$$ based on above construction:

$$
A=\begin{bmatrix}
0&0&0&0&0\\
0&0&0&0&0\\
0&1&0&0&0\\
1&0&0&0&0\\
0&0&0&1&0
\end{bmatrix}
$$

$$
B=\begin{bmatrix}
0&0&0&0&0\\
0&0&0&0&0\\
5&0&0&0&0\\
11&0&1&0&0\\
26&0&0&0&0
\end{bmatrix}
$$

$$
C=\begin{bmatrix}
0&0&0&0&0\\
0&0&0&0&0\\
0&0&1&0&0\\
0&0&0&1&0\\
0&0&0&0&1
\end{bmatrix}
$$

At we see, the matrices $$A$$ and $$B$$ are $$2-SLT$$ and matrix $$C$$ is $$2-Diag$$. Also $$Az\hspace{1mm}o\hspace{1mm}Bz=Cz$$.

We consider multiplicative subgroup $$\mathbb{H}$$ of order $$n=n\_g+n\_i+1=5$$ with generator\
$$\omega=2^{36}\equiv 59 (\textrm{mod}\hspace{1mm}181)$$. Note that if $$g$$ is a generator of field $$\mathbb{F}$$ of order $$p$$, then, $$g^{\frac{p-1}{n}}$$ is a generator of a multiplicative subgroup of it of order $$n$$. Therefore, $$\mathbb{H}=$$ { $$1,\omega,\omega^2,\omega^3,\omega^4$$ } = { $$1,59,42,125,135$$ }.

Also, consider multiplicative subgroup $$\mathbb{K}$$ of order $$m=2n\_g=6$$ where $$t=n\_i+1=2$$ with generator $$\gamma=g^{\frac{p-1}{m}}=2^{30}\equiv49(\textrm{mod}\hspace{1mm}181)$$. Therefore, $$\mathbb{K}=$$ { $$1,\gamma,\gamma^2,...,\gamma^5$$ } = { $$1,49,48,180,132,133$$ } .

### PFR Commitment

$$Commit(ck=(2,66,83,91,96,24,2,66,83),m\_f=(A,B,C),s\in R)$$:

1- The Prover Selects $$s=(s\_1,...,s\_{s\_{AHP}(0)})$$ of random space $$R$$.

2- The Prover calculates $$\overrightarrow{O}=Enc(m\_f=(A,B,C))$$ as encoded index as following:.

First, calculates the polynomial $$row\_{PFR\_A}(x)$$. Since matrix $$A$$ has three non-zero entries that the first of them is in the second row, so $$c\_0=2$$ and $$row\_{PFR\_A}(\gamma^0)=\omega^2$$ , note that rows numbered of zero, the second is in the third row, so $$c\_1=3$$ and $$row\_{PFR\_A}(\gamma^1)=\omega^3$$ and the third is in the fourth row, so $$c\_2=4$$ and $$row\_{PFR\_A}(\gamma^2)=\omega^4$$. Note that to construct all three polynomials, we read the entries in the matrix in row or column order. Here they are read in row order.

According to the values ​​defined for $$\gamma$$ and $$\omega$$, we have $$row\_{PFR\_A}(1)=42$$, $$row\_{PFR\_A}(43)=125$$ and $$row\_{PFR\_A}(39)=135$$. Therefore based on Lagrange polynomials, have $$row\_{PFR\_A}(x)=\sum\_{i=1}^{3}y\_iL\_i(x)$$, so $$row\_{PFR\_A}(x)=42L\_1(x)+125L\_2(x)+135L\_3(x)$$, where $$L\_1(x)=\frac{(x-43)(x-39)}{(1-43)(1-39)}=\frac{(x-43)(x-39)}{(-42)(-38)}$$. Now, since $$-42\equiv139\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, $$-38\equiv143\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, $$-43\equiv138\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ and $$-39\equiv142\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , therefore $$L\_1(x)=\frac{(x+138)(x+142)}{(139)(143)}$$ and since $$(139)(143)\equiv 148\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ and $$148^{-1}\equiv 170\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , have $$L\_1(x)=170(x+138)(x+142)=170x^2+178x+15$$ . We get in a similar way that $$L\_2(x)=167x^2+17x+178$$ and $$L\_3(x)=25x^2+167x+170$$ . Therefore $$row\_{PFR\_A}(x)=77x^2+109x+37$$ .

Now, calculates $$col\_{PFR\_A}(x)$$. Since matrix $$A$$ has three non-zero entries that the first of them is in the first column, so $$r\_0=1$$ and $$col\_{PFR\_A}(\gamma^0)=\omega^1$$ , note that columns numbered of zero, the second is in the zero column, so $$r\_1=0$$ and $$col\_{PFR\_A}(\gamma^1)=\omega^0$$ and the third is in the third column, so $$r\_2=3$$ and $$col\_{PFR\_A}(\gamma^2)=\omega^3$$. Therefore $$col\_{PFR\_A}(1)=59$$, $$col\_{PFR\_A}(43)=1$$ and $$col\_{PFR\_A}(39)=125$$. So $$col\_{PFR\_A}(x)=59L\_1(x)+L\_2(x)+125L\_3(x)=109x^2+81x+50$$.

Now, calculates $$val\_{PFR\_A}(x)$$. Since matrix $$A$$ has three non-zero entries such that the value of all of them is one, therefore $$v\_0=v\_1=v\_2=1$$. So, $$val\_{PFR\_A}(x)=L\_1(x)+L\_2(x)+L\_3(x)=1$$.

Therefore, the matrix $$A$$ is encoded by $$row\_{PFR\_A}(x)=77x^2+109x+37$$, $$col\_{PFR\_A}(x)=109x^2+81x+50$$ and $$val\_{PFR\_A}(x)=1$$.

Now, encodes the matrix $$B$$. First, calculates the polynomial $$row\_{PFR\_B}(x)$$. Since matrix $$B$$ has four non-zero entries such that the first of them is in the second row, so $$c\_0=2$$ and $$row\_{PFR\_B}(\gamma^0)=\omega^2$$ . The second and the third are in the third row, so $$c\_1=c\_2=3$$ and $$row\_{PFR\_B}(\gamma^1)=row\_{PFR\_B}(\gamma^2)=\omega^3$$ and the fourth is in the fourth row, so $$c\_3=4$$ and $$row\_{PFR\_B}(\gamma^3)=\omega^4$$. Therefore, $$row\_{PFR\_B}(1)=42$$, $$row\_{PFR\_B}(43)=125$$, $$row\_{PFR\_B}(39)=125$$ and $$row\_{PFR\_B}(48)=135$$. So $$row\_{PFR\_B}(x)=42L\_1(x)+125L\_2(x)+125L\_3(x)+135L\_4(x)$$ where $$L\_1(x)=\frac{(x-43)(x-39)(x-48)}{(1-43)(1-39)(1-48)}=\frac{(x+138)(x+142)(x+133)}{(139)(143)(134)}=\frac{(x+138)(x+142)(x+133)}{103}$$. Since $$103^{-1}\equiv58\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, so $$L\_1(x)=58(x+138)(x+142)(x+133)=58x^3+62x^2+116x+127$$. We get in a similar way that $$L\_2(x)=39x^3+7x^2+19x+116$$, $$L\_3(x)=138x^3+155x^2+7x+62$$ and $$L\_4(x)=127x^3+138x^2+39x+58$$. Therefore $$row\_{PFR\_B}(x)=76x^3+35x^2+174x+119$$.

Now, calculates $$col\_{PFR\_B}(x)$$. Since matrix $$B$$ has four non-zero entries that the first, second and fourth of them are in zero column, so $$r\_0=r\_1=r\_3=0$$ and $$col\_{PFR\_B}(\gamma^0)=col\_{PFR\_B}(\gamma^1)=col\_{PFR\_B}(\gamma^3)=\omega^0$$ and the third is in the second column, so $$r\_2=2$$ and $$col\_{PFR\_B}(\gamma^2)=\omega^2$$ . Therefore $$col\_{PFR\_B}(1)=1$$, $$col\_{PFR\_B}(43)=1$$, $$col\_{PFR\_B}(39)=42$$ and $$col\_{PFR\_B}(48)=1$$. So $$col\_{PFR\_B}(x)=L\_1(x)+L\_2(x)+42L\_3(x)+L\_4(x)=47x^3+20x^2+106x+9$$.

Now, calculates $$val\_{PFR\_B}(x)$$. Since matrix $$B$$ has four non-zero entries that value of them are $$5$$, $$11$$, $$1$$ and $$26$$, respectively. Therefore $$v\_0=v\_1=v\_2=1$$ $$val\_{PFR\_B}(\gamma^0)=5$$, $$val\_{PFR\_B}(\gamma^1)=11$$, $$val\_{PFR\_B}(\gamma^2)=1$$ and $$val\_{PFR\_B}(\gamma^3)=26$$. So, $$val\_{PFR\_B}(1)=5$$, $$val\_{PFR\_B}(43)=11$$, $$val\_{PFR\_B}(39)=1$$ and $$val\_{PFR\_B}(48)=26$$. Therefore, $$val\_{PFR\_B}(x)=5L\_1(x)+11L\_2(x)+L\_3(x)+26L\_4(x)=177x^3+148x^2+42$$.

Therefore, the matrix $$B$$ is encoded by $$row\_{PFR\_B}(x)=76x^3+35x^2+174x+119$$, $$col\_{PFR\_B}(x)=47x^3+20x^2+106x+9$$ and $$val\_{PFR\_B}(x)=177x^3+148x^2+42$$.

Now, calculates polynomial $$row\_{PFR\_C}(x)$$. In a similar way, Since matrix $$C$$ has three non-zero entries that are in the third, fourth and fifth rows, therefore $$row\_{PFR\_C}(\gamma^0)=\omega^2$$ , $$row\_{PFR\_C}(\gamma^1)=\omega^3$$ and $$row\_{PFR\_C}(\gamma^2)=\omega^4$$. Then $$row\_{PFR\_C}(1)=42$$ , $$row\_{PFR\_C}(43)=125$$ and $$row\_{PFR\_C}(39)=135$$. So $$row\_{PFR\_C}(x)=42L\_1(x)+125L\_2(x)+135L\_3(x)$$, therefore $$row\_{PFR\_C}(x)=77x^2+109x+37$$.

Now, since $$C$$ is a diagonal matrix, polynomials $$row\_{PFR\_C}(x)$$ and $$col\_{PFR\_C}(x)$$ are equal. Also, since the matrix $$C$$ has three non-zero entries such that the value of all of them is one, therefore $$v\_0=v\_1=v\_2=1$$. So, $$val\_{PFR\_C}(x)=L\_1(x)+L\_2(x)+L\_3(x)=1$$.

Therefore, the matrix $$C$$ is encoded by $$row\_{PFR\_C}(x)=77x^2+109x+37$$, $$col\_{PFR\_C}(x)=77x^2+109x+37$$ and $$val\_{PFR\_C}(x)=1$$. Therefore, encoding of $$m\_f=(A,B,C)$$ calculates as following: $$\overrightarrow{O}\_{PFR}=(37,109,77,0,0,0,0,0,0,50,81,109,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,119,174,35,76,0,0,$$ $$0,0,0,9,106,20,47,0,0,0,0,0,42,0,148,177,0,0,0,0,0,37,109,77,0,0,0,0,0,0,37,109,$$$$77,0,0,0,0,0,0,37,109,77,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0)$$

3- The Prover calculates commitment by using of KZG commitment scheme as following:

$$Com\_{T}=\sum\_{i=0}^{deg\_T}a\_ig\tau^i=\sum\_{i=0}^{deg\_T}a\_ick(i)$$ where $$a\_i$$ is coefficient of $$x^i$$ in polynomial $$T(x)$$.

Therefore

$$Com\_{PFR}^0=\sum\_{i=0}^{2}row\_{PFR\_{A\_i}}(g\tau^i)=\sum\_{i=0}^{2}row\_{PFR\_{A\_i}}ck(i)=37ck(0)+109ck(1)+77ck(2)=37\times2+109\times 57+77\times 86\equiv\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$

$$Com\_{PFR}^1=$$

\
$$Com\_{PFR}^2=$$

and similarly

$$Com\_{PFR}^3=$$, $$Com\_{PFR}^4=$$, $$Com\_{PFR}^5=$$, $$Com\_{PFR}^6=$$, $$Com\_{PFR}^7=$$ and $$Com\_{PFR}^8=$$.

4- The Prover sends $$Com\_{PFR}=$$ to the Verifier.

### AHP Commitment

$$Commit(ck,m\_f=(A,B,C),s\in R)$$:

1 - The Prover Selects $$s=(s\_1,...,s\_{s\_{AHP}(0)})$$ of random space $$R$$.\
2- The Prover calculates $$\overrightarrow{O}\_{AHP}=Enc(m\_f=(A,B,C))$$ as encoded index as following:

The polynomial $$row\_{AHP\_A}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } with $$row\_{AHP\_A}(k=\gamma^i)=\omega^{r\_i}$$ for $$1\leq i\leq ||A||$$ , and otherwise $$row\_{AHP\_A}(k)$$ returns an arbitrary element in $$\mathbb{H}$$.\
So $$row\_{AHP\_A}(k)$$ on $$\mathbb{K}$$ is a polynomial so that $$row\_{AHP\_A}(1)=42$$ , $$row\_{AHP\_A}(49)=125$$, $$row\_{AHP\_A}(48)=135$$ and otherwise $$row\_{AHP\_A}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$row\_{AHP\_A}(180)=125$$, $$AHProw\_A(132)=135$$, $$AHProw\_A(133)=1$$ . Therefore, $$row\_{AHP\_A}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=162x^5+62x^4+161x^3+169x^2+88x+124$$.

Also, $$col\_{AHP\_A}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } with $$col\_{AHP\_A}(k=\gamma^i)=\omega^{c\_i}$$ for $$1\leq i\leq ||A||$$ and otherwise $$col\_{AHP\_A}(k)$$ returns an arbitrary element in $$\mathbb{H}$$.\
So $$col\_{AHP\_A}(k)$$ on $$\mathbb{K}$$ is a polynomial so that $$col\_{AHP\_A}(1)=59$$ , $$col\_{AHP\_A}(49)=1$$, $$col\_{AHP\_A}(48)=125$$ and otherwise $$col\_{AHP\_A}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$col\_{AHP\_A}(180)=125$$, $$col\_{AHP\_A}(132)=135$$ and $$col\_{AHP\_A}(133)=1$$. Therefore, $$col\_{AHP\_A}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=128x^5+150x^4+32x^3+109x^2+169x+14$$

and , $$val\_{AHP\_A}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } with $$val\_{AHP\_A}(k=\gamma^i)=\frac{v\_i}{u\_{\mathbb{H}}(row\_{AHP\_A}(k),row\_{AHP\_A}(k))u\_{\mathbb{H}}(col\_{AHP\_A}(k),col\_{AHP\_A}(k))}$$ for $$1\leq i\leq ||A||$$ where $$v\_i$$ is value of $$i^{th}$$ nonzero entry and otherwise $$val\_{AHP\_A}(k)$$ returns zero. Note that based on definition of $$u\_{\mathbb{H}}(x,y)$$, for each $$x \in \mathbb{H}$$, $$u\_{\mathbb{H}}(x,x)=|\mathbb{H}|x^{|\mathbb{H}|-1}=5x^4$$. So $$val\_{AHP\_A}(1)=\frac{1}{(5row\_{AHP\_A}^4(1))(5col\_{AHP\_A}^4(1))}=\frac{1}{5\times 42^4\times5\times59^4}=\frac{1}{145}\equiv 5\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, $$val\_{AHP\_A}(49)=\frac{1}{(5row\_{AHP\_A}^4(49))(5col\_{AHP\_A}^4(49))}=\frac{1}{5\times 125^4\times5\times1^4}=\frac{1}{145}\equiv 5\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , $$val\_{AHP\_A}(48)=\frac{1}{(5row\_{AHP\_A}^4(48))(5col\_{AHP\_A}^4(48))}=\frac{1}{5\times 135^4\times5\times 125^4}=\frac{1}{48}\equiv 132\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ and $$val\_{AHP\_A}(k)=0$$ for $$k\in \mathbb{K}-$$ { $$1,49,48$$ }. Therefore $$val\_{AHP\_A}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=72x^5+79x^4+22x^3+111x^2+180x+84$$.

Now, $$\hat{row\_{AHP\_A}}$$, $$\hat{col\_{AHP\_A}}$$ and $$\hat{val\_{AHP\_A}}$$ are extensions of $$row\_{AHP\_A}$$, $$col\_{AHP\_A}$$ and $$val\_{AHP\_A}$$ so that are agree on $$\mathbb{K}$$.

Similarly, $$row\_{AHP\_B}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } so that $$row\_{AHP\_B}(1)=42$$, $$row\_{AHP\_B}(49)=125$$, $$row\_{AHP\_B}(48)=125$$, $$row\_{AHP\_B}(180)=135$$ and for the rest values of $$\mathbb{K}$$, $$row\_{AHP\_B}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$row\_{AHP\_B}(132)=135$$ and $$row\_{AHP\_B}(133)=1$$. Therefore $$row\_{AHP\_B}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=20x^5+85x^4+37x^3+151x^2+168x+124$$.

Also, $$col\_{AHP\_B}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } so that $$col\_{AHP\_B}(1)=1$$ , $$col\_{AHP\_B}(49)=1$$, $$col\_{AHP\_B}(48)=42$$, $$col\_{AHP\_B}(180)=1$$ and for the rest values of $$\mathbb{K}$$ , $$col\_{AHP\_B}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$col\_{AHP\_B}(132)=135$$ and $$col\_{AHP\_B}(133)=1$$. Therefore $$col\_{AHP\_B}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=18x^5+164x^4+180x^3+18x^2+164x$$

and , $$val\_{AHP\_B}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } so that $$val\_{AHP\_B}(1)=\frac{5}{(5row\_{AHP\_B}^4(1))(5col\_{AHP\_B}^4(1))}=\frac{5}{5\times 42^4\times5\times1^4}=\frac{5}{48}\equiv 117\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, $$val\_{AHP\_B}(49)=\frac{11}{(5row\_{AHP\_B}^4(49))(5col\_{AHP\_B}^4(49))}=\frac{11}{5\times 125^4\times5\times1^4}=\frac{11}{145}\equiv 55\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , $$val\_{AHP\_B}(48)=\frac{1}{(5row\_{AHP\_B}^4(48))(5col\_{AHP\_B}^4(48))}=\frac{1}{5\times 125^4\times5\times 42^4}=\frac{1}{25}\equiv 29\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , $$val\_{AHP\_B}(180)=\frac{26}{(5row\_{AHP\_B}^4(180))(5col\_{AHP\_B}^4(180))}=\frac{26}{5\times 135^4\times5\times 1^4}=\frac{26}{27}\equiv 68\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ and $$val\_{AHP\_B}(k)=0$$ for $$k\in \mathbb{K}-{1,49,48,180}$$. Therefore $$val\_{AHP\_B}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=86x^5+53x^4+34x^3+55x^2+176x+75$$.

Now, $$\hat{row\_{AHP\_B}}$$, $$\hat{col\_{AHP\_B}}$$ and $$\hat{val\_{AHP\_B}}$$ are extensions of $$row\_{AHP\_B}$$, $$col\_{AHP\_B}$$ and $$val\_{AHP\_B}$$ so that are agree on $$\mathbb{K}$$.

Similarly, $$row\_{AHP\_C}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } so that $$row\_{AHP\_C}(1)=42$$, $$row\_{AHP\_C}(49)=125$$, $$row\_{AHP\_C}(48)=135$$ and for the rest values of $$\mathbb{K}$$, $$row\_{AHP\_C}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$row\_{AHP\_C}(180)=125$$, $$row\_{AHP\_C}(132)=135$$ and $$row\_{AHP\_C}(133)=1$$. Therefore $$row\_{AHP\_C}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=162x^5+62x^4+161x^3+169x^2+88x+124$$.

Also, $$col\_{AHP\_C}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ }so that $$col\_{AHP\_C}(1)=42$$ , $$col\_{AHP\_C}(49)=125$$, $$col\_{AHP\_C}(48)=135$$, $$col\_{AHP\_C}(180)=125$$ and for the rest values of $$\mathbb{K}$$ , $$col\_{AHP\_C}(k)$$ returns arbitrary elements of $$\mathbb{H}$$, for example $$col\_{AHP\_C}(132)=135$$ and $$col\_{AHP\_C}(133)=1$$. Therefore $$col\_{AHP\_C}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=162x^5+62x^4+161x^3+169x^2+88x+124$$.

and , $$val\_{AHP\_C}:\mathbb{K}=$$ { $$1,49,48,180,132,133$$ } $$\to\mathbb{H}=$$ { $$1,59,42,125,135$$ } so that $$val\_{AHP\_C}(1)=\frac{1}{(5row\_{AHP\_C}^4(1))(5col\_{AHP\_C}^4(1))}=\frac{1}{5\times 42^4\times5\times42^4}=\frac{1}{27}\equiv 114\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$, $$val\_{AHP\_C}(49)=\frac{1}{(5row\_{AHP\_C}^4(49))(5col\_{AHP\_C}^4(49))}=\frac{1}{5\times 125^4\times5\times125^4}=\frac{1}{117}\equiv 82\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ , $$val\_{AHP\_C}(48)=\frac{1}{(5row\_{AHP\_C}^4(48))(5col\_{AHP\_C}^4(48))}=\frac{1}{5\times 135^4\times5\times135 ^4}=\frac{1}{145}\equiv 5\hspace{1mm}(\textrm{mod}\hspace{1mm}181)$$ and $$val\_{AHP\_C}(k)=0$$ for $$k\in \mathbb{K}-{1,49,48}$$. Therefore $$val\_{AHP\_C}(x)=\sum\_{i=1}^{6}y\_iL\_i(x)=65x^5+61x^4+157x^3+53x^2+16x+124$$.

Now, $$\hat{row\_{AHP\_C}}$$, $$\hat{col\_{AHP\_C}}$$ and $$\hat{val\_{AHP\_C}}$$ are extensions of $$row\_{AHP\_C}$$, $$col\_{AHP\_C}$$ and $$val\_{AHP\_C}$$ so that are agree on $$\mathbb{K}$$.

Therefore, $$\overrightarrow{O}\_{AHP}=(124,88,169,161,62,162,14,169,109,32,150,128,84,180,111,22,79,$$\
$$72,124,168,151,37,85,20,0,164,18,180,164,18,75,176,55,34,53,86,124,88,169,$$\
$$161,62,162,124,88,169,161,62,162,124,16,53,157,61,65)$$.

3- The Prover calculates commitment by using of $$KZG$$ commitment scheme as following:

$$Com\_{T}=\sum\_{i=0}^{deg\_T}a\_ig\tau^i=\sum\_{i=0}^{deg\_T}a\_ick(i)$$ where $$a\_i$$ is coefficient of $$x^i$$ in polynomial $$T(x)$$.

4- The Prover sends

$$Com\_{AHP}^0=\sum\_{i=0}^{5}\hat{row\_{AHP\_{A\_i}}}\hspace{1.1mm}ck(i)=124ck(0)+88ck(1)+169ck(2)+161ck(3)+62ck(4)+162ck(5) \equiv 166\hspace{1mm}(\textrm{mod}\hspace{1mm} 181)$$

and similarly

$$Com\_{AHP}^1=36$$, $$Com\_{AHP}^2=108$$, $$Com\_{AHP}^3=58$$, $$Com\_{AHP}^4=73$$, $$Com\_{AHP}^5=157$$, $$Com\_{AHP}^6=166$$, $$Com\_{AHP}^7=166$$ and $$Com\_{AHP}^8=36$$.

## AHP Commitment JSON File Example 1

IoT\_Manufacturer\_Name = "zkIoT"\
IoT\_Device\_Name = "MultiSensor"\
Device\_Hardware\_Version = "1.0"\
Firmware\_Version = "1.0"\
Device Picture= <>\
Lines = \[200, 350, 4000-4010]

```json
{
    "commitmentId": String,
    "deviceType": String,
    "deviceIdType": String,
    "deviceModel": String,
    "manufacturer": String,
    "softwareVersion": String,
    "class": 32-bit Integer,
    "m": 6,
    "n": 5,
    "p": 181,
    "g": 2,   
        
    // PFR Commitment   
    "row_PFR_A": 64-bit Array,
    "col_PFR_A": 64-bit Array,
    "val_PFR_A": 64-bit Array,
    "row_PFR_B": 64-bit Array,
    "col_PFR_B": 64-bit Array,
    "val_PFR_B": 64-bit Array,
    "row_PFR_C": 64-bit Array,
    "col_PFR_C": 64-bit Array,
    "val_PFR_C": 64-bit Array,
    
    "Com_PFR0": 64-bit Integer,
    "Com_PFR1": 64-bit Integer,
    "Com_PFR2": 64-bit Integer,
    "Com_PFR3": 64-bit Integer,
    "Com_PFR4": 64-bit Integer,
    "Com_PFR5": 64-bit Integer,
    "Com_PFR6": 64-bit Integer,
    "Com_PFR7": 64-bit Integer,
    "Com_PFR8": 64-bit Integer,   

    // AHP Commitment       
    "row_AHP_A":[124,88,169,161,62,162],
    "col_AHP_A":[14,169,109,32,150,128],
    "val_AHP_A":[84,180,111,22,79,72],
    "row_AHP_B":[124,168,151,37,85,20],
    "col_AHP_B":[0,164,18,180,164,18],
    "val_AHP_B":[75,176,55,34,53,86],
    "row_AHP_C":[124,88,169,161,62,162],
    "col_AHP_C":[124,88,169,161,62,162],
    "val_AHP_C":[124,16,53,157,61,65],
    
    "Com_AHP0":166,
    "Com_AHP1":36,
    "Com_AHP2":108,
    "Com_AHP3":58,
    "Com_AHP4":73,
    "Com_AHP5":157,
    "Com_AHP6":166,
    "Com_AHP7":166,
    "Com_AHP8":36,
    
    "curve": "bn128",
    "PolynomialCommitment": "KZG"
}
```
