-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathfrom0k2bp.tex
2707 lines (2358 loc) · 145 KB
/
from0k2bp.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[10pt,a4paper]{article}
%\usepackage{fullpage}
\usepackage{fancyvrb}
%\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{framed}
\usepackage{pstricks} %for embedding pspicture.
\usepackage{graphicx}
\usepackage{hyperref}
% (1) choose a font that is available as T1
% for example:
\usepackage{lmodern}
% (2) specify encoding
\usepackage[T1]{fontenc}
% (3) load symbol definitions
%\usepackage{textcomp}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provides euro and other symbols
\else % if luatex or xelatex
\usepackage{unicode-math}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% needed for small caption fonts
%\usepackage[skip=2pt]{caption}
%\DeclareCaptionFormat{myformat}{\fontsize{8}{9}\selectfont#1#2#3}
%\captionsetup{format=myformat}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\bibliographystyle{plain}
%\author{Adam Gibson}
\begin{document}
\title{From Zero (Knowledge) to Bulletproofs}
\maketitle
\hypertarget{introduction}{%
\section[Introduction]{\texorpdfstring{\protect\hypertarget{anchor}{}{}Introduction}{Introduction}}\label{introduction}}
\hypertarget{audience}{%
\subsection[Audience]{\texorpdfstring{\protect\hypertarget{anchor-1}{}{}Audience}{Audience}}\label{audience}}
This document doesn't really address (at least, not well) two potential
audiences:
\begin{itemize}
\tightlist
\item
Experts in the field who want academic rigour
\item
Casual readers who want a quick skim in a few pages to get an idea
\end{itemize}
So it doesn't leave many people left I guess!
But if you are very curious about: Confidential Transactions,
Bulletproofs as a way to improve them, and also the underlying technical
ideas (in particular, zero knowledge proofs in general, and commitment
schemes), and you have an intention to understand pretty deeply, you
might find this investigation at least partly as interesting to read as
I found it to construct!
\textbf{Knowledge prerequisites}: You are not assumed to know anything
about elliptic curves (EC) except that EC points can be added and also EC points
can be expressed as scalar multiples, i.e. the standard public-private key relationship like
$P=kG$ where $k$ is a scalar value which represents the private key, and understand why it
makes sense to say something like $aP = axG$, and that if $P-Q=H$ and $Q=rsG$ then the private key
of $H$ would be $(x-rs)$. No deeper mathematics about the \emph{construction} of
elliptic curves will be relevant here. If you've already taken the time
to understand e.g. ECDSA signatures or Schnorr signatures, you'll find
nothing here to trouble you.
Similar comments apply to hash functions (which play only a very minor
role in most of this document).
\emph{Very} basic linear algebra\footnote{Let's say: How to solve a set of
simultaneous linear equations. What a matrix inverse is.} will be very
helpful. You need to know what a vector is.
You don't need to know anything about zero knowledge proofs (no puns
please!). I'll endeavour to introduce some of the ideas behind that
phrase in stages.
If you don't know how Confidential Transactions pre-Bulletproofs work,
I'd mainly suggest Greg Maxwell's brief write-up{[}\protect\hyperlink{anchor-2}{5}{]}.
My own detailed description{[}\protect\hyperlink{anchor-3}{6}{]} of the mechanics may
still be helpful in some parts if you are new to this stuff. However, it goes
into a lot of detail of implementation in later sections that are no
longer relevant here. Thirdly, there is
this{[}\protect\hyperlink{anchor-4}{7}{]} more compact description which
could be useful, too.
\hypertarget{motivation}{%
\subsection[Motivation]{\texorpdfstring{\protect\hypertarget{anchor-5}{}{}Motivation}{Motivation}}\label{motivation}}
In investigating and trying to understand
Bulletproofs{[}\protect\hyperlink{anchor-6}{15}{]}, I found myself
disappearing slowly down a rabbit hole of interesting ideas, blogs and
eventually academic papers, that talk about a whole set of ideas based
on ``Zero Knowledge Proofs'' and specifically, how you can construct
such beasts using the Discrete Log problem (I will translate to the
Elliptic Curve form here), and apply them to proving things about
mathematical objects like vectors, polynomials, dot products etc.
After an initial prelude about ``commitments'' (Section 2) which you
should definitely \emph{not} skip unless you're already fully familiar
with them, I'll focus particularly on \emph{parts} of three papers: (1)
a paper of Jens Groth from 2009 entitled ``Linear Algebra with
Sub-linear Zero-Knowledge
Arguments''{[}\protect\hyperlink{anchor-7}{1}{]}, (2) a paper by Bootle
et al from 2016 that partly builds on those ideas: ``Efficient
Zero-Knowledge Arguments for Arithmetic Circuits in the Discrete Log
Setting''{[}\protect\hyperlink{anchor-8}{2}{]} (in particular its inner
product argument-of-knowledge; in some way this is the main
breakthrough), and finally (3) the paper on
``Bulletproofs''{[}\protect\hyperlink{anchor-6}{15}{]} itself by Bünz et
al. from 2017.
As we go through certain arguments/proofs in these papers, I'll
introduce some details on how the proofs work; it's far less interesting
to just see the algebraic constructions than it is try to actually
\textbf{convince} yourself that they do indeed achieve the rather
magical goal:
\emph{Prove that some condition holds true, without revealing anything
else, but even better -- do it using only a tiny amount of data!}
What kind of condition are we talking about? Usually in this paper it'll
be something like ``Proving that you know the vector to which this
commitment commits without revealing it'' or ``Proving that the two
committed vectors have a dot product of zero'' etc. Such proofs are a
little puzzling without context, hence the next subsection.
\hypertarget{why-is-proving-you-know-vectors-without-revealing-them-even-useful}{%
\subsection[Why is ``proving you know vectors without revealing them''
even useful?]{\texorpdfstring{\protect\hypertarget{anchor-9}{}{}Why is
``proving you know vectors without revealing them'' even
useful?}{Why is ``proving you know vectors without revealing them'' even useful?}}\label{why-is-proving-you-know-vectors-without-revealing-them-even-useful}}
In isolation, it's not really useful for Alice to prove to Bob that she
knows, say, the vectors to which the commitments $C_1, C_2, C_3$ committed, if she
doesn't at some later point reveal them (more about ``commitments'' in
Section 2, if you're new to them).
But this can be part of a larger proof: for example, Alice may prove
that $C_4$ is a commitment to a scalar value $t$, which is the dot product $t=\textbf{v}_1 \cdot \textbf{v}_2$; still
without revealing any of these values. That \emph{can} be useful, and
indeed, it turns out to be the central part of the mechanics of
Bulletproofs for example. The Groth 09 paper uses this
proof-of-knowledge-of-committed-vectors primitive to build a whole
``suite'' of proofs of this type: you can use a set of vectors as an
encoding of a matrix of course, so you can prove not only things like a
dot product as mentioned, but also other things like a matrix product, a
matrix inverse, a Hadamard product, even whacky things like that the
matrix is triangular.
However, the ``inner product''\footnote{Annoyingly this has two other commonly
used names: dot product, and scalar product. If you don't remember its
definition from linear algebra, please look it up.} takes centre-stage,
since the paper reduces all the other linear algebra-y relations it
wants to prove to that form. This document will \emph{not} explain this,
but only (in Section \ref{a-zero-knowledge-argument-of-knowledge-of-a-set-of-vectors})
that first step: how to prove (technically,
``argue'') knowledge of a set of vectors (in zero-knowledge).
\hypertarget{caveat-lector}{%
\subsection[Caveat
Lector]{\texorpdfstring{\protect\hypertarget{anchor-10}{}{}Caveat
Lector}{Caveat Lector}}\label{caveat-lector}}
This is not a complete coverage of either Bulletproofs, nor of the
earlier papers mentioned, nor of Zero Knowledge Proofs (which are just
explained in outline); it's more of a patchwork coverage for the purpose
of building some or most of the intuitions and machinery that will put
Bulletproofs in context, and perhaps encourage you to learn more about
Zero Knowledge Proofs generally.
More importantly though, this is for now just a personal investigation
and is bound to contain both gross and subtle errors. Corrections are welcomed,
but readers should bear this in mind.
\hypertarget{notation}{%
\subsection[Notation]{\texorpdfstring{\protect\hypertarget{anchor-11}{}{}Notation}{Notation}}\label{notation}}
We will be working in the elliptic curve scenario, assuming everywhere
the use of a curve for which the standard generator/basepoint is $G$, and
whose order is~$p$\footnote{NB; this is usually $N$, but we avoid that notation because
we reserve it for vector dimension.}.
\begin{itemize}
\tightlist
\item
Integers (scalars) mod will be written as plaintext lower case letters
($x$).
\item
Points on the curve will be written as upper case letters ($X$).
\item
Scalar multiplication will be written with no explicit notation ($xY$ is
the scalar multiplication of the point $Y$ by $x$).
\item
Vectors (including vectors of points) will always be written in bold ($\textbf{x}, \textbf{X}$)
where not expanded out into components.
\item
For matrices, we'll use only the LaTeX-specific ``mathbb'' font: $\mathbb{X}$
\item
An especially cheeky piece of lazy notation: we will often deal with
sums of the form:
\[a_1G_1 + a_2G_2 + \ldots + a_nG_n, \]
which we will often write specifically as an ``implicit product'' of
two vectors: $\textbf{aG}$. Note that this is a single curve point.
\end{itemize}
\hypertarget{commitments-homomorphic-pedersen}{%
\section[Commitments; homomorphic;
Pedersen]{\texorpdfstring{\protect\hypertarget{anchor-12}{}{}Commitments;
homomorphic;
Pedersen}{Commitments; homomorphic; Pedersen}}\label{commitments-homomorphic-pedersen}}
I'm going to blatantly plagiarise myself for the much of this section,
from my earlier document on Confidential
Transactions{[}\protect\hyperlink{anchor-3}{6}{]}. If you've already
read that, you can skip this entirely,
EXCEPT \ref{perfect-hiding-and-perfect-binding-are-incompatible},
\ref{the-vector-pedersen-commitment}, which are new here, and very important.
\hypertarget{homomorphism}{%
\subsection[Homomorphism]{\texorpdfstring{\protect\hypertarget{anchor-13}{}{}Homomorphism}{Homomorphism}}\label{homomorphism}}
Consider this simple mathematical fact: $a^b \times a^c = a^{b+c}$. Also, the result is equal to $a^{c+b}$.
Notice that the addition of and works, and follows the normal addition
rule\footnote{``commutativity'' -- you can swap them round with no effect}, even
after we've put all the numbers into exponents. This is an example of
``homomorphism''\footnote{Etymology note: ``homo'' here means ``same'' and
``morphism'' means a transformation/change, i.e. something stays the
same under some change}, that we can use to get a blinding/encryption
effect -- we can do arithmetic on ``encrypted'' amounts (in the very
vaguest sense of the term), in certain circumstances.
\hypertarget{commitment-schemes}{%
\subsection[Commitment
schemes]{\texorpdfstring{\protect\hypertarget{anchor-14}{}{}Commitment
schemes}{Commitment schemes}}\label{commitment-schemes}}
Cryptographic commitments are a well known powerful technique. They are
usually used in a situation where you want to promise something is true
before later proving it to be true, which enables a bunch of interesting
types of systems to work.
Commitments are only possible because of the existence of one-way
functions; you need to be able to produce an output that doesn't, on its own, reveal the input.
Cryptographic hash functions (like SHA256) perform this role perfectly.
If I want to commit to the value ``2'', I can send you its hash:
\newline \newline
\texttt{53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3}
\newline \newline
This wouldn't be too smart though. It would mean that whenever I want to send you a commitment to the value ``2'',
I would always be sending the same string~\texttt{53...c3}
which wouldn't hide the value very well! This is a lack of what's called ``semantic security''.
However, it's pretty easy to address this.
Instead of committing to ``2'', I commit to ``2''+some random data, like
``2xyzabc''. To put it more generally, we decide on a format like: SHA256(secret number
\textbar{}\textbar{} 6 random characters), just for example (the real life version will be more secure of course). Because SHA256 has the property that you can't generate ``collisions'' (can't create two inputs with the same output), this still gives us the same essential security feature: once I've made the commitment, I can't change my mind on what the value is later - and you can ask me to reveal it at a later stage of a protocol/system.
Notice that by combining a hash function with an extra piece of random data, we have achieved what are known as the two key properties of any commitment scheme:
\begin{itemize}
\tightlist
\item
Hiding - a commitment $C$ does not reveal the value it commits to.
\item
Binding - having made the commitment $C(m)$ to $m$, you can't change your mind
and open it as a commitment to a different message $m'$.
\end{itemize}
\textbf{This is a counterintuitive achievement, so make sure you get it before going further }- I can choose a random number that I don't reveal to you in advance and append it to my message ``2'', and even so, I still can't go back on my commitment. Because the output I create, the
hash value, is absolutely impossible for me to regenerate with any other message and random
number. That's the power of cryptographic hashes (in practice, what's needed for that is called
`second preimage resistance' - you can't create a second input for an existing (input, output) pair -- which is easier for a hash function to achieve than full collision resistance, but a hash function is not considered cryptographically safe unless it has the latter).
So, a hash function provides the equipment to make commitments. However, what hash functions certainly don't have is any kind of homomorphism. There is certainly no rule like $\textrm{SHA256}(a) + \textrm{SHA256}(b) = \textrm{SHA256}(a+b)$. So this is no good for our purposes, because we are going to need a \emph{homomorphic commitment scheme} for the techniques we're going to use.
\hypertarget{a-pedersen-commitment-in-elliptic-curve-form}{%
\subsection[A Pedersen commitment in elliptic curve
form]{\texorpdfstring{\protect\hypertarget{anchor-15}{}{}A Pedersen
commitment in elliptic curve
form}{A Pedersen commitment in elliptic curve form}}\label{a-pedersen-commitment-in-elliptic-curve-form}}
Instead of using a hash function, we will use a point on an elliptic
curve to achieve the same goal; the one-way function here is scalar
multiplication of curve points:
\[C = rH + aG \]
Here, $C$ is the curve point we will use as a commitment (and give to some
counterparty), $a$ is the value we commit to (assume from now on it's a
number, not a string), $r$ is the randomness which provides hiding, $G$ is as
already mentioned the publically agreed generator of the elliptic curve,
and $H$ is another curve point, for which \textbf{nobody} knows the discrete
logarithm $q$ s.t. $H=qG$. This unknowness is vital, as we'll expand upon next.
But, crucially for the rest of this document, this new commitment scheme
\emph{does} have a homomorphism:
\begin{align*}
C(r_1, a_1) + C(r_2, a_2) & = r_1H + a_1G + r_2H + a_2G \\
& = (r_1 + r_2)H + (a_1 + a_2)G \\
& = C(r_1+r_2, a_1+a_2)
\end{align*}
In words: ``the sum of the commitments to $a_1$ and $a_2$ is equal to a commitment
to $a_1 + a_2$, as long as you choose the randomness for each of the first two
commitments so that their sum is equal to the randomness for the third.''
\hypertarget{nums-ness-and-binding}{%
\subsubsection[NUMS-ness and
binding]{\texorpdfstring{\protect\hypertarget{anchor-16}{}{}NUMS-ness
and binding}{NUMS-ness and binding}}\label{nums-ness-and-binding}}
NUMS{[}\protect\hyperlink{anchor-17}{8}{]} stands for ``Nothing Up My
Sleeve''. To achieve such a thing there are various plausible methods,
but in the specific case of wanting to find an $H$ for which nobody knows
the discrete log w.r.t. $G$, one easy way is to use a hash function. For
example, take the encoding of the point $G$, in binary, perhaps compressed
or uncompressed form, take the SHA256 of that binary string and treat it
as the $x$-coordinate of an elliptic curve point (assuming a curve of order
$\simeq 2^{256}$). Not all 256 bit hash digests will be such $x$-coordinates, but about
half of them are, so you can just use some simple iterative algorithm
(e.g. append byte ``1'', ``2'', \ldots{} after the encoding of $G$) to create
not just one such NUMS point $H$, but a large set of them like $H_1, H_2,\ldots, H_n$. And
indeed we will make heavy use of such ``sets of pre-determined curve
points for which no one knows the relative discrete logs'' later.
Assuming they have been thus constructed, let's think about whether the
\textbf{binding} property of the commitment holds true:
If I made a commitment to a single value in the form $C=rH + aG$, and I later am
able to find two scalar values $s$ and $b$ such that $C=sH+bG$, it \emph{proves }that
\emph{both} $s=r$ and $b=a$. More precisely it proves that \emph{either }both of
those equalities hold, \emph{or }a ``non-trivial discrete log relation''
has been found, which should not be possible unless you have cracked the
ECDLP (= ``Elliptic Curve Discrete Logarithm Problem''). The ECDLP (as
we have already described, but without the name) basically says ``given
a point on the curve Q which you've never seen before, can you find its
private key (``discrete log'') $q$ such that $Q=qG$?'' (in some half-reasonable
amount of time).
If the two previously mentioned equalities do not hold, then we have $rH + aG = sH+bG$ for
differing scalar values, meaning we have $H = \left(r-s\right)^{-1}(b-a)G$, i.e. we have the discrete log
between $H$ and $G$. This was supposed to be impossible due the NUMS
construction of $H$, unless you have solved ECDLP. Note also that in the
scenario where it is not a result of an ECDLP break, but instead someone
cheated and it wasn't actually NUMS, then that cheater (the holder of
the discrete log of $H$ w.r.t. $G$) can open commitments to any value he likes
-- in other words, the commitments are no longer binding at all.
Assuming none of this applies, the binding property allows us to
construct proofs like: given that $C$ is part of the input to a system, if I
have some algorithm (even involving weirdly powerful adversaries of the
type we're about to see!) that generates a formula $C=r'H + a'G$, I can safely assert $a=a'$,
with the above mentioned conditions.
\hypertarget{perfect-hiding-and-perfect-binding-are-incompatible}{%
\subsubsection[Perfect Hiding and Perfect Binding are
incompatible]{\texorpdfstring{\protect\hypertarget{anchor-18}{}{}Perfect
Hiding and Perfect Binding are
incompatible}{Perfect Hiding and Perfect Binding are incompatible}}\label{perfect-hiding-and-perfect-binding-are-incompatible}}
The Pedersen commitment is not \emph{just} ``hiding'' as explained
above: it has a property known as ``perfect'' or ``unconditional'' or
``statistical'' hiding.
This fact is sort of ``complementary'' to the above fact in 2.3.1 --
that it's not binding, if you know the discrete log of $Q=qG$. Consider, if I
have a commitment $C=rH+aG$, there is another $r'$ s.t. $C=r'H + a'G$ for any chosen $a'$; it's just that we can't
\emph{find} that $r'$ without the ability to crack the ECDLP. But the fact
that it even exists means that the commitment is a valid commitment to
\emph{any} value $a$, for the right $r$. This property is shared of course,
famously, with the One Time Pad{[}\protect\hyperlink{anchor-19}{16}{]},
which also perfectly hides the encrypted value.
However, the Pedersen commitment's binding is not perfect -- it is
``computational''. What this means is that, much as discussed just
above, in a case where the ECDLP was cracked, the binding property could
fail and people could open the commitment to other values.
Ideally, we'd have a commitment scheme that was perfect in both respects
-- binding and hiding, but unfortunately that is \textbf{logically
impossible}. Consider that if the above mentioned perfect hiding
property applied (as it does for Pedersen), then it is possible for more
than one pair $(r, a)$ to be a valid opening for the commitment $C$, meaning it is
not \emph{perfectly} binding.
Hence the title of this subsection.
There are commitment schemes that make the opposite tradeoff -- they
provide perfect binding but not perfect hiding. That of
ElGamal{[}\protect\hyperlink{anchor-20}{9}{]} is one such. However to
make that tradeoff it's necessary that you don't compress -- the output
cannot be smaller than the input, for if it was, the mapping between
them cannot be injective.
Further to this last point,
Ruffing{[}\protect\hyperlink{anchor-21}{10}{]} has come up with a new
concept ``Switch Commitments'' by which he proposes to at least
partially solve the problem of how to have a kind of mutable commitment
that switches from perfectly hiding to perfectly binding at a later
date.
\hypertarget{the-vector-pedersen-commitment}{%
\subsection[The Vector Pedersen
Commitment]{\texorpdfstring{\protect\hypertarget{anchor-22}{}{}The
Vector Pedersen Commitment}{The Vector Pedersen Commitment}}\label{the-vector-pedersen-commitment}}
To extend to a more powerful form of the Pedersen commitment already
defined, we go from:
\[C = rH + aG\]
to:
\begin{align}
C = rH + (v_1G_1 + v_2G_2 + \ldots + v_nG_n) = rH + \textbf{vG} \label{vector-pedersen-commitment-def:1}
\end{align}
The individual $G_i$ generators can be constructed using a simple algorithm of the form
already mentioned (like, take a $\mathcal{H}(\textrm{encode}(G)||i)$ where $\mathcal{H}$ represents some hash function).
The opening of this commitment would of course be the random scalar $r$ and
the components of the vector $\textbf{v}$. I defer to elsewhere, proof
that this extension preserves both the hiding and binding properties,
although it's pretty obvious.
The main thing to observe right now is: this is a very powerful
construction if you're interested in compactness. The vector may have an
arbitrarily large number of elements, but is committed to with
\textbf{one single curve point} $C$.
A final note (and this will be used a lot): we can extend this yet
further to create commitments to 2 or even multiple vectors; we just
need a set of $N$~NUMS base curve points for each vector we're committing
to, for example (2 vectors):
\[C = rH + \textbf{vG} + \textbf{wH}\]
Note here that the single curve point $H$ is not part of the vector $\textbf{H}$.
Finally, note the connection with \ref{perfect-hiding-and-perfect-binding-are-incompatible} above:
there we pointed out that if a commitment compresses the input, it can't be perfectly binding.
Here, we are doing a huge amount of compression: there are $2N$ scalars in
the above vectors, for dimension $N$. So commitments of this type can't be
perfectly binding, whether they're using Pedersen or any other style of
commitment. Hence we can assert that the methods developed here\footnote{Heavily using this kind of vector commitment} for
Bulletproofs can never have perfect binding.
\hypertarget{a-zero-knowledge-argument-of-knowledge-of-a-set-of-vectors}{%
\section[A zero knowledge argument of knowledge of a set of
vectors]{\texorpdfstring{\protect\hypertarget{anchor-23}{}{}A zero
knowledge argument of knowledge of a set of
vectors}{A zero knowledge argument of knowledge of a set of vectors}}\label{a-zero-knowledge-argument-of-knowledge-of-a-set-of-vectors}}
This section will go over Appendix A from the Groth paper
{[}\protect\hyperlink{anchor-7}{1}{]}; in so doing, we'll get a chance
to start to understand the basic mechanics of doing zero knowledge
proofs, so there will be some side-discussions as we go through it.
An ``argument of knowledge'' is a technical term distinguished from
``proof of knowledge'' by the idea that the proof is only computational
-- an adversary with enough computing power \emph{may} be able to
convince you that he knows the secret value(s), even if he doesn't.
\emph{Before starting: we will not be discussing , here, removing the
interactivity from this process using Fiat-Shamir / random oracle model,
as it's an extra level of complexity in the zero knowledge proof aspect
we want to avoid for now. We'll make some comments on it near the end of
the document, in Section \ref{aside-non-interactive-proofs}.}
So here just assume that the Verifier (denoted $\mathcal{V}$) of the proof will interact with
the Prover (denoted $\mathcal{P}$) in real time.
Our argument of knowledge will come after we have generated a set of
commitments for each of $m$ vectors $\textbf{x}_1, \textbf{x}_2, \ldots, \textbf{x}_m$, each of the same dimension $N$ ($\neq m$)).
Explicitly:
\begin{flalign*}
&C_1 = r_1 H + \mathbf{x_1} \mathbf{G} \\
&C_2 = r_2 H + \mathbf{x_2} \mathbf{G} \\
&\ldots \\
&C_m = r_m H + \mathbf{x_m} \mathbf{G} \\
\end{flalign*}
Since the commitments are (perfectly) hiding, we have not revealed these
vectors by passing the commitments to the Verifier. So having at some
earlier time shared these commitments $C_1, C_2, \ldots ,C_m$, we will now prove/argue in zero
knowledge that we know the openings of all of them.
Here's the process interactively:
\begin{itemize}
\item $\mathcal{P}$ → $\mathcal{V}$: $C_0$ (a new commitment to a newly chosen random vector of dimension $N$)
\item $\mathcal{V}$ → $\mathcal{P}$: $e$ (a random scalar)
\item $\mathcal{P}$ → $\mathcal{V}$: $(\textbf{z}, s)$ (a single vector of dimension $N$, and another scalar)
\end{itemize}
These last two are calculated as:
\[\mathbf{z} = \sum\limits_{i=0}^{m} e^{i}\mathbf{x}_{i}, \quad s = \sum\limits_{i=0}^{m}e^{i}r_{i}\]
Note that the summations start at 0; this means that the sums include
the extra, random commitment, indexed 0, that was created as the first
step of the interaction. Note also that we are using \emph{powers} of
the random number $e$, i.e. literally the set of numbers $(1, e, e^2, \ldots , e^m)$. We will discuss
this important detail later in \ref{why-do-we-use-powers-of-e-generalisations-about-polynomials}.
In case it isn't obvious why this actually keeps the vectors \textbf{x}
hidden, consider one component of \textbf{z}, like for example $z_2 = x_{02} + ex_{12} + \ldots e^mx_{m2}$; the
addition hides the individual values.
Having received this $(\textbf{z}, s)$, the verifer of course needs to verify whether the
proof is valid. He does the following:
\[\sum\limits_{i=0}^{m} e^{i}C_{i} \ \stackrel{?}{=} \ sH + \mathbf{z}\mathbf{G}\]
\hypertarget{completeness-does-it-validate-if-the-opening-is-correct}{%
\subsection[Completeness: does it validate if the opening is
correct?]{\texorpdfstring{\protect\hypertarget{anchor-24}{}{}Completeness:
does it validate if the opening is
correct?}{Completeness: does it validate if the opening is correct?}}\label{completeness-does-it-validate-if-the-opening-is-correct}}
We can see this by expanding the RHS of the above verification check:
\begin{flalign*}
sH + \mathbf{z}\mathbf{G} &= \sum\limits_{i=0}^{m}e^{i}\left(r_{i}H\right) +\sum\limits_{i=0}^{m}e^{i}\mathbf{x_i}\mathbf{G} \\
&= \sum\limits_{i=0}^{m}e^{i}\left(r_{i}H + \mathbf{x_{i}}\mathbf{G}\right) \\
&= \sum\limits_{i=0}^{m}e^{i}C_{i} \\
\end{flalign*}
So an honest Prover does indeed convince the verifier.
\hypertarget{zero-knowledge-does-the-prover-reveal-anything-more}{%
\subsection[Zero knowledge -- does the prover reveal anything
more?]{\texorpdfstring{\protect\hypertarget{anchor-25}{}{}Zero knowledge
-- does the prover reveal anything
more?}{Zero knowledge -- does the prover reveal anything more?}}\label{zero-knowledge-does-the-prover-reveal-anything-more}}
We deal with zero knowledgeness before soundness, because the latter is
the harder proof (and indeed the most interesting part!).
To argue for zero information being revealed to the Verifier (other than
the single bit of information that the Prover knows the opening of the
commitments), we use this reasoning:
\begin{quote}
If the distribution of transcripts of the conversation between Prover
and Verifier, in the case where the verifier's execution environment is
controlled and it is run by a notional entity called a ``Simulator'',
and we can simulate a proof without actually having the knowledge, is
the same distribution as that obtained for genuine conversations with
Prover(s) who \emph{do} know the opening of the vector commitments, it
follows that the Verifier learns zero from the interaction other than
the aforementioned single bit.
\end{quote}
For more details on this basic (if rather bizarre at first) reasoning
for the construction of zero knowledge proofs, refer to e.g.,
{[}\protect\hyperlink{anchor-26}{14}{]} for a discursive introduction,
and {[}\protect\hyperlink{anchor-27}{17}{]} for an in-depth discussion
with academic rigour\footnote{Hat tip Jonas Nick for pointing me at that!}.
The Wikipedia page{[}\protect\hyperlink{anchor-28}{18}{]} gives a
summary also.
There's some value in chasing up those links and spending time with them
before going further, although technically you have enough to basically
understand it here. Here I will only briefly mention the three key
properties of any zero knowledge proof:
\begin{itemize}
\tightlist
\item
Completeness -- does an honest Prover succeed in convincing the
Verifier
\item
Soundness -- does the Prover actually \emph{prove} the truth of the
statement
\item
Zero-Knowledgeness -- can we reveal that the Prover reveals nothing
else than that the statement is true.
\end{itemize}
In academic coverage of this concept, there are a lot additional
definitions used. A ``witness'' is a piece of (usually secret) data
corresponding to a ``statement'' which the Prover possesses but does not
want to reveal. Zero knowledge comes in flavours such as ``Honest
Verifier Zero Knowledge'' with a number of subcategories. And so on.
This document is not attempting to be rigorous, and so will avoid going
into details at this level. If you want to do so, again, I refer you to
{[}\protect\hyperlink{anchor-27}{17}{]}, although there are bound to be
a lot of other high quality resources too.
As a preparation for using these ideas in practice, here is how the
proof works for a (slightly) simpler case, namely for Schnorr's Identity
Protocol\footnote{Schnorr's Identity Protocol is basically the same as the Schnorr signature,
except the interactive form and ignoring messages}. To review, the basic structure is:
Prover starts with a public key $P$ and a corresponding private key $x$ s.t. $P=xG$.
Prover wishes to prove in zero knowledge, that he knows $x$.
$\mathcal{P}$ → $\mathcal{V}$: $R$ (a new random curve point, but $\mathcal{P}$ knows $k$ s.t. $R=kG$)
$\mathcal{V}$ → $\mathcal{P}$: $e$ (a random scalar)
$\mathcal{P}$ → $\mathcal{V}$: $s$ (which $\mathcal{P}$ calculated from the equation $s=k+ex$)
Note: the \textbf{transcript} referred to above, would here be: $(R, e, s)$.
Verification works fairly trivially: verifier checks $sG \stackrel{?}{=} R + eP$. Now, to prove
zero knowledgeness of this construction in the above described
framework:
The ``Simulator'', which controls the execution of the verifier, given
the public key $P$, just as the Verifier would be, can fake a valid
transcript as follows:
Choose $s$ randomly. Then, choose $e$, also randomly. Finally, we only need to
choose $R$ to create a complete conversation transcript; it must be $R = sG -eP$. Then
we have successfully simulated a conversation which is entirely valid: $(R, e, s)$,
without ever knowing the secret key $x$, and which it's easy to see is
randomly distributed in the same way as a real one would be ($R$ is a free
variable).
This is a useful example to start from; it shows how, if the proof
relies on causality in the interaction (you only get A after you first
give me B), then since a conversation transcript doesn't intrinsically
enforce that, such transcripts can (at least in this case) be faked.
Another way of looking at it is that this kind of proof is
\textbf{deniable} -- it may be entirely valid to the interacting
Verifier, but entirely meaningless (as in this case) to a third party
who is shown the transcript later. And though this is not \emph{quite}
the same as zero knowledge (we also have to consider distributions),
it's basically the same here.
Coming back to our vector proof of knowledge, we can see that we're in a
very similar situation. The conversation transcripts look like:
\[(C_0, e, (\mathbf{z}, s))\]
which is almost the same, except that the final portion is a vector + a
scalar instead of a single scalar. And so the same reasoning applies: a
Simulator can fake the transcript by choosing out of order (it's only a
slightly more algebraically involved issue here): you choose $(\textbf{z},
s)$ both at random, as well as $e$, and you can deduce the right value of
the point:
\[C_0 \ = \ \left(sH + \mathbf{z}\mathbf{G}\right)-\left(\sum\limits_{i=1}^{m}e^{i}C_{i}\right)\]
(remember, the $C_1, C_2, \ldots ,C_m$ are all set in advance). It's easy to see that this will
mean that the entire transcript will look valid to a third party, and
it's less obvious but certainly plausible that the statistical
distribution of these transcripts will be indistinguishable from that
for genuinely constructed transcripts by honest Provers; thus zero
knowledgeness is proven.
\hypertarget{knowledge-soundness-does-a-verifying-interaction-actually-prove-knowledge-of-the-vectors}{%
\subsection[Knowledge soundness -- does a verifying interaction actually
prove knowledge of the
vectors?]{\texorpdfstring{\protect\hypertarget{anchor-29}{}{}Knowledge
soundness -- does a verifying interaction actually prove knowledge of
the
vectors?}{Knowledge soundness -- does a verifying interaction actually prove knowledge of the vectors?}}\label{knowledge-soundness-does-a-verifying-interaction-actually-prove-knowledge-of-the-vectors}}
This is the most interesting part, and justification here will explain a
lot about why the mathematical structure is what it is.
Taking an intuitive view, it makes sense that this is the most
sophisticated: if someone gives me just \textbf{one }vector and one
scalar, it's more than a little surprising that this is enough to prove
correct opening of a potentially large list of vectors .. e.g. suppose
we had 10 vectors and $N = 20$, then there are 210 different variables
embedded in the Pedersen commitments $C_1, C_2, \ldots ,C_m$ - 10 random scalars and 20x10
individual vector components. We'll be proving knowledge by only
providing one vector plus one scalar, so 21 numbers (but not revealing
any of the \emph{original} numbers in doing so! - see the previous
section).
Proving ``soundness'' is somehow complementary/``opposite'' to proving
zero knowledge, in the following sense: the idea here is to
isolate/control the operation of the Prover, as a machine, rather than
isolate the verifier. If we can control the Prover's environment and by
doing so get him to spit out the secret information (the ``witness''),
it follows that he must have it in the first place! In the real world,
malware aside, the Prover is interacting and will not allow breaking of
his own rules, but that fact doesn't invalidate the above reasoning.
\begin{figure}[h]
\centering
\includegraphics[scale=0.50]{images/extractorgod5.png}
\caption{\emph{God (the Extractor) stealing the secret (\$) from the Prover (Machine)}}
\end{figure}
Even God cannot steal \$100 from you if you don't \emph{have} \$100.
Contrariwise, if you do, he can!
You might object: ``\emph{Hmm, if this adversary is basically God can't
he just dream up \$100 for you and then steal that?}''. Yes, but that's
not stealing \$100 \emph{from you}. We want to know what is inside this
black box machine called a Prover; it's of no interest what we can
inject into it.
Another way of thinking about it, that might be especially appealing to
coders: imagine the Prover is literally a function. You can start
running it, stop at any point (imagine debugger breakpoints). Crucially
you can make copies of its current state. You can take info from one run
and feed it into another, etc. If by doing this whacky stuff you somehow
manage to get it to spit out information that reveals the secret (say, a
number $x$ such that $P=xG$), then it must have been in there in the first place.
In the Schnorr identity protocol case, this is quite straightforward: we
get the Prover to run twice, but only after the same initial random
point $R$. So imagine I as ``Extractor'' (what we call the ``God''
controlling the Prover) create two runs of the protocol with two
different values $e_1, e_2$ against the same initial $R$, then:
\begin{align*}
s_1 & = k + e_{1}x \\
s_2 & = k + e_{2}x \\
\\
\implies x & = \frac{s_1 - s_2}{e_1 - e_2} \\
\end{align*}
Thus, the Extractor managed to get the secret key in two runs of the
protocol that happened to share the same ``nonce'' point $R$ (remember, $R=kG$ and
it's the same in both runs here). This is such a widely known
``exploit'' of both Schnorr and ECDSA signatures (when wrongly
implemented) that I won't belabour the point; but note it's crucial here
to proving that the construction has ``knowledge-soundness'', i.e. that
this protocol \textbf{can only be run by a Prover who actually knows the
secret, x}.
OK, we've given the background, now on to the nitty gritty: how do we
prove knowledge soundness for our zero knowledge proof of knowledge of
the openings of the commitments to the vectors $\mathbf{x}_1, \mathbf{x}_2, \ldots, \mathbf{x}_m$?
First point:
We need to get the Prover to output not just two transcripts, but $m+1$. This
will be enough to prevent the system of equations from being
underdetermined, i.e. it will give us a unique solution. In more detail:
As for the Schnorr case, we have the Extractor start the Prover, who
generates here a $C_0$, then provide it with a random challenge $e$, then
retrieve from it a pair $(\mathbf{z}, s)$. Assuming that this response is
valid, we can repeat the process, a total of $m+1$ times, resulting in this
set of transcripts:
\begin{align*}
&(C_{0,1}, e_1, (\mathbf{z}_1 , s_1)) \\
&(C_{0,2}, e_2, (\mathbf{z}_2 , s_2)) \\
&\ldots \\
&(C_{0,m}, e_m, (\mathbf{z}_m , s_m)) \\
\end{align*}
The Extractor now effectively uses this data as a set of linear
equations that it can solve to extract the values of the commited
vectors $\mathbf{x}_1, \mathbf{x}_2, \ldots, \mathbf{x}_m$. Here's how. It starts by constructing the Vandermonde matrix
{[}\protect\hyperlink{anchor-30}{19}{]} of the challenges $e_i$:
\[
\mathbb{A}^{-1} = \begin{pmatrix}
1 & e_0 & e_0^2 & \dots & e_0^m \\
1 & e_1 & e_1^2 & \dots & e_1^m \\
1 & e_2 & e_2^2 & \dots & e_2^m \\
\vdots \\
1 & e_m & e_m^2 & \dots & e_m^m \\
\end{pmatrix}
\]
(Ignore the LHS for a moment). The Vandermonde matrix, acting on the
column vector of a set of coefficients of a polynomial, outputs a new
column vector which represents the evaluation of that polynomial at each
of the points $(e_0, e_1, \ldots , e_m)$. What's particularly elegant here is that this means the
\emph{inverse} of that matrix, \emph{if it exists}, therefore maps a set
of $m+1$ polynomial evaluations (the polynomial here has degree $m$), back to its
set of coefficients, and most crucially \textbf{that mapping is one-to-one
and therefore the solution is unique. }\emph{(This idea is used in
polynomial interpolation; as you may know, a set of $N+1$ evaluations
fixes a polynomial of degree $N$.)}
Note that this of course breaks down where there is \emph{no} such
inverse, which is easily seen to occur exactly and \emph{only} in the
case where \emph{not all }of the $(e_0, e_1, \ldots , e_m)$ are distinct; this would represent a
scenario where you had less than $N+1$ evaluations of the polynomial; the set
of equations would be underdetermined. As is well known from high school
level linear algebra, the inverse exists if and only if the determinant
is non-zero, and this is the product of the pairwise differences of the
$e$-values (which is a useful result about Vandermonde matrices -- one for
which we have just explained the insight). All we need is that the
$e$-values are all different, which of course we can arrange to be true in
this Extractor mode.
Holding in mind this guarantee that the inverse exists, you can see from
the above equation that $\mathbb{A}$ is that inverse. Consider the identity:
\[
\begin{pmatrix}
a_{00} & a_{01} &a_{02} \\
a_{10} & a_{11} &a_{12} \\
a_{20} & a_{21} &a_{22} \\
\end{pmatrix}
\begin{pmatrix}
1 & e_0 & e_0^2\\
1 & e_1 & e_1^2\\
1 & e_2 & e_2^2\\
\end{pmatrix}
=\begin{pmatrix}
1 & 0 &0 \\
0 & 1 &0 \\
0 & 0 &1 \\
\end{pmatrix}
\]
where we're looking at only $m=2$, for brevity. We can see that for any
particular $e$-value ('challenge'), the following holds: $\sum_{j=0}^{m} a_{hj}e_j^{i} = \delta_{hi}$; in words, the
$i$-th row of the matrix $\mathbb{A}$ yields 1 when multiplied by the column vector of
$i$-th powers of the challenges, and zero when multiplied by all other
columns (here $\delta_{xy}$ is just a well known mathematical shorthand called the
``Kronecker delta'' which yields 1 when $x=y$ and zero for all other
combinations).
Now we'll show in a series of steps how we can use this to extract the
witness, that is to say, the actual vectors $\mathbf{x}_i$. For any specific
commitment in the set $C_1, C_2, \ldots ,C_m$, we'll say we're looking at $C_h$, we can write:
\begin{align*}
C_h & = \sum\limits_{i=0}^{m}\delta_{hi}C_{i} \quad \textrm{by definition of Kronecker delta} \\
& = \sum\limits_{i=0}^{m}\left(\sum\limits_{j=0}^{m}a_{hj}e_j^i\right)C_{i} \quad \textrm{as above paragraph} \\
& = \sum\limits_{j=0}^{m}a_{hj}\left(\sum\limits_{i=0}^{m}e_j^i C_i\right) \quad \textrm{additive commutativity} \\
& = \sum\limits_{j=0}^{m}a_{hj}\left(\sum\limits_{i=0}^{m}e_j^i \left(r_i H + \mathbf{x}_i \mathbf{G}\right)\right) \quad \textrm{definition of commitment C} \\
& = \sum\limits_{j=0}^{m}a_{hj}\left(\sum\limits_{i=0}^{m}e_j^i r_i H\right) + \sum\limits_{j=0}^{m}a_{hj}\left(\sum\limits_{i=0}^{m}e_j^i \mathbf{x}_i \mathbf{G}\right) \quad \textrm{additive associativity} \\
& = \sum\limits_{j=0}^{m} a_{hj}s_j H + \sum\limits_{j=0}^{m} a_{hj} \mathbf{z}_j \mathbf{G} \quad \textrm{definition of s,}\mathbf{z} \\
& \implies C_h \ \textrm{is a commitment to} \ \sum\limits_{j=0}^{m}a_{hj}\mathbf{z}_j \ \textrm{with randomness} \ \sum\limits_{j=0}^{m} a_{hj}s_j \\
& \implies \textbf{x}_h = \sum\limits_{j=0}^{m}a_{hj}\mathbf{z}_j \quad \textrm{by the binding property of the commitment}
\end{align*}
The last step of reasoning is crucial, of course; this only extracts the
$\mathbf{x}$ vectors because you cannot open a commitment to two different
values/vectors. See the details in the section on Pedersen commitments.
I realise it all looks a bit fancy, but that's just typical mathematical
formalism/neatness; what it really means is pretty simple: if you have
$m+1$ evaluations, you can fix the mapping between $\textbf{z}_j \leftrightarrow \textbf{x}_j$, invert it and extract all
the $\mathbf{x}$-vectors.
Through this algorithm, we were able to therefore \emph{extract} the
committed vectors $\mathbf{x}$ from the Prover, and thus we have
``knowledge-soundness'', that is, a Prover cannot provide a verifying
proof without actually knowing the values.
\hypertarget{why-do-we-use-powers-of-e-generalisations-about-polynomials}{%
\subsubsection[Why do we use powers of e? Generalisations about
polynomials]{\texorpdfstring{\protect\hypertarget{anchor-31}{}{}Why do
we use powers of e? Generalisations about
polynomials}{Why do we use powers of e? Generalisations about polynomials}}\label{why-do-we-use-powers-of-e-generalisations-about-polynomials}}
Referring back to the basic protocol, which is Prover sends $C_0$, Verifier
sends $e$, Prover sends back $(\mathbf{z}, s)$, we see that the Verifier only sends one
random value $e$, which is then ``expanded'' into this set of powers (note
btw that all scalars are mod $p$, where $p$ is the order of the elliptic
curve). It's intuitively logical that $m+1$ challenge values are indeed
required; imagine for example constructing $\mathbf{z} = e\sum_{j=0}^{m} \textbf{x}_j$; this would obviously be
pointless as it doesn't fix the vectors $\mathbf{x}$ at all (previously, we expressed
this as the idea that a set of linear equations are
``underdetermined''); one could clearly open this $\mathbf{z}$ to any
number of combinations of vectors $\mathbf{x}_j$ that happened to add up to
the same value. So this makes us realise that we're going to need
$m+1$ \emph{not-predictable-in-advance-by-the-Prover} coefficients, by which
he'll have to multiply his individual \textbf{x}-es before adding them
together. So for these coefficients, you need something like a ``basis''
that doesn't allow clever cancellation.
You might try to achieve that if the verifier sent $m+1$ independent random
values $e_j$. Construction and verification of the proof would still work
here, but this would incur communication cost ($m+1$ separate random
scalars).
Clearly a compact transfer of only one value $e$ is preferable from that
point of view; but is this series of powers enough to
\emph{guarantee} that the Prover's original vector (in this case
$\mathbf{x}$) is fixed?
The most intuitive way to understand it: the vectors $\mathbf{x}_1, \mathbf{x}_2, \ldots, \mathbf{x}_m$ can be seen as the
coefficients of a polynomial $P(e) = \mathbf{x}_0 + \mathbf{x}_1e + \mathbf{x}_2e^2 + \ldots + \mathbf{x}_me^m$. Note that this polynomial is
vector-valued. Now this set of vectors (= this polynomial) is
\emph{fixed} by $m+1$ evaluations (see Figure 2).
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{images/PolynomialInterpolation.jpg}
\caption{\emph{A polynomial of degree n is fixed by n+1 evaluations}}
\end{figure}
It's important (for later parts of this document) to realize that one
can go further here -- one can assert that even a \emph{single}
polynomial evaluation of this type may be enough to fix a single vector
with overwhelming probability.
Consider the argument like this: imagine
you have a vector $\mathbf{v}$, and you make a commitment $C_v$ to it. Now, how can you,
in a very short (low-bandwidth) interaction, prove to a Verifier that
vector $\mathbf{v}$ was the zero vector? Let the Verifier pass a scalar
challenge $e$, and then reply with a proof that $P(e) = \mathbf{x}_0 + \mathbf{x}_1e + \mathbf{x}_2e^2 + \ldots + \mathbf{x}_me^m$, as above, is $\mathbf{0}$. Clearly
without knowing the challenge in advance it's unlikely that you'd have
been able to choose a $\mathbf{v}$ that wasn't $\mathbf{0}$ itself, and still have the dot product
verify. But how unlikely? It's easy in this simplified case to estimate
the probability: since $e$ is randomly chosen, the chance that it is a root
of $P(x)$ must be
\begin{align*}
\frac{\text{\# roots of } P(x)}{\text{\# available numbers}},
\end{align*}
i.e. $m/p$ where $p$ is, again, the order of the elliptic curve. This is
of course not a rigorous treatment, but should be good enough. For
typical elliptic curves (256 bit) and typical polynomials (some
countably small number of components), this will be negligible. We can
use this style of argument to build commitments to a set of values, or
vectors, by turning them into coefficients of a polynomial of a single
scalar challenge, and have that whole set of commitments be
computationally sound.
\hypertarget{aside-a-philosophical-musing-about-zero-knowledge-proofs}{%
\subsubsection[Aside: a philosophical musing about Zero Knowledge
Proofs]{\texorpdfstring{\protect\hypertarget{anchor-32}{}{}Aside: a
philosophical musing about Zero Knowledge
Proofs}{Aside: a philosophical musing about Zero Knowledge Proofs}}\label{aside-a-philosophical-musing-about-zero-knowledge-proofs}}
(As you can guess, this section is \ldots{} not required for the rest of
the document)
If you found it easy to grasp the general outline of the above
arguments, then kudos I guess -- for most people this stuff seems
\textbf{very} weird on a first pass-through. The idea goes back to
Goldwasser, Micali and Rackoff {[}\protect\hyperlink{anchor-33}{20}{]}
from the 80s. What strikes me as interesting is that the whole basis of
the idea is shifting the notion of a ``proof'' from complete perfection
(nothing less is accepted in Pure Mathematics -- axioms, syllogisms,
proof, etc.) to procedures based on a fundamentally
\textbf{computational} notion of soundness -- the proof is either
acceptable because different distributions of results are not
statistically distinguishable (``statistical soundness''), or even
weaker, that an invalidating counterexample cannot be constructed
without computing power greater than some infeasibly large number. Of
course this is totally normal in practical computing and cryptography
(especially today), but in Mathematics it's of course not at all --
apparently this is part of why the initial ZKP paper had to be submitted
several times before it was published!
The reason I mention it is because it's of course part of the broader
trend -- note that the basic mathematics behind the first public key
cryptosystem (RSA) was well known decades and probably centuries before
the 1970s, when it was invented. It just wasn't relevant \emph{until}
computation became fast enough for it to become relevant. Factoring
``large numbers'' is ``hard'' when ``large'' means a few thousands or
tens of thousands. That asymmetry (between making a product and
decomposing it) existed, but it wasn't so big as to be interesting. But
when you can work with numbers that have 200+ digits in their base-10
representation, that asymmetry has blown up to such a huge extent that
you can treat it as a one-way function. So in this sense the entirety of
public key cryptography is, realistically, a direct consequence of fast
computation creating a kind of ``phase change'' in the significance of
the underlying number theory.
\hypertarget{an-inner-product-proof}{%
\section[An inner product
proof]{\texorpdfstring{\protect\hypertarget{anchor-34}{}{}An inner
product proof}{An inner product proof}}\label{an-inner-product-proof}}
In Section~5 of Groth's paper, he presents the core algorithm, which
probably-not-coincidentally is also the core of Bulletproofs (although
the latter's version is more sophisticated and more compact, as we'll
see later). The inner product proof here uses all the same elements as
we've discussed above, although in a slightly more complicated
structure.
It starts by assuming that the Prover has two vectors $\mathbf{x}$ and
$\mathbf{y}$, and obviously knows the inner product of those, which we'll
now call $z$.
The Prover's job will now be to convince the verifier that
\emph{Pedersen commitments }to these three quantities obey $z = \mathbf{x} \cdot \mathbf{y}$; so we
assume upfront that the three commitments are known,
we'll denote them $C_z, C_x$ and $C_y$ from now on:
\begin{align}
C_z &= tH + zG \label{inner_product_proof_C_xyz_def:1}\\
C_x &= rH + \mathbf{xG} \label{inner_product_proof_C_xyz_def:2}\\
C_y &= sH + \mathbf{yG} \label{inner_product_proof_C_xyz_def:3}
\end{align}
(Remember our notation cheat: The bolded parts are actually summations.)
\hypertarget{aside-the-sigma-protocol}{%
\subsection[Aside: the Sigma
protocol]{\texorpdfstring{\protect\hypertarget{anchor-35}{}{}Aside: the
Sigma
protocol}{Aside: the Sigma protocol}}\label{aside-the-sigma-protocol}}
This is an abstraction worth mentioning at this point, because we are
about to see another example, and we have already seen two -- the first was
Schnorr's identity protocol and the second was the proof of knowledge
of a set of vectors. Here they were:
\begin{itemize}
\item $\mathcal{P}$ → $\mathcal{V}$: $R$ (a new random curve point, but $\mathcal{P}$ knows $k$ s.t. $R=kG$)