Skip to content

Commit 7ee9b4e

Browse files
📖 Update Math content (#34)
* reorganize note file structure * improve section: Introduction to Number Theory * small fix * fix starting new section from new page * improve 1-4 Abstract Algebra subsections * rewrite basic properties proofs, add new env for standard equation and multicols * add rule for exercises * hotfix * add more exercises * wipe off some exercises * separate book into logical part * rewrite Schwartz-Zippel Lemma * add intro word files for each parts * small improvements and preparations * add part1 intro sketch * improve notation * fix to improve ToC * prepare references structure * small improvements in part1 * add more exercises in section 1 * add exercises in section 2 * add exercises in section 3 + small fix * add exercises in section 10 * refactor ToC * refactor ToC (2) * fix 105x135 * add references to notation and security sections * add basic references to the 1, 2 parts * small preface update * fix independent pdf compilation for both versions + preface * update .gitignore * 🩹 apply numerous fixes * refactor custom env declaration * update equation to one style convention * 🩹 massive amount of changes * improve Number Theory section * improve Number Theory section * 🩹 fix number theory section spacing * improve Number Theory section (2) * improve Polynomials section (2) * 📝 update `README.md` file * 🏷️ fix title of `README.md` file * 🩹 fix table allignment in `README.md` file * improve Linear Algebra Basics section * improve Fields Extension section, end part 1 * hotfix ec section * hotfix commitments section * hotfix sigma, circuits, stark sections * update acknowledgements * hotfix exercises in sigma section * improve field extension section * refactor ec section exercises + hotfix * move sections, hotfix ec section * move sections, hotfix ec section * 🎨 add better book cover * 🩹 some new fixes --------- Co-authored-by: ZamDimon <zamdmytro@gmail.com>
1 parent 83005c6 commit 7ee9b4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5928
-3797
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ TSWLatexianTemp*
305305
# temp .pdf files
306306
/lectures/*.pdf
307307
/lectures-105-135/*.pdf
308+
/preface/*.pdf
308309

309310
exercises.pdf
310311
lecture-notes-148x210.pdf
311312
lecture-notes-105x135-nohead.pdf
313+
lecture-notes-105x135.pdf

README.md

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,69 @@
1-
# :teacher: ZKDL Camp Lecture Notes
2-
3-
This is a series of lectures on zero-knowledge conducted internally at Distributed Lab, in which we explained from scratch how SNARKs (Groth16, PLONK), STARKs, Bulletproofs (in the future, perhaps also Folding schemes) work.
4-
5-
It is important that this course is designed for a full low-level understanding of these protocols and, accordingly, all the mathematics on which the protocols are based. That is why the course covers both zk itself and its application, directly, but also the basic level of mathematics needed to understand zk and cryptography in general.
6-
7-
## :open_file_folder: Structure
1+
<div align="center">
2+
<h1> :ninja: ZKDL Camp Lecture Notes :teacher: </h1>
3+
</div>
4+
5+
This is a series of lectures on zero-knowledge conducted internally at
6+
Distributed Lab, in which we covered essentials for Research and Development
7+
in the field of zero-knowledge proofs and their applications.
8+
9+
Currently, the largest problem in zero-knowledge field is the diversity
10+
of learning material, which is oftentimes either:
11+
- Too high-level, focusing on the applications and not providing the necessary
12+
background in Mathematics and Cryptography.
13+
- Too low-level (such as Protocol papers), which are complete from the
14+
Mathematics and Cryptography standpoints, but are tremendously hard for
15+
practitioners to understand.
16+
- Low-level enough, but incomplete: sometimes, material explains all the
17+
constructions needed to understand a certain protocol, but does not summarize it
18+
into the complete algorithm which is ``implementable''.
19+
20+
## :books: What to expect?
21+
22+
- We dedicate a significant portion of the book to the **Mathematics**, which is
23+
the foundation of cryptography and zero-knowledge proofs: Number and Group
24+
Theory, Polynomials (Schwartz-Zippel Lemma, in particular), Finite Fields and
25+
Field Extensions.
26+
- Next, we move to the **Cryptographic Preliminaries**, consisting mainly of
27+
Elliptic Curve Theory: we cover the basics of operations over Elliptic Curves,
28+
Projective Coordinates, and ecpairing. We proceed to the Commitment Schemes
29+
and explain how to formulate security definitions in Cryptography.
30+
- The **Zero-Knowledge Proofs** section is the core of the book. We start with
31+
the basic definitions and classical ZK protocols and proceed to the modern
32+
constructions, currently consisting of Sigma Protocols, zk-SNARKs (R1CS, QAP,
33+
Pinocchio+Groth16, PlonKish Arithmetization), and basics of zk-STARKs. However,
34+
this is just a beginning: we will add more protocols such as Bulletproofs or
35+
Halo2 in the future.
36+
37+
## :open_file_folder: Structure of the repository
38+
39+
The book is fully open-source and all suggestions and contributions are very
40+
welcome! The repository is structured as follows:
841

942
| Folder/File | Description |
1043
| --- | --- |
11-
| [`lectures`](lectures) | Contains the written material for the lectures: both `.tex` and compiled `.pdf` files. If you want to add your lecture, you need to navigate to this folder. |
44+
| [`lectures`](lectures) | Contains the written material for the lectures in `.tex` format. If you want to add your lecture or make corrections to existing ones, you need to navigate to this folder. |
1245
| [`lectures/images`](lectures/images) | Contains images used in the lectures. |
13-
| [`presentations`](presentations) | Contains the beamer presentations for the lectures. |
14-
| [`zkdl-template.cls`](zkdl-template.cls) | The style file for the lectures. Do not touch unless needed. |
15-
| [`lecture-notes.tex`](lecture-notes.tex) | The compilation of all lectures. Uses lecture files from [`lectures`](lectures) and compiles them into a single file [`lecture-notes.pdf`](lecture-notes.pdf) |
16-
| [`topics.tex`](topics.tex) | The list of topics to be covered in the lectures. |
46+
| [`presentations`](presentations) | Contains the beamer presentations for the lectures being conducted at Distributed Lab. Typically, they contain the same material as the corresponding section in the book. However, you might find it easier to grasp the material from them. |
47+
| [`zkdl-template.cls`](zkdl-template.cls) | The style file for the book. |
48+
| [`lecture-notes-148x210.tex`](lecture-notes-148x210.tex) | The compilation of all lectures in the single file. Uses lecture files from [`lectures`](lectures) and compiles them into a single file. The latest version is then manually renamed to [`lts-notes-148x210.pdf`](lts-notes-148x210.pdf) |
49+
| [`lecture-notes-105x135.tex`](lecture-notes-105x135.tex) | Same as above, but the book is of different size. You may ignore this format since the main format is 148x210. |
50+
| [`sage`](sage) | Contains the SageMath code used in some lectures. For the most part, if the code is present, the separate repository is used, such as for [Sigma Proofs](https://github.com/ZKDL-Camp/lecture-7-sigma) |
1751

1852
## :running_man: Setup to run locally
1953

2054
1. Download LaTeX locally (e.g. [TeX Live](https://www.tug.org/texlive/), if you are using MacOS: [MacTex](https://www.tug.org/mactex/)).
2155
2. Download relevant VSCode extensions: LaTex, LaTex Workshop etc.
2256
3. Clone the repository.
23-
4. Open in VSCode and run the `lecture-notes.tex` file (green arrow at the top of the window).
57+
4. Open in VSCode and run the [`lecture-notes-148x210.tex`](./lecture-notes-148x210.tex) file (green arrow at the top of the window).
58+
5. You can also compile the lecture separately from the book by following the
59+
same procedure for the corresponding `.tex` file in the [`lectures`](lectures) folder.
60+
Note that compiled `.pdf` files are ignored by `.gitignore` and are not pushed to the repository (except for `lts-notes` files).
2461

2562
## :books: How to add your lecture?
2663

2764
1. Conduct the steps above and make sure you can compile everything locally.
28-
2. Create a new `.tex` file in the [`lectures`](lectures) folder. Name it `<number>-<topic>.tex`, where `<number>` is the next number in the sequence.
29-
3. Add lecture to the [`lecture-notes.tex`](lecture-notes.tex) file. For example, if the code looks as:
65+
2. Create a new `.tex` file in the [`lectures`](lectures) folder. Name it `<part>-<number>-<topic>.tex`, where `<number>` is the next number in the sequence while `<part>` is the number of chapter in the book.
66+
3. Add lecture to the [`lecture-notes-148x210.tex`](lecture-notes-148x210.tex) file. For example, if the code looks as:
3067

3168
```tex
3269
\section{Mathematics Preliminaries}
@@ -54,5 +91,5 @@ It is important that this course is designed for a full low-level understanding
5491
\subfile{lectures/3-commitment-schemes}
5592
```
5693
57-
4. To add the presentation, navigate to the [`presentations`](presentations) folder and add the same name as for
58-
your lecture file.
94+
4. To add the presentation, navigate to the [`presentations`](presentations)
95+
folder and add the same name as for your lecture file.

bibliography.bib

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,67 @@
11
@book{taylor,
2-
author = "Taylor, Joseph L.",
3-
title = "Complex Variables",
2+
author = "Taylor, Joseph L.",
3+
title = "Complex Variables",
44
publisher = {AMS},
5-
year = {2011},
6-
isbn = {978-0-8218-6901-7},
7-
keywords = {complex,variables,analysis}
5+
year = {2011},
6+
isbn = {978-0-8218-6901-7},
7+
keywords = {complex,variables,analysis}
88
}
99

1010
@unpublished{sekhon,
11-
author = "Sekhon, Senan",
12-
title = "Metric and Topological Spaces",
13-
year = {2019},
14-
note = "Unpublished",
15-
keywords = {metric spaces,topological spaces}
16-
}
11+
author = "Sekhon, Senan",
12+
title = "Metric and Topological Spaces",
13+
year = {2019},
14+
note = "Unpublished",
15+
keywords = {metric spaces,topological spaces}
16+
}
17+
18+
// part 1
19+
@book{Judson_2012,
20+
author = {Thomas W. Judson},
21+
title = {Abstract Algebra: Theory and Applications},
22+
year = {2012},
23+
publisher = {Stephen F. Austin State University},
24+
}
25+
26+
@book{Cohen_Frey_2005,
27+
author = {Cohen, H. and Frey, G. and Avanzi, Roberto and Doche, C. and Lange, T. and Nguyen, Kaven and Vercauteren, F.},
28+
year = {2005},
29+
pages = {1-808},
30+
title = {Handbook of elliptic and hyperelliptic curve cryptography},
31+
journal = {Handbook of Elliptic and Hyperelliptic Curve Cryptography}
32+
}
33+
34+
@book{Galbraith_2012,
35+
place = {Cambridge},
36+
title = {Mathematics of Public Key Cryptography},
37+
publisher = {Cambridge University Press},
38+
author = {Galbraith, Steven D.},
39+
year = {2012}
40+
}
41+
42+
@book{Dan_Boneh_2023,
43+
title = {A Graduate Course in Applied Cryptography},
44+
author = {Dan Boneh and Victor Shoup},
45+
year = {2023},
46+
note = {Available at: \url{https://toc.cryptobook.us/#toc}},
47+
}
48+
49+
@book{Ben_Lynn_1980,
50+
author = {Ben Lynn},
51+
title = {Number Theory},
52+
year = {1980}
53+
}
54+
55+
@misc{Oveis_Gharan_2017_Lecture7,
56+
author = {Shayan Oveis Gharan},
57+
title = {CSE521: Design and Analysis of Algorithms I, Lecture 7: Schwartz-Zippel Lemma, Perfect Matching},
58+
year = {2017},
59+
note = {Winter 2017, Lecture},
60+
howpublished = {Lecture Notes, University of Washington},
61+
}
62+
63+
@article{Saniee_2007_LagrangeInterpolation,
64+
author = {Kamron Saniee},
65+
title = {A Simple Expression for Multivariate Lagrange Interpolation},
66+
year = {2007},
67+
}

lecture-notes-105x135-nohead.tex renamed to lecture-notes-105x135.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass{zkdl-template-105x135-nohead}
1+
\documentclass{zkdl-template-105x135}
22

33
\usepackage{opencolor}
44

lecture-notes-148x210.tex

Lines changed: 68 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
\documentclass{zkdl-template}
22

3-
\usepackage{opencolor}
4-
53
\makeatletter
64
\def\maketitle{
7-
\begin{center}
8-
{\Large\sffamily \emph{Distributed Lab}} \\ \vspace{30mm}
9-
{\huge\sffamily\bfseries ZKDL Lecture Notes} \\ \vspace{5mm}
10-
{Version 0.2} \\ \vspace{10mm}
11-
\end{center}
12-
13-
\vfill
14-
15-
\begin{center}
16-
{Ukraine} \\ \vspace{2mm}
17-
{\sffamily \the\year}
18-
\end{center}
19-
5+
\input{preface/book-cover.tex}
206
\thispagestyle{empty}
217
\pagebreak
228
}
@@ -25,106 +11,133 @@
2511
\begin{document}
2612
\maketitle
2713

28-
% Inverse title page
14+
% --- Inverse Title ---
15+
2916
\pagecolor{white}
3017

3118
\vspace*{\fill}
3219

3320
\begin{abstract}
3421
\fontsize{10}{12}\selectfont
22+
23+
\vspace{5mm}
24+
3525
\input{preface/abstract.tex}
3626
\end{abstract}
3727

3828
\vspace*{\fill}
3929

4030
\thispagestyle{empty}
4131
\newpage
32+
4233
% --- Table of Contents ---
4334

4435
\pagestyle{fancy}
4536
\pagecolor{white}
4637

4738
\tableofcontents
4839

49-
\pagebreak
50-
51-
% --- Content ---
52-
53-
\section*{Preface}
40+
\pagebreak
5441

55-
\subfile{preface/preface.tex}
42+
% --- Intro ---
5643

57-
\section{Group Theory and Polynomials}\label{section:math-crypto-1}
44+
\section{Preface}
45+
\subfile{preface/preface.tex}
5846

59-
\subfile{lectures/1-math}
47+
\section{Notation}\label{section:notation}
48+
\subfile{lectures/0-notation}
6049

61-
\section{Basics of Security Analysis}\label{section:math-crypto-2}
50+
% --- Mathematical Preliminaries ---
6251

63-
\subfile{lectures/2-math-and-crypto}
52+
\part{Mathematics Crash Course}
53+
\subfile{preface/intro_words/part1}
6454

65-
\section{Basics of Linear Algebra}\label{section:linear-algebra}
55+
\section{Introduction to Number Theory}\label{section:number-theory}
56+
\subfile{lectures/1-1-number-theory}
6657

67-
\subfile{lectures/3-linear-algebra-basics.tex}
58+
\section{Introduction to Abstract Algebra}\label{section:abstract-algebra}
59+
\subfile{lectures/1-2-abstract-algebra.tex}
6860

69-
\section{Field Extensions ands Elliptic Curves}\label{section:field_extensions}
61+
\section{Polynomials}\label{section:polynomial-rings}
62+
\subfile{lectures/1-3-polynomials.tex}
7063

71-
\subfile{lectures/3-ec}
64+
\section{Linear Algebra Basics}\label{section:linear-algebra}
65+
\subfile{lectures/1-4-linear-algebra-basics.tex}
7266

73-
\section{Projective Coordinates and Pairing}
67+
\section{Fields Extension}\label{section:finite-fields}
68+
\subfile{lectures/1-5-field-extension.tex}
7469

75-
\subfile{lectures/4-pairing}
70+
% --- Cryptography Preliminaries ---
7671

77-
\section{Commitment Schemes}\label{section:commitments}
72+
\part{Cryptography Tools}
73+
\subfile{preface/intro_words/part2.tex}
7874

79-
\subfile{lectures/5-commitments}
75+
\section{Basics of Security Analysis}\label{section:security-analysis}
76+
\subfile{lectures/1-6-security-basics.tex}
8077

81-
\section{Introduction to Zero-Knowledge Proofs}\label{section:intro-zk}
78+
\section{Elliptic Curves and Pairing}\label{section:elliptic-curves}
79+
\subfile{lectures/1-7-ec.tex}
8280

83-
\subfile{lectures/6-intro-zk}
81+
\section{Commitment Schemes}\label{section:commitment-schemes}
82+
\subfile{lectures/1-8-commitments.tex}
8483

85-
\section{Sigma Protocols}\label{section:sigma}
84+
% --- Zero-Knowledge ---
8685

87-
\subfile{lectures/7-sigma}
86+
\part{Zero-Knowledge Protocols}
87+
\subfile{preface/intro_words/part3.tex}
8888

89-
\section[Arithmetic Circuits. R1CS]{Introduction to SNARKs. Arithmetic Circuits. R1CS} \label{section:r1cs}
89+
\section{Introduction to Zero-Knowledge Proofs}\label{section:intro-zk}
90+
\subfile{lectures/2-1-intro-zk}
9091

91-
\subfile{lectures/8-circuits}\label{section:circuits}
92+
\section{Sigma Protocols}\label{section:sigma}
93+
\subfile{lectures/2-2-sigma}
9294

93-
\section[Quadratic Arithmetic Program]{Quadratic Arithmetic Program. Probabilistically Checkable Proofs}
95+
\section[Arithmetic Circuits. R1CS]{Introduction to SNARKs. Arithmetic Circuits. R1CS} \label{section:r1cs}
96+
\subfile{lectures/2-3-circuits}\label{section:circuits}
9497

95-
\subfile{lectures/9-qap-pcp}
98+
\section[Quadratic Arithmetic Program]{Quadratic Arithmetic Program. Probabilistically Checkable Proofs}\label{section:qap-pcp}
99+
\subfile{lectures/2-4-qap-pcp}
96100

97-
\section[Pairing-based SNARKs]{Pairing-based SNARKs. Pinocchio and Groth16}
101+
\section[Pairing-based SNARKs]{Pairing-based SNARKs. Pinocchio. Groth16}\label{section:groth}
102+
\subfile{lectures/2-5-groth}
98103

99-
\subfile{lectures/10-groth}
104+
\section{Circom}\label{section:circom}
105+
\subfile{lectures/2-6-circom}
100106

101-
\section{Circom}\label{section:circom}
107+
\section{PlonK}\label{section:plonk}
108+
\subfile{lectures/2-7-plonk}
102109

103-
\subfile{lectures/11-circom}
110+
\section{Basics of STARKs}\label{section:stark}
111+
\subfile{lectures/2-8-stark}
104112

105-
\section{PlonK}\label{section:plonk}
113+
% --- Solutions ---
114+
\part{Concluding Remarks}\label{section:solutions}
115+
\subsection*{Solutions to Exercises}
116+
\subfile{lectures/3-solutions}
106117

107-
\subfile{lectures/12-plonk}
118+
\section{Acknowledgements}
119+
\subfile{preface/acknowledgements}
108120

109-
\section{Basics of STARKs}
121+
% --- References ---
110122

111-
\subfile{lectures/13-stark}
123+
\bibliographystyle{ieeetr}
124+
\bibliography{bibliography}
112125

113-
% --- Contact ---
126+
% --- Contact Page ---
114127

115128
\newpage
116129
\pagestyle{empty}
117-
130+
118131
\ifodd\value{page}
119132
\newpage
120133
\fi
121-
134+
122135
\vspace*{\fill}
123-
136+
124137
\begin{center}
125138
contact@distributedlab.com
126139
\end{center}
127-
140+
128141
\vspace*{\fill}
129142

130143
\end{document}

lectures-105-135/1-math.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass[../lecture-notes.tex]{subfiles}
1+
\documentclass[../lecture-notes-105x135.tex]{subfiles}
22

33
\begin{document}
44

lectures-105-135/10-groth.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass[../lecture-notes.tex]{subfiles}
1+
\documentclass[../lecture-notes-105x135.tex]{subfiles}
22

33
\begin{document}
44

0 commit comments

Comments
 (0)