# Models for Generation of Proof Forest in zk-SNARK Based Sidechains

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Preliminaries: Binary Trees and Forests

#### 2.1. Binary Trees and Free Magmas

**Notation**

**1.**

#### 2.2. Monoid of Sequences of Strict Binary Trees

**Corollary**

**1.**

#### 2.3. Perfect Binary Trees and Forests

**Notation**

**2.**

**Lemma**

**1.**

- 1.
- There exists a bracketing, i.e., an element of the free magma ${\mathcal{M}}_{p}$, such that, after the corresponding application of $p-1$ magma operations ★, a perfect binary tree ${t}^{\u2605}\left(f\right)$ is obtained;
- 2.
- ${\left({t}_{i}\right)}_{0\u2a7di<p}$ is a down-set of some perfect binary tree containing all its leaves with components ordered from left to right;
- 3.
- (a) Each tree ${t}_{i}$ in the family is perfect,(b) For each i, ${n}_{\ell}\left({t}_{i}\right)$ divides ${\sum}_{j=0}^{j=i-1}{n}_{\ell}\left(j\right)$;(c) The total sum ${\sum}_{j=0}^{j=p-1}{n}_{\ell}\left(j\right)$ is an power of 2.

**Proof.**

**Definition**

**1.**

**Definition**

**2.**

**Proposition**

**1.**

**Definition**

**3.**

## 3. The General Scheme

Algorithm 1: The general scheme of blocks generation |

- Dichotomous ${b}_{\mathrm{behavior}}$ regulates behavior of provers,
**deterministic**(mutually consistent) or**stochastic**(independent); - Dichotomous ${b}_{\mathrm{shape}}$ describes the shape of generated trees, only
**perfect**binary trees or arbitrary**strict**binary trees; - ${n}_{\mathrm{bl}}$ is the number of blocks published during the epoch;
- ${n}_{\mathrm{st}}$ is the number of steps for one block generation;
- ${n}_{\mathrm{pr}}$ is the number of provers;
- ${n}_{\mathrm{pos}}$ is the number of positions allocated for proof.

**Remark**

**1.**

Procedure OneStep(b_{behavior}, b_{shape}, n_{pr}, n_{pos}) |

- $T={T}_{{b}_{\mathrm{shape}}}$ the set of ${b}_{\mathrm{shape}}$ (i.e., strict/perfect) binary trees;
- $\mathbb{T}={\mathbb{T}}_{{b}_{\mathrm{shape}}}$ the set of sequences $t={\left({t}_{i}\right)}_{i\u2a7e0}$ of ${b}_{\mathrm{shape}}$ binary trees with finitely many non-zero height trees;
- ${t}^{\left[\phantom{\rule{0.166667em}{0ex}}\right]}$ be the sequence obtained by the shift, i.e., ${t}_{i}^{\left[\phantom{\rule{0.166667em}{0ex}}\right]}={t}_{i+1}$ for $i\u2a7e0$.$$\begin{array}{c}f={f}_{{b}_{\mathrm{behavior}},{b}_{\mathrm{shape}},{n}_{\mathrm{pr}},{n}_{\mathrm{pos}}}:\mathbb{T}\to \mathbb{T},\phantom{\rule{2.em}{0ex}}t\mapsto \Lambda \circ t,\end{array}$$$$\begin{array}{c}F={F}_{{b}_{\mathrm{behavior}},{b}_{\mathrm{shape}},{n}_{\mathrm{st}},{n}_{\mathrm{pr}},{n}_{\mathrm{pos}}}:\mathbb{T}\to \mathbb{T},\phantom{\rule{2.em}{0ex}}t\mapsto {\left({f}^{{n}_{\mathrm{st}}}\left(t\right)\right)}^{\left[\phantom{\rule{0.166667em}{0ex}}\right]},\end{array}$$$$\begin{array}{c}\pi ={\pi}_{{b}_{\mathrm{behavior}},{b}_{\mathrm{shape}},{n}_{\mathrm{st}},{n}_{\mathrm{pr}},{n}_{\mathrm{pos}}}:\mathbb{T}\to T,\phantom{\rule{2.em}{0ex}}t\mapsto {\left({f}^{{n}_{\mathrm{st}}}\left(t\right)\right)}_{0}.\end{array}$$

