You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
6.5 KiB

  1. \documentclass{article}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage{amsfonts}
  4. \usepackage{amsthm}
  5. \usepackage{amsmath}
  6. \usepackage{enumerate}
  7. \usepackage{hyperref}
  8. \hypersetup{
  9. colorlinks,
  10. citecolor=black,
  11. filecolor=black,
  12. linkcolor=black,
  13. urlcolor=blue
  14. }
  15. % prevent warnings of underfull \hbox:
  16. \usepackage{etoolbox}
  17. \apptocmd{\sloppy}{\hbadness 4000\relax}{}{}
  18. \theoremstyle{definition}
  19. \newtheorem{definition}{Def}[section]
  20. \newtheorem{theorem}[definition]{Thm}
  21. \title{Paper notes}
  22. \author{arnaucube}
  23. \date{}
  24. \begin{document}
  25. \maketitle
  26. \begin{abstract}
  27. Notes taken while reading papers. Usually while reading papers I take handwritten notes, this document contains some of them re-written to $LaTeX$.
  28. The notes are not complete, don't include all the steps neither all the proofs.
  29. \end{abstract}
  30. \tableofcontents
  31. \section{SnarkPack}
  32. Notes taken while reading SnarkPack paper \cite{cryptoeprint:2021/529}.
  33. Groth16 proof aggregation.
  34. \begin{enumerate}[i.]
  35. \item Simple verification:\\
  36. Proof: $\pi_i = (A_i, B_i, C_i)$\\
  37. Verifier checks: $e(A_i, B_i) == e(C_i, D)$\\
  38. Where $D$ is the $CRS$.
  39. \item Batch verification:
  40. $r \in^\$ F_q$\\
  41. $r^i \cdot e(A_i, B_i) == e(C_i, D)$\\
  42. $\Longrightarrow \prod e(A_i, B_i)^{r^i} == \prod e(C_i, D)^{r^i}$\\
  43. $\Longrightarrow \prod e(A_i, B_i^{r^i}) == \prod e(C_i^{r^i}, D)$
  44. \item Snark Aggregation verification:\\
  45. $z_{AB} = \prod e(A_i, B_i^{r^i})$\\
  46. $z_C = \prod C_i^{r^i}$\\
  47. Verification: $z_{AB} == e(z_C, D)$
  48. \end{enumerate}
  49. \section{Sonic}
  50. Notes taken while reading Sonic paper \cite{cryptoeprint:2019/099}. Does not include all the steps, neither the proofs.
  51. \subsection{Structured Reference String}
  52. $\{ \{g^{x^i}\}_{i=-d}^d, \{ g^{\alpha x^i} \}_{i=-d, i \neq 0}^d, \{ h^{x^i}, h^{\alpha x^i} \}_{i=-d}^d, e(g, h^\alpha) \}$
  53. \subsection{System of constraints}
  54. Multiplication constraint: $a \cdot b = c$
  55. $Q$ linear constraints:
  56. $$
  57. a \cdot u_q + b \cdot v_q + c \cdot w_q = k_q
  58. $$
  59. with $u_q, v_q, w_q \in \mathbb{F}^n$, and $k_q \in \mathbb{F}_p$.
  60. \vspace{0.5cm}
  61. Example: $x^2 + y^2 = z$
  62. $$a = (x, y), \qquad b = (x, y), \qquad c = (x^2, y^2)$$
  63. \begin{enumerate}[i.]
  64. \item $(x, y) \cdot (1, 0) + (x, y) \cdot (-1, 0) + (x^2, y^2) \cdot (0, 0) = 0 \longrightarrow x - x = 0$
  65. \item $(x, y) \cdot (0, 1) + (x, y) \cdot (0, -1) + (x^2, y^2) \cdot (0, 0) = 0 \longrightarrow y - y = 0$
  66. \item $(x, y) \cdot (0, 0) + (x, y) \cdot (0, 0) + (x^2, y^2) \cdot (1, 1) = z \longrightarrow x^2 + y^2 = z$
  67. \end{enumerate}
  68. So,
  69. $$u_1 = (1, 0) \quad v_1=(-1, 0) \quad w_1=(0, 0) \quad k_1=0$$
  70. $$u_2 = (0, 1) \quad v_2=(0, -1) \quad w_2=(0, 0) \quad k_2=0$$
  71. $$u_3 = (0, 0) \quad v_3=(0, 0) \quad w_3=(1, 1) \quad k_2=z$$
  72. \vspace{1cm}
  73. Compress n multiplication constraints into an equation in formal indeterminate $Y$:
  74. $$\sum_{i=1}^n (a_i b_i - c_i) \cdot Y^i = 0$$
  75. encode into negative exponents of $Y$:
  76. $$\sum_{i=1}^n (a_i b_i - c_i) \cdot Y^-i = 0$$
  77. Also, compress the $Q$ linear constraints, scaling by $Y^n$ to preserve linear independence:
  78. $$
  79. \sum_{q=1}^Q (a \cdot u_q + b \cdot v_q + c \cdot w_q - k_q) \cdot Y^{q+n} = 0
  80. $$
  81. Polys:
  82. \begin{align}
  83. \nonumber & u_i(Y) = \sum_{q=1}^Q Y^{q+n} \cdot u_{q, i}\\
  84. \nonumber & v_i(Y) = \sum_{q=1}^Q Y^{q+n} \cdot v_{q, i}\\
  85. \nonumber & w_i(Y) = -Y^i - Y^{-1} + \sum_{q=1}^Q Y^{q+n} \cdot w_{q, i}\\
  86. \nonumber & k(Y) = \sum_{q=1}^Q Y^{q+n} \cdot k_q
  87. \end{align}
  88. Combine the multiplicative and linear constraints to:
  89. \begin{align}
  90. \nonumber & a \cdot u(Y) + b \cdot v(Y) + c \cdot w(Y)
  91. + \sum_{i=1}^n a_i b_i (Y^i + Y^{-i}) - k(Y) = 0
  92. \end{align}
  93. where $a \cdot u(Y) + b \cdot v(Y) + c \cdot w(Y)$ is embeded into the constant term of the polynomial $t(X, Y)$.
  94. Define $r(X, Y)$ s.t. $r(X, Y) = r(XY, 1)$.
  95. $$\Longrightarrow r(X, Y) = \sum_{i=1}^n (a_i X^i Y^i + b_i X^{-i} Y^{-i} + c_i X^{-i-n} Y^{-i-n})$$
  96. $$s(X, Y) = \sum_{i=1}^n (u_i(Y) X^{-i} + v_i(Y) X^i + w_i(Y) X^{i+n})$$
  97. $$r'(X, Y) = r(X, Y) + s(X, Y)$$
  98. $$t(X, Y) = r(X, Y) + r'(X, Y) - k(Y)$$
  99. The coefficient of $X^0$ in $t(X, Y)$ is the left-hand side of the equation.
  100. Sonic demonstrates that the constant term of $t(X, Y)$ is zero, thus demonstrating that our constraint system is satisfied.
  101. \subsubsection{The basic Sonic protocol}
  102. \begin{enumerate}[1.]
  103. \item Prover constructs $r(X, Y)$ using their hidden witness
  104. \item Prover commits to $r(X, 1)$, setting the maximum degree to n
  105. \item Verifier sends random challenge $y$
  106. \item Prover commits to $t(X, y)$. The commitment scheme ensures that $t(X, y)$ has no constant term.
  107. \item Verifier sends random challenge $z$
  108. \item Prover opens commitments to $r(z, 1), r(z, y), t(z, y)$
  109. \item Verifier calculates $r'(z, y)$, and checks that
  110. $$r(z, y) \cdot r'(z, y) - k(y) == t(z, y)$$
  111. \end{enumerate}
  112. Steps $3$ and $5$ can be made non-interactive by the Fiat-Shamir transformation.
  113. \subsubsection{Polynomial Commitment Scheme}
  114. Sonic uses an adaptation of KZG \cite{kzg-tmp}, want:
  115. \begin{enumerate}[i.]
  116. \item \emph{evaluation binding}, i.e. given a commitment $F$, an adversary cannot open F to two different evaluations $v_1$ and $v_2$
  117. \item \emph{bounded polynomial extractable}, i.e. any algebraic adversary that opens a commitment $F$ knows an opening $f(X)$ with powers $-d \leq i \leq max, i \neq 0$.
  118. \end{enumerate}
  119. \vspace{0.5cm}
  120. PC scheme (adaptation of KZG):
  121. \begin{enumerate}[i.]
  122. \item Commit(info, $f(X)$) $\longrightarrow F$:
  123. $$F = g^{\alpha \cdot x^{d-max}} \cdot f(x)$$
  124. \item Open(info, $F$, $z$, $f(x)$) $\longrightarrow (f(z), W)$:
  125. $$w(X) = \frac{f(X) - f(z)}{X-z}$$
  126. $$W = g^{w(x)}$$
  127. \item Verify(info, $F$, $z$, $(v, W)$) $\longrightarrow 0/1$:\\
  128. Check:
  129. $$e(W, h^{\alpha \cdot x}) \cdot
  130. e(g^v W^{-z}, h^{\alpha})
  131. == e(F, h^{x^{-d+max}})$$
  132. \end{enumerate}
  133. \subsection{Succint signatures of correct computation}
  134. Signature of correct computation to ensure that an element $s=s(z, y)$ for a known polynomial
  135. $$s(X, Y) = \sum_{i, j = -d}^d s_{i, j} \cdot X^i \cdot Y^i$$
  136. Use the structure of $s(X, Y)$ to prove its correct calculation using a \emph{permutation argument} $\longrightarrow$ \emph{grand-product argument} inspired by Bayer and Groth, and Bootle et al.
  137. Restrict to constraint systems where $s(X, Y)$ can be expressed as the sum of $M$ polynomials. Where $j-th$ poly is of the form:
  138. $$
  139. \Psi_j(X, Y) =
  140. \sum_{i=1}^n \psi_{j, \sigma_{j, i}}
  141. \cdot X^i \cdot Y^{\sigma_{j, i}}
  142. $$
  143. where $\sigma_j$ is the fixed polynomial permutation, and $\phi_{j, i} \in \mathbb{F}$ are the coefficients.
  144. \vspace{1cm}
  145. \framebox{WIP}
  146. \vspace{1cm}
  147. \bibliography{paper-notes.bib}
  148. \bibliographystyle{unsrt}
  149. \end{document}