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.

140 lines
5.3 KiB

  1. \documentclass{article}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage{amsfonts}
  4. \usepackage{amsthm}
  5. \usepackage{amsmath}
  6. \usepackage{mathtools}
  7. \usepackage{enumerate}
  8. \usepackage{hyperref}
  9. \usepackage{xcolor}
  10. \usepackage{pgf-umlsd} % diagrams
  11. \usepackage{centernot}
  12. % prevent warnings of underfull \hbox:
  13. \usepackage{etoolbox}
  14. \apptocmd{\sloppy}{\hbadness 4000\relax}{}{}
  15. \theoremstyle{definition}
  16. \newtheorem{definition}{Def}[section]
  17. \newtheorem{theorem}[definition]{Thm}
  18. % custom lemma environment to set custom numbers
  19. \newtheorem{innerlemma}{Lemma}
  20. \newenvironment{lemma}[1]
  21. {\renewcommand\theinnerlemma{#1}\innerlemma}
  22. {\endinnerlemma}
  23. \title{Notes on HyperNova}
  24. \author{arnaucube}
  25. \date{May 2023}
  26. \begin{document}
  27. \maketitle
  28. \begin{abstract}
  29. Notes taken while reading about Spartan \cite{cryptoeprint:2023/573}, \cite{cryptoeprint:2023/552}.
  30. Usually while reading papers I take handwritten notes, this document contains some of them re-written to $LaTeX$.
  31. The notes are not complete, don't include all the steps neither all the proofs.
  32. \end{abstract}
  33. \tableofcontents
  34. \section{CCS}
  35. \subsection{R1CS to CCS overview}
  36. \begin{itemize}
  37. \item[] R1CS instance: $S_{R1CS} = (m, n, N, l, A, B, C)$
  38. \item[] CCS instance: $S_{CCS} = (m, n, N, l, t, q, d, M, S, c)$
  39. \item[] R1CS-to-CCS parameters:\\
  40. $n=n,~ m=m,~ N=N,~ l=l,~ t=3,~ q=2,~ d=2$\\
  41. $M=\{A,B,C\}$, $S=\{\{0,~1\},~ \{2\}\}$, $c=\{1,-1\}$
  42. \end{itemize}
  43. Then, we can see that the CCS relation:
  44. $$\sum_{i=0}^{q-1} c_i \cdot \bigcirc_{j \in S_i} M_j \cdot z ==0$$
  45. where $z=(w, 1, x) \in \mathbb{F}^n$.
  46. In our R1CS-to-CCS parameters is equivalent to
  47. \begin{align*}
  48. &c_0 \cdot ( (M_0 z) \circ (M_1 z) ) + c_1 \cdot (M_2 z) ==0\\
  49. \Longrightarrow &1 \cdot ( (A z) \circ (B z) ) + (-1) \cdot (C z) ==0\\
  50. \Longrightarrow &( (A z) \circ (B z) ) - (C z) ==0
  51. \end{align*}
  52. which is equivalent to the R1CS relation: $Az \circ Bz == Cz$
  53. An example of the conversion from R1CS to CCS implemented in SageMath can be found at\\
  54. \href{https://github.com/arnaucube/math/blob/master/r1cs-ccs.sage}{https://github.com/arnaucube/math/blob/master/r1cs-ccs.sage}.
  55. \subsection{Committed CCS}
  56. $R_{CCCS}$ instance: $(C, \mathsf{x})$, where $C$ is a commitment to a multilinear polynomial in $s'-1$ variables.
  57. Sat if:
  58. \begin{enumerate}[i.]
  59. \item $\text{Commit}(pp, \widetilde{w}) = C$
  60. \item $\sum_{i=1}^q c_i \cdot \left( \prod_{j \in S_i} \left( \sum_{y \in \{0,1\}^{\log m}} \widetilde{M}_j(x, y) \cdot \widetilde{z}(y) \right) \right)$\\
  61. where $\widetilde{z}(y) = \widetilde{(w, 1, \mathsf{x})}(x) ~\forall x \in \{0, 1\}^{s'}$
  62. \end{enumerate}
  63. \subsection{Linearized Committed CCS}
  64. $R_{LCCCS}$ instance: $(C, u, \mathsf{x}, r, v_1, \ldots, v_t)$, where $C$ is a commitment to a multilinear polynomial in $s'-1$ variables, and $u \in \mathbb{F},~ \mathsf{x} \in \mathbb{F}^l,~ r \in \mathbb{F}^s,~ v_i \in \mathbb{F} ~\forall i \in [t]$.
  65. Sat if:
  66. \begin{enumerate}[i.]
  67. \item $\text{Commit}(pp, \widetilde{w}) = C$
  68. \item $\forall i \in [t],~ v_i = \sum_{y \in \{0,1\}^{s'}} \widetilde{M}_i(r, y) \cdot \widetilde{z}(y)$\\
  69. where $\widetilde{z}(y) = \widetilde{(w, u, \mathsf{x})}(x) ~\forall x \in \{0, 1\}^{s'}$
  70. \end{enumerate}
  71. \section{Multifolding Scheme for CCS}
  72. Recall sum-check protocol:\\
  73. \underline{$C \leftarrow <P, V(r)>(g, l, d, T)$}:\\ % TODO use proper <, >
  74. $T=\sum_{x_1 \in \{0,1\}} \sum_{x_2 \in \{0,1\}} \cdots \sum_{x_l \in \{0,1\}} g(x_1, x_2, \ldots, x_l)$
  75. $l$-variate polynomial g, degree $\leq d$ in each variable.
  76. let $s= \log m,~ s'= \log n$.
  77. \begin{enumerate}
  78. \item $V \rightarrow P: \gamma \in^R \mathbb{F},~ \beta \in^R \mathbb{F}^s$
  79. \item $V: r_x' \in^R \mathbb{F}^s$
  80. \item $V \leftrightarrow P$: sum-check protocol:\\
  81. $$c \leftarrow <P, V(r_x')>(g, s, d+1, \sum_{j \in [t]} \gamma^j \cdot v_j)$$
  82. where:\\
  83. \begin{align*}
  84. g(x) &:= \left( \sum_{j \in [t]} \gamma^j \cdot L_j(x) \right) + \gamma^{t+1} \cdot Q(x)\\
  85. L_j(x) &:= \widetilde{eq}(r_x, x) \cdot \left( \sum_{y \in \{0,1\}^{s'}} \widetilde{M}_j(x, y) \cdot \widetilde{z}_1(y) \right)\\
  86. Q(x) &:= \widetilde{eq}(\beta, x) \cdot \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} \left( \sum_{y \in \{0, 1\}^{s'}} \widetilde{M}_j(x, y) \cdot \widetilde{z}_2(y) \right) \right)
  87. \end{align*}
  88. \item $P \rightarrow V$: $\left( (\sigma_1, \ldots, \sigma_t), (\theta_1, \ldots, \theta_t) \right)$
  89. where
  90. $$\sigma_j = \sum_{y \in \{0,1\}^{s'}} \widetilde{M}_j(x, y) \cdot \widetilde{z}_1(y)$$
  91. $$\theta_j = \sum_{y \in \{0, 1\}^{s'}} \widetilde{M}_j(x, y) \cdot \widetilde{z}_2(y)$$
  92. \item V: $e_1 \leftarrow \widetilde{eq}(r_x, r_x')$, $e_2 \leftarrow \widetilde{eq}(\beta, r_x')$\\
  93. check:
  94. $$c = \left( \sum_{j \in [t]} \gamma^j e_1 \sigma_j + \gamma^{t+1} e_2 \left( \sum_{i=1}^q c_i \cdot \prod_{j \in S_i} \sigma \right) \right)$$
  95. \item $V \rightarrow P: \rho \in^R \mathbb{F}$
  96. \item $V, P$: output the folded LCCCS instance $(C', u', \mathsf{x}', r_x', v_1', \ldots, v_t')$, where $\forall i \in [t]$:
  97. \begin{align*}
  98. C' &\leftarrow C_1 + \rho \cdot C_2\\
  99. u' &\leftarrow u + \rho \cdot 1\\
  100. \mathsf{x}' &\leftarrow \mathsf{x}_1 + \rho \cdot \mathsf{x}_2\\
  101. v_i' &\leftarrow \sigma_i + \rho \cdot \theta_i
  102. \end{align*}
  103. \item $P$: output folded witness: $\widetilde{w}' \leftarrow \widetilde{w}_1 + \rho \cdot \widetilde{w}_2$.
  104. \end{enumerate}
  105. \bibliography{paper-notes.bib}
  106. \bibliographystyle{unsrt}
  107. \end{document}