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