#### The Algorithm in Terms of Numbers of Leaves

## 4. Deterministic Case

**Lemma**

**2.**

**Proof.**

**Corollary**

**2.**

**Lemma**

**3.**

**Proof.**

**Definition**

**4.**

**Corollary**

**3.**

**Lemma**

**4.**

**Proof.**

#### 4.1. Generation of Strict Binary Trees

**Lemma**

**5.**

**Lemma**

**6.**

**Corollary**

**4.**

**Lemma**

**7.**

**Proof.**

**Proposition**

**2.**

**Proof.**

**Example**

**1.**

**Proposition**

**3.**

- 1.
- For each $m\u2a7e1$, the following sequence can be presented as the concatenation$${\left({\left({(n\wedge )}^{\circ \lceil {log}_{2}n\rceil}\right)}_{m}\right)}_{n>m}=\underset{k=1}{\overset{\infty}{\u2a01}}\left({2}^{k-1}(m-1){t}_{k}^{\u2605},{t}_{k}^{\u2605}\circ {f}_{k,1},{t}_{k}^{\u2605}\circ {f}_{k,2},\dots ,{t}_{k}^{\u2605}\circ {f}_{k,{2}^{k}}\right).$$
- 2.
- For $n\u2a7em\u2a7e1$,$${\left({(n\wedge )}^{\circ \lceil {log}_{2}n\rceil}\right)}_{m}=\left\{\begin{array}{cc}{t}_{k}^{\u2605}\circ {f}_{k,n-{2}^{k}m},\hfill & if\u2308{log}_{2}\frac{n}{m+1}\u2309=\u230a{log}_{2}\frac{n}{m}\u230b=k,\hfill \\ {t}_{k}^{\u2605},\hfill & if\u2308{log}_{2}\frac{n}{m}\u2309=\u230a{log}_{2}\frac{n}{m+1}\u230b+1=k.\hfill \end{array}\right.$$

**Proof.**

**Corollary**

**5.**

#### 4.2. Generation of Perfect Binary Trees

**Lemma**

**8.**

**Proof.**

**Remark**

**2.**

**Hypothesis**

**1.**

**Hypothesis**

**2.**

**Corollary**

**6.**

**Remark**

**3.**

**Definition**

**5.**

**Remark**

**4.**

**Hypothesis**

**3.**

**Remark**

**5.**

#### 4.2.1. The Case of a Single Prover ${n}_{\mathrm{pr}}=1$

**Proposition**

**4.**

**Corollary**

**7.**

**Proof.**

**Example**

**2.**

- ${k}_{1}={2}^{h}-1$, ${k}_{2}={2}^{h+1}-1$$${h}^{\copyright}(1,{2}^{h}-1)=\left(h\right),\phantom{\rule{2.em}{0ex}}{h}^{\copyright}(1,{2}^{h+1}-1)=(h+1).$$
- ${k}_{1}={2}^{h}$, ${k}_{2}={2}^{h+1}-2$$${h}^{\copyright}(1,{2}^{h})=({h}^{\times ({2}^{h}-1)},h+1),\phantom{\rule{2.em}{0ex}}{h}^{\copyright}(1,{2}^{h+1}-2)=(h,{(h+1)}^{\times ({2}^{h}-1)}).$$
- ${k}_{1}={2}^{h}+1$, ${k}_{2}={2}^{h+1}-3$$${h}^{\copyright}(1,{2}^{h})+1=({h}^{\times ({2}^{h-1}-1)},h+1),\phantom{\rule{2.em}{0ex}}{h}^{\copyright}(1,{2}^{h+1}-3)=(h,{(h+1)}^{\times ({2}^{h-1}-1})).$$
- ${k}_{1}={2}^{h}+2$, ${k}_{2}={2}^{h+1}-4$, if $h=3,5,7,\dots $$$\begin{array}{c}{h}^{\copyright}(1,{2}^{h}+2)=\left({h}^{\times \frac{{2}^{h}-2}{3}},h+1,{h}^{\times \frac{{2}^{h}-2}{3}},h+1,{h}^{\times \frac{{2}^{h}-5}{3}},h+1\right),\\ {h}^{\copyright}(1,{2}^{h+1}-4)=\left(h,{(h+1)}^{\times \frac{{2}^{h}-5}{3}},h,{(h+1)}^{\times \frac{{2}^{h}-2}{3}},h,{(h+1)}^{\times \frac{{2}^{h}-2}{3}}\right),\end{array}$$if $h=4,6,8,\dots $$$\begin{array}{c}{h}^{\copyright}(1,{2}^{h}+2)=\left({h}^{\times \frac{{2}^{h}-1}{3}},h+1,{h}^{\times \frac{{2}^{h}-4}{3}},h+1,{h}^{\times \frac{{2}^{h}-4}{3}},h+1\right),\\ {h}^{\copyright}(1,{2}^{h+1}-4)=\left(h,{(h+1)}^{\times \frac{{2}^{h}-4}{3}},h,{(h+1)}^{\times \frac{{2}^{h}-4}{3}},h,{(h+1)}^{\times \frac{{2}^{h}-1}{3}}\right).\end{array}$$

#### 4.2.2. The Case of a Single Step ${n}_{\mathrm{st}}=1$

**Hypothesis**

**4.**

**Example**

**3.**

- ${k}_{1}={2}^{h}-1$, ${k}_{2}={2}^{h+1}-1$$${h}^{\copyright}({2}^{h}-1,1)=1,2,\dots ,h-1,\left(h\right),\phantom{\rule{2.em}{0ex}}{h}^{\copyright}({2}^{h+1}-1,1)=1,2,\dots ,h,(h+1);$$
- ${k}_{1}={2}^{h}$, ${k}_{2}={2}^{h+1}-2$$${h}^{\copyright}({2}^{h},1)=1,2,\dots ,h-1,{h}^{\times ({2}^{h}-h)},({h}^{\times ({2}^{h}-1)},h+1),$$$${h}^{\copyright}({2}^{\times (h+1)}-2,1)=1,2,\dots ,h,(h,{(h+1)}^{\times ({2}^{h}-1)});$$
- ${k}_{1}={2}^{h}$, ${k}_{2}={2}^{h+1}-2$, $h\u2a7e3$$${h}^{\copyright}({2}^{h}+1,1)=1,2,\dots ,h-1,{h}^{\times \left({2}^{h-1}-\u230a\frac{h-1}{2}\u230b\right)},({h}^{\times ({2}^{h-1}-1)},h+1),$$$${h}^{\copyright}({2}^{h+1}-3,1)=1,2,\dots ,h,(h,{(h+1)}^{\times ({2}^{h-1}-1)}).$$

## 5. Stochastic Case

#### 5.1. Occupancy Distribution: Efficiency

**Notation**

**3.**

- $\left\{\genfrac{}{}{0.0pt}{}{n}{m}\right\}$ is the Stirling number of the second kind, i.e., the number of factorizations of an n-element set to an m-element factor-set;
- ${\left(n\right)}_{k}=n(n-1)\cdots (n-k+1)$ is the falling factorial.

- proof generation efficiency$$Ef({n}_{\mathrm{pr}},{n}_{\mathrm{pos}}):=E\frac{{N}_{\mathrm{int}}}{{n}_{\mathrm{bl}}{n}_{\mathrm{st}}{n}_{\mathrm{pr}}}=E\frac{{\xi}^{{n}_{\mathrm{pr}}{n}_{\mathrm{pos}}}}{{n}_{\mathrm{pr}}}=\frac{{n}_{\mathrm{pos}}}{{n}_{\mathrm{pr}}}\left(1-{\left(1-1/{n}_{\mathrm{pos}}\right)}^{{n}_{\mathrm{pr}}}\right),$$
- proof publishing efficiency$${Ef}^{\copyright}({n}_{\mathrm{bl}},{n}_{\mathrm{st}},{n}_{\mathrm{pr}},{n}_{\mathrm{pos}}):=E\frac{{N}_{\mathrm{int}}^{\copyright}}{{n}_{\mathrm{bl}}{n}_{\mathrm{st}}{n}_{\mathrm{pr}}}.$$

#### 5.2. Simulation Model for Block Publishing Efficiencies

**Proposition**

**5.**

**Hypothesis**

**5.**

#### 5.3. Simulation Model for Heights of Strict Binary Trees

## 6. Discussion

## 7. Conclusions

- The buffer size is smaller;
- Block publishing efficiency is higher;
- The average height of the generated perfect binary trees is proportional to $log\left({n}_{\mathrm{st}}{n}_{\mathrm{pr}}\right)=log{n}_{\mathrm{st}}+log{n}_{\mathrm{pr}}$. The average height of the generated strict binary trees has a similar linear dependence on the logarithm of the number of provers $log{n}_{\mathrm{pr}}$, but a different linear dependence to the number of steps ${n}_{\mathrm{st}}$ (not $log{n}_{\mathrm{st}}$). So, we can consider the case of strict binary trees practically interesting only if the number of steps ${n}_{\mathrm{st}}$ is small.

## Author Contributions

## Funding

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## Abbreviations

zk-SNARK | Zero-Knowledge Succinct Non-Interactive Argument of Knowledge |

SC | Sidechain |

MC | Mainchain |

PoW | Proof of work |

PoS | Proof of stake |

iff | if and only if |

PRO | product category |

## Appendix A. Monoid from Operad

**Definition**

**A1.**

- for all positive integers $n,{m}_{1},\dots ,{m}_{n}$, a composition function$$\begin{array}{cc}\hfill {\gamma}_{n;{m}_{1},\dots ,{m}_{n}}:P\left(n\right)\times P\left({m}_{1}\right)\times \cdots \times P\left({m}_{n}\right)& \to P({m}_{1}+\cdots +{m}_{n})\hfill \\ \hfill (\theta ,{\theta}_{1},\dots ,{\theta}_{n})& \mapsto \theta \circ ({\theta}_{1},\dots ,{\theta}_{n}),\hfill \end{array}$$
- an element $1\in P\left(1\right)$ called the identity,

**Example**

**A1.**

## Appendix B. Software Implementation

- >ProofStream 1 0 ${n}_{\mathrm{bl}}$${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$In the case ${b}_{\mathrm{shape}}$ is strict is the most simple. The corresponding calculations helped to formulate the results from Section 4.1 which all then was proved.
- >ProofStream 1 1 ${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$In the case ${b}_{\mathrm{shape}}$ is perfect the output is the complete description of ultimately periodic sequences of buffer states and heights of published trees for special values of number of steps ${n}_{\mathrm{st}}$ and number of provers ${n}_{\mathrm{pr}}$. Hypothesis 1–4 are based on numerous computation.

- >ProofStream 0 0 ${n}_{\mathrm{bl}}$${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$${n}_{\mathrm{pos}}$
- >ProofStream 0 1 ${n}_{\mathrm{bl}}$${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$${n}_{\mathrm{pos}}$

- >ProofStream 0 0 ${n}_{\mathrm{simulations}}$${n}_{\mathrm{bl}}$${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$min max increment
- >ProofStream 0 1 ${n}_{\mathrm{simulations}}$${n}_{\mathrm{bl}}$${n}_{\mathrm{st}}$${n}_{\mathrm{pr}}$min max increment

## References

- Back, A.; Corallo, M.; Dashjr, L.; Friedenbach, M.; Maxwell, G.; Miller, A.; Poelstra, A.; Timón, J.; Wuille, P. Enabling Blockchain Innovations with Pegged Sidechains. 2014. Available online: https://blockstream.com/sidechains.pdf (accessed on 27 February 2023).
- Gaži, P.; Kiayias, A.; Zindros, D. Proof-of-work sidechains. In Proceedings of the 2019 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 19–23 May 2019; pp. 139–156. [Google Scholar] [CrossRef] [Green Version]
- Garoffolo, A.; Kaidalov, D.; Oliynykov, R. Zendoo: A zk-SNARK Verifiable Cross-Chain Transfer Protocol Enabling Decoupled and Decentralized Sidechains. In Proceedings of the 2020 IEEE 40th International Conference on Distributed Computing Systems (ICDCS), Singapore, 29 November–1 December 2020; pp. 1257–1262. [Google Scholar] [CrossRef]
- Garoffolo, A.; Viglione, R. Sidechains: Decoupled Consensus Between Chains. arXiv
**2018**, arXiv:1812.05441. [Google Scholar] [CrossRef] - Garay, J.; Kiayias, A.; Leonardos, N. The bitcoin backbone protocol: Analysis and applications. In Advances in Cryptology—EUROCRYPT 2015, Part II; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2015; Volume 9057, pp. 281–310. [Google Scholar] [CrossRef]
- Ben-Sasson, E.; Chiesa, A.; Tromer, E.; Virza, M. Succinct Non-Interactive Zero Knowledge for a von Neumann architecture. In Proceedings of the 2014 23rd USENIX Conference on Security Symposium—SEC’14, San Diego, CA, USA, 20–22 August 2014; pp. 781–796. Available online: https://dl.acm.org/doi/abs/10.5555/2671225.2671275 (accessed on 27 February 2023).
- Bowe, S.; Gabizon, A. Making Groth’s zk-SNARK Simulation Extractable in the Random Oracle Model. 2018. Available online: https://ia.cr/2018/187 (accessed on 27 February 2023).
- Bonneau, J.; Meckler, I.; Rao, V.; Shapiro, E. Coda: Decentralized Cryptocurrency at Scale. Cryptology ePrint Archive, Report 2020/352. 2020. Available online: https://ia.cr/2020/352 (accessed on 27 February 2023).
- Matter Labs. zkSync Era Basics. 2023. Available online: https://era.zksync.io/docs/dev/fundamentals/zkSync.html (accessed on 27 February 2023).
- Ochôa, I.S.; Silva, L.A.; de Mello, G.; Garcia, N.M.; de Paz Santana, J.F.; Leithardt, V.R.Q. A Cost Analysis of Implementing a Blockchain Architecture in a Smart Grid Scenario Using Sidechains. Sensors
**2020**, 20, 843. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Zhou, J.; Wang, N.; Liu, A.; Wang, W.; Du, X. CBCS: A Scalable Consortium Blockchain Architecture Based on World State Collaborative Storage. Electronics
**2023**, 12, 735. [Google Scholar] [CrossRef] - Lee, N.Y. Hierarchical Multi-Blockchain System for Parallel Computation in Cryptocurrency Transfers and Smart Contracts. Appl. Sci.
**2021**, 11, 10173. [Google Scholar] [CrossRef] - Garoffolo, A.; Kaidalov, D.; Oliynykov, R. Trustless Cross-chain Communication for Zendoo Sidechains. Cryptology ePrint Archive, Report 2022/1179. 2022. Available online: https://ia.cr/2022/1179 (accessed on 27 February 2023).
- Kiayias, A.; Zindros, D. Proof-of-Work Sidechains. Cryptology ePrint Archive, Report 2018/1048. 2018. Available online: https://ia.cr/2018/1048 (accessed on 27 February 2023).
- Gaži, P.; Kiayias, A.; Zindros, D. Proof-of-Stake Sidechains. Cryptology ePrint Archive, Report 2018/1239. 2018. Available online: https://ia.cr/2018/1239 (accessed on 27 February 2023).
- Kiayias, A.; Russell, A.; David, B.; Oliynykov, R. Ouroboros: A provably secure proof-of-stake blockchain protocol. In CRYPTO 2017, Part I; Lecture Notes in Computer Science; Springer: Heidelberg, Germany, 2017; Volume 10401, pp. 357–388. [Google Scholar] [CrossRef]
- Eagen, L. μCash: Transparent Anonymous Transactions. Cryptology ePrint Archive, Report 2022/1104. 2022. Available online: https://ia.cr/2022/1104 (accessed on 27 February 2023).
- Bespalov, Y.; Garoffolo, A.; Kovalchuk, L.; Nelasa, H.; Oliynykov, R. Probability Models of Distributed Proof Generation for zk-SNARK-Based Blockchains. Mathematics
**2021**, 9, 3016. [Google Scholar] [CrossRef] - Bespalov, Y.; Garoffolo, A.; Kovalchuk, L.; Nelasa, H.; Oliynykov, R. Game-Theoretic View on Decentralized Proof Generation in zk-SNARK Based Sidechains. In CEUR Workshop Proceedings, Cybersecurity Providing in Information and Telecommunication Systems (CPITS 2021), Kyiv, Ukraine, 28 January 2021; RWTH Aachen University: Aachen, Germany, 2021; Volume 2923, pp. 47–59. Available online: http://ceur-ws.org/Vol-2923/ (accessed on 27 February 2023).
- Bespalov, Y.; Kovalchuk, L.; Nelasa, H.; Oliynykov, R.; Garoffolo, A. Game theory analysis of incentive distribution for prompt generation of the proof tree in zk-SNARK based sidechains. In Proceedings of the 2022 IEEE International Carnahan Conference on Security Technology (ICCST), Valec u Hrotovic, Czech Republic, 7–9 September 2022; pp. 1–7. [Google Scholar] [CrossRef]
- Bonneau, J.; Meckler, I.; Rao, V.; Shapiro, E. Mina: Decentralized Cryptocurrency at Scale. 2020. Available online: https://minaprotocol.com/wp-content/uploads/technicalWhitepaper.pdf (accessed on 27 February 2023).
- Cioabă, S.M.; Murty, M.R. A First Course in Graph Theory and Combinatorics; Texts and Readings in Mathematics 55; Cambridge University Press: Cambridge, UK, 2022. [Google Scholar] [CrossRef]
- Bourbaki, N. Algebra I. Chapters 1–3; Springer: Berlin/Heidelberg, Germany, 1998. [Google Scholar]
- Reutenauer, C. Free Lie Algebras; London Mathematical Society Monographs New Series 7; Clarendon Press; Oxford University Press: Oxford, UK, 1993. [Google Scholar]
- Stanley, R.P. Catalan Numbers; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar] [CrossRef]
- Johnson, N.L.; Kotz, S. Urn Models and Their Applications; John Wiley and Sons: New York, NY, USA, 1977. [Google Scholar]
- O’Neill, B. The Classical Occupancy Distribution: Computation and Approximation. Am. Stat.
**2021**, 75, 364–375. [Google Scholar] [CrossRef] - Kanani, J.; Nailwal, S.; Arjun, A. Matic Whitepaper. 2020. Available online: https://github.com/maticnetwork/whitepaper (accessed on 27 February 2023).
- Kuszmaul, J. Verkle Trees. In Proceedings of the Eighth Annual PRIMES Conference, 19–20 May 2018; Available online: https://math.mit.edu/research/highschool/primes/materials/2018/Kuszmaul.pdf (accessed on 27 February 2023).
- Campanelli, M.; Hall-Andersen, M.; Kamp, S.H. Curve Trees: Practical and Transparent Zero-Knowledge Accumulators. Cryptology ePrint Archive, Report 2022/756. 2022. Available online: https://ia.cr/2022/756 (accessed on 27 February 2023).
- Mac Lane, S. Categories for the Working Mathematician, 2nd ed.; Graduate Texts in Mathematics 5; Springer: Berlin/Heidelberg, Germany, 1998. [Google Scholar]
- Awodey, S. Category Theory, 2nd ed.; Oxforg Logic Guides 52; Oxford University Press: Oxford, UK, 2010. [Google Scholar]
- Leinster, T. Basic Category Theory; Cambridge Studies in Advanced Mathematics 143; Cambridge University Press: Cambridge, UK, 2014. [Google Scholar]
- Markl, M.; Shnider, S.; Stasheff, J.D. Operads in Algebra, Topology and Physics; Mathematical Surveys and Monographs 96; AMS: Providence, RI, USA, 2002. [Google Scholar] [CrossRef] [Green Version]
- Méndez, M.A. Set Operads in Combinatorics and Computer Science; SpringerBriefs in Mathematics; Springer: Berlin/Heidelberg, Germany, 2015. [Google Scholar] [CrossRef]
- Spivak, D.I. Category Theory for the Sciences; MIT Press: Cambridge, MA, USA, 2014. [Google Scholar]

**Figure 1.**Images of the free magma: (

**a**) bracketing, (

**b**) non-strict binary tree, (

**c**) strict binary tree.

**Figure 4.**Dependencies of ${Ef}^{\copyright}$ on the number of blocks for ${n}_{\mathrm{st}}={n}_{\mathrm{pr}}={n}_{\mathrm{pos}}=5$.

Strict binary trees:merged positions are first pairs of subsequent trees | Perfect binary trees:merged positions are first so-called perfect pairs | |

Deterministic prover behavior:provers act mutually consistent, taking the first possible ${n}_{\mathrm{pr}}$ merge positions | ${b}_{\mathrm{behavior}}$ is deterministic ${b}_{\mathrm{shape}}$ is strict | ${b}_{\mathrm{behavior}}$ is deterministic ${b}_{\mathrm{shape}}$ is perfect |

Stochastic prover behavior:provers act independently, with each selecting one of ${n}_{\mathrm{pos}}$ merge positions | ${b}_{\mathrm{behavior}}$ is stochastic ${b}_{\mathrm{shape}}$ is strict | ${b}_{\mathrm{behavior}}$ is stochastic ${b}_{\mathrm{shape}}$ is perfect |

**Table 2.**ArgMax and Max of the function ${n}_{\mathrm{bl}}\mapsto {Ef}^{\copyright}$ for the case “${b}_{\mathrm{shape}}$ is perfect”.

n_{st}∖n_{pr} | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|

1 | 7 0.89 | 8 0.83 | 8 0.78 | 8 0.72 | 8 0.67 | 9 0.62 | 9 0.58 | 9 0.55 | 9 0.52 |

2 | 4 0.85 | 5 0.74 | 5 0.67 | 6 0.62 | 6 0.58 | 7 0.56 | 7 0.53 | 7 0.51 | 8 0.49 |

3 | 3 0.80 | 4 0.70 | 5 0.65 | 5 0.60 | 6 0.57 | 6 0.55 | 7 0.53 | 7 0.51 | 8 0.50 |

4 | 3 0.78 | 4 0.70 | 5 0.65 | 6 0.61 | 6 0.58 | 7 0.57 | 8 0.56 | 9 0.54 | 9 0.53 |

5 | 3 0.77 | 4 0.71 | 5 0.66 | 6 0.63 | 7 0.61 | 7 0.59 | 8 0.56 | 9 0.55 | 9 0.53 |

6 | 3 0.79 | 4 0.72 | 5 0.67 | 6 0.65 | 7 0.62 | 7 0.60 | 7 0.58 | 8 0.57 | 9 0.55 |

7 | 3 0.79 | 4 0.71 | 6 0.68 | 6 0.65 | 7 0.63 | 7 0.61 | 8 0.60 | 9 0.59 | 10 0.59 |

8 | 3 0.79 | 4 0.73 | 6 0.70 | 6 0.67 | 7 0.65 | 8 0.64 | 9 0.62 | 10 0.61 | 10 0.60 |

9 | 3 0.80 | 5 0.74 | 6 0.70 | 6 0.68 | 8 0.66 | 8 0.65 | 10 0.64 | 10 0.61 | 11 0.61 |

10 | 3 0.81 | 5 0.75 | 6 0.72 | 7 0.70 | 8 0.68 | 9 0.66 | 10 0.64 | 10 0.63 | 11 0.62 |

**Table 3.**ArgMax and Max of ${n}_{\mathrm{bl}}\mapsto {Ef}^{\copyright}$ for the case “${b}_{\mathrm{shape}}$ is strict”.

n_{st}∖n_{pr} | 2 | 3 | 4 | 5 |
---|---|---|---|---|

1 | 13/0.92 | 19/0.90 | 23–24/0.89 | 28–29/0.88 |

2 | 14/0.93 | 21–22/0.91 | 28/0.90 | 34–35/0.89 |

3 | 15/0.94 | 23–24/0.92 | 32/0.91 | 38–39/0.90 |

4 | 16/0.94 | 25–26/0.93 | 33–34/0.92 | 41–42/0.91 |

5 | 18/0.95 | 27–28/0.93 | 36–37/0.92 | 44–46/0.92 |

**Table 4.**Linear approximations of average height of generated trees as functions of ${n}_{\mathrm{st}}$ and ${log}_{2}{n}_{\mathrm{pr}}$.

m | $\mathit{\alpha}$ | $\mathit{\beta}$ | $\mathit{\gamma}$ | $\sqrt{\frac{2\mathit{r}}{\mathit{m}(\mathit{m}+1)}}$ |
---|---|---|---|---|

6 | 0.84 | 1.35 | −0.75 | 0.072 |

7 | 0.81 | 1.40 | −0.75 | 0.074 |

8 | 0.79 | 1.43 | −0.74 | 0.075 |

9 | 0.77 | 1.46 | −0.74 | 0.075 |

10 | 0.75 | 1.49 | −0.73 | 0.075 |

**Table 5.**Comparison of efficiencies for ${n}_{\mathrm{st}}=9$ steps and ${n}_{\mathrm{pos}}={n}_{\mathrm{pr}}$.

${\mathit{n}}_{\mathbf{pr}}$ | ℓ | ${\mathbf{Ef}}_{1}$ | ${\mathbf{Ef}}_{\mathbf{perfect}}^{\mathbf{\copyright}}$ | ${\mathbf{Ef}}_{\mathbf{perfect}}^{\mathbf{\copyright}}$ | ${\mathbf{Ef}}_{\mathbf{perfect}}^{\mathbf{\copyright}}$ | ${\mathbf{Ef}}_{\mathbf{strict}}^{\mathbf{\copyright}}$ | Ef |
---|---|---|---|---|---|---|---|

${\mathit{n}}_{\mathbf{bl}}=\mathbf{10}$ | ${\mathit{n}}_{\mathbf{bl}}=\mathbf{100}$ | ${\mathit{n}}_{\mathbf{bl}}={\mathbf{n}}_{\mathrm{pr}}$ | ${\mathit{n}}_{\mathbf{bl}}=\mathbf{10}$ | ||||

3 | 4 | 0.26 | 0.64 | 0.69 | 0.50 | 0.69 | 0.70 |

4 | 4 | 0.19 | 0.64 | 0.67 | 0.54 | 0.67 | 0.68 |

10 | 5 | 0.17 | 0.48 | 0.59 | 0.50 | 0.62 | 0.65 |

33 | 6 | 0.10 | 0.34 | 0.45 | 0.43 | 0.58 | 0.64 |

95 | 7 | 0.07 | 0.18 | 0.27 | 0.26 | 0.56 | 0.63 |

452 | 8 | 0.03 | 0.05 | 0.09 | 0.11 | 0.53 | 0.63 |

2176 | 9 | 0.01 | 0.02 | 0.03 | 0.04 | 0.50 | 0.63 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Bespalov, Y.; Kovalchuk, L.; Nelasa, H.; Oliynykov, R.; Viglione, R.
Models for Generation of Proof Forest in zk-SNARK Based Sidechains. *Cryptography* **2023**, *7*, 14.
https://doi.org/10.3390/cryptography7010014

**AMA Style**

Bespalov Y, Kovalchuk L, Nelasa H, Oliynykov R, Viglione R.
Models for Generation of Proof Forest in zk-SNARK Based Sidechains. *Cryptography*. 2023; 7(1):14.
https://doi.org/10.3390/cryptography7010014

**Chicago/Turabian Style**

Bespalov, Yuri, Lyudmila Kovalchuk, Hanna Nelasa, Roman Oliynykov, and Rob Viglione.
2023. "Models for Generation of Proof Forest in zk-SNARK Based Sidechains" *Cryptography* 7, no. 1: 14.
https://doi.org/10.3390/cryptography7010014