arnaucube
arnaucube/mathPublic Self-hosted repository
math/notes_sonic.tex
notes_sonic.texRaw
  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\usepackage{xcolor}
 16
 17% prevent warnings of underfull \hbox:
 18\usepackage{etoolbox}
 19\apptocmd{\sloppy}{\hbadness 4000\relax}{}{}
 20
 21\theoremstyle{definition}
 22\newtheorem{definition}{Def}[section]
 23\newtheorem{theorem}[definition]{Thm}
 24
 25
 26\title{Notes on Sonic}
 27\author{arnaucube}
 28\date{April 2022}
 29
 30\begin{document}
 31
 32\maketitle
 33
 34\begin{abstract}
 35	Notes taken while reading Sonic paper \cite{cryptoeprint:2019/099}. Usually while reading papers I take handwritten notes, this document contains some of them re-written to $LaTeX$.
 36
 37	The notes are not complete, don't include all the steps neither all the proofs.
 38\end{abstract}
 39
 40\tableofcontents
 41
 42
 43\section{Sonic}
 44
 45\subsection{Structured Reference String}
 46$\{ \{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) \}$
 47
 48\subsection{System of constraints}
 49Multiplication constraint: $a \cdot b = c$
 50
 51$Q$ linear constraints:
 52$$
 53a \cdot u_q + b \cdot v_q + c \cdot w_q = k_q
 54$$
 55
 56with $u_q, v_q, w_q \in \mathbb{F}^n$, and $k_q \in \mathbb{F}_p$.
 57
 58\vspace{0.5cm}
 59Example: $x^2 + y^2 = z$
 60
 61$$a = (x, y), \qquad b = (x, y), \qquad c = (x^2, y^2)$$
 62\begin{enumerate}[i.]
 63    \item $(x, y) \cdot (1, 0) + (x, y) \cdot (-1, 0) + (x^2, y^2) \cdot (0, 0) = 0 \longrightarrow x - x = 0$
 64    \item $(x, y) \cdot (0, 1) + (x, y) \cdot (0, -1) + (x^2, y^2) \cdot (0, 0) = 0 \longrightarrow y - y = 0$
 65    \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$
 66\end{enumerate}
 67
 68So,
 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
 73\vspace{1cm}
 74
 75Compress n multiplication constraints into an equation in formal indeterminate $Y$:
 76$$\sum_{i=1}^n (a_i b_i - c_i) \cdot Y^i = 0$$
 77encode into negative exponents of $Y$:
 78$$\sum_{i=1}^n (a_i b_i - c_i) \cdot Y^-i = 0$$
 79
 80Also, compress the $Q$ linear constraints, scaling by $Y^n$ to preserve linear independence:
 81$$
 82\sum_{q=1}^Q (a \cdot u_q + b \cdot v_q + c \cdot w_q - k_q) \cdot Y^{q+n} = 0
 83$$
 84
 85Polys:
 86
 87\begin{align}
 88\nonumber & u_i(Y) = \sum_{q=1}^Q Y^{q+n} \cdot u_{q, i}\\
 89\nonumber & v_i(Y) = \sum_{q=1}^Q Y^{q+n} \cdot v_{q, i}\\
 90\nonumber & w_i(Y) = -Y^i - Y^{-1} + \sum_{q=1}^Q Y^{q+n} \cdot w_{q, i}\\
 91\nonumber & k(Y) = \sum_{q=1}^Q Y^{q+n} \cdot k_q
 92\end{align}
 93
 94Combine the multiplicative and linear constraints to:
 95
 96\begin{align}
 97\nonumber & a \cdot u(Y) + b \cdot v(Y) + c \cdot w(Y)
 98+ \sum_{i=1}^n a_i b_i (Y^i + Y^{-i}) - k(Y) = 0
 99\end{align}
100
101where $a \cdot u(Y) + b \cdot v(Y) + c \cdot w(Y)$ is embedded into the constant term of the polynomial $t(X, Y)$.
102
103
104Define $r(X, Y)$ s.t. $r(X, Y) = r(XY, 1)$.
105
106$$\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})$$
107
108$$s(X, Y) = \sum_{i=1}^n (u_i(Y) X^{-i} + v_i(Y) X^i + w_i(Y) X^{i+n})$$
109
110$$r'(X, Y) = r(X, Y) + s(X, Y)$$
111$$t(X, Y) = r(X, Y) + r'(X, Y) - k(Y)$$
112
113The coefficient of $X^0$ in $t(X, Y)$ is the left-hand side of the equation.
114
115Sonic demonstrates that the constant term of $t(X, Y)$ is zero, thus demonstrating that our constraint system is satisfied.
116
117
118\subsubsection{The basic Sonic protocol}
119
120\begin{enumerate}[1.]
121    \item Prover constructs $r(X, Y)$ using their hidden witness
122    \item Prover commits to $r(X, 1)$, setting the maximum degree to n
123    \item Verifier sends random challenge $y$
124    \item Prover commits to $t(X, y)$. The commitment scheme ensures that $t(X, y)$ has no constant term.
125    \item Verifier sends random challenge $z$
126    \item Prover opens commitments to $r(z, 1), r(z, y), t(z, y)$
127    \item Verifier calculates $r'(z, y)$, and checks that
128	$$r(z, y) \cdot r'(z, y) - k(y) == t(z, y)$$
129\end{enumerate}
130
131Steps $3$ and $5$ can be made non-interactive by the Fiat-Shamir transformation.
132
133\subsubsection{Polynomial Commitment Scheme}
134Sonic uses an adaptation of KZG \cite{kzg-tmp}, want:
135
136\begin{enumerate}[i.]
137    \item \emph{evaluation binding}, i.e. given a commitment $F$, an adversary cannot open F to two different evaluations $v_1$ and $v_2$
138    \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$.
139\end{enumerate}
140
141\vspace{0.5cm}
142PC scheme (adaptation of KZG):
143
144\begin{enumerate}[i.]
145    \item Commit(info, $f(X)$) $\longrightarrow F$:
146	$$F = g^{\alpha \cdot x^{d-max}} \cdot f(x)$$
147    \item Open(info, $F$, $z$, $f(x)$) $\longrightarrow (f(z), W)$:
148	$$w(X) = \frac{f(X) - f(z)}{X-z}$$
149	$$W = g^{w(x)}$$
150    \item Verify(info, $F$, $z$, $(v, W)$) $\longrightarrow 0/1$:\\
151	Check:
152	$$e(W, h^{\alpha \cdot x}) \cdot
153	e(g^v W^{-z}, h^{\alpha})
154	== e(F, h^{x^{-d+max}})$$
155\end{enumerate}
156
157\subsection{Succinct signatures of correct computation}
158Signature of correct computation to ensure that an element $s=s(z, y)$ for a known polynomial
159$$s(X, Y) = \sum_{i, j = -d}^d s_{i, j} \cdot X^i \cdot Y^i$$
160
161Use 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.
162
163Restrict to constraint systems where $s(X, Y)$ can be expressed as the sum of $M$ polynomials. Where $j-th$ poly is of the form:
164$$
165\Psi_j(X, Y) =
166    \sum_{i=1}^n \psi_{j, \sigma_{j, i}}
167    \cdot X^i \cdot Y^{\sigma_{j, i}}
168$$
169
170where $\sigma_j$ is the fixed polynomial permutation, and $\phi_{j, i} \in \mathbb{F}$ are the coefficients.
171
172\vspace{1cm}
173\framebox{WIP}
174\vspace{1cm}
175
176
177
178\bibliography{paper-notes.bib}
179\bibliographystyle{unsrt}
180
181\end{document}