forked from arielgabizon/plonk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPLONK.tex
1917 lines (1557 loc) · 118 KB
/
PLONK.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
% !tex ts-program = pdflatex
% !tex encoding = utf-8 unicode
% this is a simple template for a latex document using the "article" class.
% see "book", "report", "letter" for other types of document.
\documentclass[11pt]{article} % use larger type; default would be 10pt
\usepackage[
type={CC},
modifier={by-nc-sa},
version={3.0},
]{doclicense}
\usepackage[utf8]{inputenc} % set input encoding (not needed with xelatex)
\usepackage[strict]{changepage}
%%% examples of article customizations
% these packages are optional, depending whether you want the features they provide.
% see the latex companion or other references for full information.
%%% page dimensions
\usepackage{geometry} % to change the page dimensions
\geometry{a4paper} % or letterpaper (us) or a5paper or....
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
% read geometry.pdf for detailed page layout information
\usepackage{numdef}
\usepackage{graphicx} % support the \includegraphics command and options
% some of the article customisations are relevant for this class
\usepackage{amsmath,amsthm}
\usepackage{amsfonts} % math fonts such as \mathbb{}
\usepackage{amssymb} % \therefore
% \usepackage{bickham}
\usepackage{hyperref}
\usepackage{cryptocode}
\usepackage{framed}
% \usepackage[parfill]{parskip} % activate to begin paragraphs with an empty line rather than an indent
%%% packages
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. Enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
% % these packages are all incorporated in the memoir class to one degree or another...
\usepackage{mathrsfs}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{pgfplots}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
%%% headers & footers
\usepackage{fancyhdr} % this should be set after setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
%%% section title appearance
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (see the fntguide.pdf for font help)
% (this matches context defaults)
%%% toc (table of contents) appearance
\usepackage[nottoc,notlof,notlot]{tocbibind} % put the bibliography in the toc
\usepackage[titles,subfigure]{tocloft} % alter the style of the table of contents
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % no bold!
%%% end article customizations
\newcommand{\code}[1]{\texttt{#1}}
\newcommand\tstrut{\rule{0pt}{2.6ex}} % = `top' strut
\newcommand\bstrut{\rule[-0.9ex]{0pt}{0pt}} % = `bottom' strut
\newcommand{\bgamma}{\boldsymbol{\gamma}}
\newcommand{\bsigma}{\boldsymbol{\sigma}}
\newcommand{\plonk}{\ensuremath{\mathcal{P} \mathfrak{lon}\mathcal{K}}\xspace}
% \newcommand{\plonk}{\ensuremath{\mathtt{PLONK}}\xspace}
%%% the "real" document content comes below...
%\newcommand{\papertitle}{$\mathsf{Maitreya}$: Improved Prover Efficiency in Fully Succinct Universal zk-SNARKs through Permutation Arguments for Multiplicative Subgroups}
\newcommand{\papertitle}{\plonk: Permutations over Lagrange-bases for Oecumenical Noninteractive arguments of Knowledge}
%\newcommand{\authorname}}
\newcommand{\company}{}
\title{ \bf \papertitle \\[0.72cm]}
\author{ Ariel Gabizon\thanks{Most of this work was done while the first author was working at Protocol Labs.}\\ \tt{Aztec} \and Zachary J. Williamson\\ \tt{Aztec} \and Oana Ciobotaru}
% \large{\authorname} \\[0.5cm] \large{\company}
% \\ {DRAFT}
%}
%\date{} % activate to display a given date or no date (if empty),
% otherwise the current date is printed
\ProvidesPackage{numdef}
%% Ariel Macros:
\num\newcommand{\G1}{\ensuremath{{\mathbb G}_1}\xspace}
\newcommand{\Gi}{\ensuremath{{\mathbb G}_i}\xspace}
%\newcommand{\G}{\ensuremath{{\mathbb G}}\xspace}
\newcommand{\Gstar}{\ensuremath{{\mathbb G}^*}\xspace}
\newcommand{\x}{\ensuremath{\mathbf{x}}\xspace}
\newcommand{\z}{\ensuremath{\mathbf{z}}\xspace}
\newcommand{\X}{\ensuremath{\mathbf{X}}\xspace}
\num\newcommand{\G2}{\ensuremath{{\mathbb G}_2}\xspace}
%\num\newcommand{\G11}{\ensuremath{\G1\setminus \set{0} }\xspace}
%\num\newcommand{\G21}{\ensuremath{\G2\setminus \set{0} }\xspace}
\newcommand{\grouppair}{\ensuremath{G^*}\xspace}
\newcommand{\prvperm}{\ensuremath{\mathrm{P_{\mathsf{\sigma}}}}\xspace}
\newcommand{\verperm}{\ensuremath{\mathrm{V_{\mathsf{\sigma}}}}\xspace}
\newcommand{\Gt}{\ensuremath{{\mathbb G}_t}\xspace}
\newcommand{\F}{\ensuremath{\mathbb F}\xspace}
\newcommand{\Fstar}{\ensuremath{\mathbb F^*}\xspace}
\newcommand{\help}[1]{$#1$-helper\xspace}
\newcommand{\randompair}[1]{\ensuremath{\mathsf{randomPair}(#1)}\xspace}
\newcommand{\pair}[1]{$#1$-pair\xspace}
\newcommand{\pairs}[1]{$#1$-pairs\xspace}
\newcommand{\chalpoint}{\ensuremath{\mathfrak{z}}\xspace}
\newcommand{\pairone}[1]{\G1-$#1$-pair\xspace}
\newcommand{\pairtwo}[1]{\G2-$#1$-pair\xspace}
\newcommand{\sameratio}[2]{\ensuremath{\mathsf{SameRatio}(#1,#2)}\xspace}
\newcommand{\vecc}[2]{\ensuremath{(#1)_{#2}}\xspace}
\newcommand{\players}{\ensuremath{[n]}\xspace}
\newcommand{\adv}{\ensuremath{\mathcal A}\xspace}
\newcommand{\advprime}{\ensuremath{{\mathcal A}'}\xspace}
\newcommand{\extprime}{\ensuremath{E'}\xspace}
\newcommand{\advrand}{\ensuremath{\mathsf{rand}_{\adv}}\xspace}
\num\newcommand{\srs1}{\ensuremath{\mathsf{srs_1}}\xspace}
\num\newcommand{\srs2}{\ensuremath{\mathsf{srs_2}}\xspace}
\num\newcommand{\srs0}{\ensuremath{\mathsf{srs}}\xspace}
\newcommand{\srsi}{\ensuremath{\mathsf{srs_i}}\xspace}
\newcommand{\com}{\ensuremath{\mathsf{com}}\xspace}
\newcommand{\comperm}{\ensuremath{\mathsf{com_{\sigma}}}\xspace}
\newcommand{\cm}{\ensuremath{\mathsf{cm}}\xspace}
\newcommand{\cmsig}{\ensuremath{\mathsf{cm_\sigma}}\xspace}
\newcommand{\open}{\ensuremath{\mathsf{open}}\xspace}
\newcommand{\openperm}{\ensuremath{\mathsf{open_{\sigma}}}\xspace}
\newcommand{\sigof}[1]{\ensuremath{\sigma(#1)}\xspace}
\newcommand{\proverexp}{\ensuremath{\mathsf{e}}\xspace}
\newcommand{\reducedelems}{\ensuremath{\mathsf{r}}\xspace}
\newcommand{\ci}{\ensuremath{\mathrm{CI}}\xspace}
\renewcommand{\deg}{\ensuremath{\mathrm{deg}}\xspace}
\newcommand{\pairvec}[1]{$#1$-vector\xspace}
\newcommand{\Fq}{\ensuremath{\mathbb{F}_q}\xspace}
\newcommand{\randpair}[1]{\ensuremath{\mathsf{rp}_{#1}}\xspace}
\newcommand{\randpairone}[1]{\ensuremath{\mathsf{rp}_{#1}^{1}}\xspace}
\newcommand{\abase}{\ensuremath{A_{\mathrm{\mathbf{0}}}}\xspace}
\newcommand{\bbase}{\ensuremath{B_{\mathrm{\mathbf{0}}}}\xspace}
\newcommand{\cbase}{\ensuremath{C_{\mathrm{\mathbf{0}}}}\xspace}
\newcommand{\amid}{\ensuremath{A_{\mathrm{mid}}}\xspace}
\newcommand{\bmid}{\ensuremath{B_{\mathrm{mid}}}\xspace}
\newcommand{\cmid}{\ensuremath{C_{\mathrm{mid}}}\xspace}
\newcommand{\negl}{\ensuremath{\mathsf{negl}(\lambda)}\xspace}
\newcommand{\randpairtwo}[1]{\ensuremath{\mathsf{rp_{#1}^2}}\xspace}%the randpair in G2
\newcommand{\nilp}{\ensuremath{\mathscr N}\xspace}
\newcommand{\groupgen}{\ensuremath{\mathscr G}\xspace}
\newcommand{\qap}{\ensuremath{\mathscr Q}\xspace}
\newcommand{\polprot}[4]{$(#1,#2,#3,#4)$-polynomial protocol}
\newcommand{\rangedprot}[5]{$#5$-ranged $(#1,#2,#3,#4)$-polynomial protocol}
\newcommand{\rej}{\ensuremath{\mathsf{rej}}\xspace}
\newcommand{\acc}{\ensuremath{\mathsf{acc}}\xspace}
\newcommand{\res}{\ensuremath{\mathsf{res}}\xspace}
\newcommand{\sha}[1]{\ensuremath{\mathsf{COMMIT}(#1)}\xspace}
\newcommand{\shaa}{\ensuremath{\mathsf{COMMIT}}\xspace}
\newcommand{\comm}[1]{\ensuremath{\mathsf{comm}_{#1}}\xspace}
\newcommand{\defeq}{:=}
\newcommand{\B}{\ensuremath{\vec{B}}\xspace}
\newcommand{\dom}{\ensuremath{H}\xspace}
\newcommand{\C}{\ensuremath{\vec{C}}\xspace}
\newcommand{\Btwo}{\ensuremath{\vec{B_2}}\xspace}
\newcommand{\treevecsimp}{\ensuremath{(\tau,\rho_A,\rho_A \rho_B,\rho_A\alpha_A,\rho_A\rho_B\alpha_B, \rho_A\rho_B\alpha_C,\beta,\beta\gamma)}\xspace}% The sets of elements used in simplifed relation tree in main text body
\newcommand{\rcptc}{random-coefficient subprotocol\xspace}
\newcommand{\rcptcparams}[2]{\ensuremath{\mathrm{RCPC}(#1,#2)}\xspace}
\newcommand{\verifyrcptcparams}[2]{\ensuremath{\mathrm{\mathsf{verify}RCPC}(#1,#2)}\xspace}
\newcommand{\randadv}{\ensuremath{\mathsf{rand}_{\adv}}\xspace}
\num\newcommand{\ex1}[1]{\ensuremath{ #1\cdot g_1}\xspace}
\num\newcommand{\ex2}[1]{\ensuremath{#1\cdot g_2}\xspace}
\newcommand{\pr}{\mathrm{Pr}}
\newcommand{\powervec}[2]{\ensuremath{(1,#1,#1^{2},\ldots,#1^{#2})}\xspace}
\newcommand{\partition}{\ensuremath{{\mathcal T}}\xspace}
\newcommand{\partof}[1]{\ensuremath{{\partition_{#1}}}\xspace}
\num\newcommand{\out1}[1]{\ensuremath{\ex1{\powervec{#1}{d}}}\xspace}
\num\newcommand{\out2}[1]{\ensuremath{\ex2{\powervec{#1}{d}}}\xspace}
\newcommand{\nizk}[2]{\ensuremath{\mathrm{NIZK}(#1,#2)}\xspace}% #2 is the hash concatenation input
\newcommand{\verifynizk}[3]{\ensuremath{\mathrm{VERIFY\mhyphen NIZK}(#1,#2,#3)}\xspace}
\newcommand{\protver}{protocol verifier\xspace}
\newcommand{\hash}{\ensuremath{\mathcal{H}}\xspace}
\newcommand{\mulgroup}{\ensuremath{\F^*}\xspace}
\newcommand{\lag}[1]{\ensuremath{L_{#1}}\xspace}
\newcommand{\sett}[2]{\ensuremath{\set{#1}_{#2}}\xspace}
\newcommand{\omegaprod}{\ensuremath{\alpha_{\omega}}\xspace}
\newcommand{\lagvec}[1]{\ensuremath{\mathrm{LAG}_{#1}}\xspace}
\newcommand{\trapdoor}{\ensuremath{r}}
\newcommand{\trapdoorext}{\ensuremath{r_{\mathrm{ext}}}\xspace}
\newcommand{\trapdoorsim}{\ensuremath{r_{\mathrm{sim}}}\xspace}
\renewcommand{\mod}{\ensuremath{\;\mathrm{mod}\;}}
\newcommand{\hsub}{\ensuremath{H^*}\xspace}
\num\newcommand{\enc1}[1]{\ensuremath{\left[#1\right]_1}\xspace}
\newcommand{\enci}[1]{\ensuremath{\left[#1\right]_i}\xspace}
\num\newcommand{\enc2}[1]{\ensuremath{\left[#1\right]_2}\xspace}
\newcommand{\gen}{\ensuremath{\mathsf{gen}}\xspace}
\newcommand{\prv}{\ensuremath{\mathsf{\mathbf{P}}}\xspace}
\newcommand{\prvpoly}{\ensuremath{\mathrm{P_{\mathsf{poly}}}}\xspace}
\newcommand{\prvpc}{\ensuremath{\mathrm{P_{\mathsf{PC}}}}\xspace}
\newcommand{\verpoly}{\ensuremath{\mathrm{V_{\mathsf{poly}}}}\xspace}
\newcommand{\verpc}{\ensuremath{\mathrm{V_{\mathsf{PC}}}}\xspace}
\newcommand{\ideal}{\ensuremath{\mathcal{I}}\xspace}
\newcommand{\prf}{\ensuremath{\pi}\xspace}
\newcommand{\simprv}{\ensuremath{\mathrm{P^{sim}}}\xspace}
%\newcommand{\enc}[1]{\ensuremath{\left[#1\right]}\xspace}
%\num\newcommand{\G0}{\ensuremath{\mathbf{G}}\xspace}
\newcommand{\GG}{\ensuremath{\mathbf{G^*}}\xspace} % would have liked to call this G01 but problem with name
\num\newcommand{\g0}{\ensuremath{\mathbf{g}}\xspace}
\newcommand{\inst}{\ensuremath{\phi}\xspace}
\newcommand{\inp}{\ensuremath{\mathsf{x}}\xspace}
\newcommand{\wit}{\ensuremath{\omega}\xspace}
\newcommand{\ver}{\ensuremath{\mathsf{\mathbf{V}}}\xspace}
\newcommand{\per}{\ensuremath{\mathsf{\mathbf{P}}}\xspace}
\newcommand{\sonic}{\ensuremath{\mathsf{Sonic}}\xspace}
\newcommand{\aurora}{\ensuremath{\mathsf{Aurora}}\xspace}
\newcommand{\auroralight}{\ensuremath{\mathsf{Auroralight}}\xspace}
\newcommand{\groth}{\ensuremath{\mathsf{Groth'16}}\xspace}
\newcommand{\kate}{\ensuremath{\mathsf{KZG}}\xspace}
\newcommand{\rel}{\ensuremath{\mathcal{R}}\xspace}
\newcommand{\ext}{\ensuremath{E}\xspace}
\newcommand{\params}{\ensuremath{\mathsf{params}_{\inst}}\xspace}
\newcommand{\protparams}{\ensuremath{\mathsf{params}_{\inst}^\advv}\xspace}
\num\newcommand{\p1}{\ensuremath{P_1}\xspace}
\newcommand{\advv}{\ensuremath{ {\mathcal A}^{\mathbf{*}}}\xspace} % the adversary that uses protocol adversary as black box
\newcommand{\crs}{\ensuremath{\sigma}\xspace}
%\num\newcommand{\crs1}{\ensuremath{\mathrm{\sigma}_1}\xspace}
%\num\newcommand{\crs2}{\ensuremath{\mathrm{\sigma}_2}\xspace}
\newcommand{\set}[1]{\ensuremath{\left\{#1\right\}}\xspace}
\newcommand{\hgen}{\ensuremath{\mathbf{g}}\xspace}
\renewcommand{\sim}{\ensuremath{\mathsf{sim}}\xspace}%the distribution of messages when \advv simulates message of \p1
\newcommand{\real}{\ensuremath{\mathsf{real}}\xspace}%the distribution of messages when \p1 is honest and \adv controls rest of players
\newcommand{\koevec}[2]{\ensuremath{(1,#1,\ldots,#1^{#2},\alpha,\alpha #1,\ldots,\alpha #1^{#2})}\xspace}
\newcommand{\mida}{\ensuremath{A_{\mathrm{mid}}}\xspace}
\newcommand{\midb}{\ensuremath{B_{\mathrm{mid}}}\xspace}
\newcommand{\midc}{\ensuremath{C_{\mathrm{mid}}}\xspace}
\newcommand{\chal}{\ensuremath{\mathsf{challenge}}\xspace}
\newcommand{\attackparams}{\ensuremath{\mathsf{params^{pin}}}\xspace}
\newcommand{\pk}{\ensuremath{\mathsf{pk}}\xspace}
\newcommand{\attackdist}[2]{\ensuremath{AD_{#1}}\xspace}
\renewcommand{\neg}{\ensuremath{\mathsf{negl}(\lambda)}\xspace}
\newcommand{\ro}{\ensuremath{{\mathcal R}}\xspace}
\newcommand{\elements}[1]{\ensuremath{\mathsf{elements}_{#1}}\xspace}
\num\newcommand{\elmpowers1}[1]{\ensuremath{\mathrm{\mathsf{e}}^1_{#1}}\xspace}
\num\newcommand{\elmpowers2}[1]{\ensuremath{\mathrm{\mathsf{e}}^2_{#1}}\xspace}
\newcommand{\elempowrs}[1]{\ensuremath{\mathsf{e}_{#1}}\xspace}
\newcommand{\secrets}{\ensuremath{\mathsf{secrets}}\xspace}
\newcommand{\polysofdeg}[1]{\ensuremath{\F_{< #1}[X]}\xspace}
\newcommand{\bivar}[1]{\ensuremath{\F_{< #1}[X,Y]}\xspace}
\newcommand{\sig}{\ensuremath{\mathscr{S}}\xspace}
\newcommand{\prot}{\ensuremath{\mathscr{P}}\xspace}
\newcommand{\PCscheme}{\ensuremath{\mathscr{S}}\xspace}
\newcommand{\protprime}{\ensuremath{\mathscr{P^*}}\xspace}
\newcommand{\sigprv}{\ensuremath{\mathsf{P_{sc}}}\xspace}
\newcommand{\sigver}{\ensuremath{\mathsf{V_{sc}}}\xspace}
\newcommand{\sigpoly}{\ensuremath{\mathsf{S_{\sigma}}}\xspace}
\newcommand{\idpoly}{\ensuremath{\mathsf{S_{ID}}}\xspace}
\newcommand{\idpolyevala}{\ensuremath{\mathsf{\bar{s}_{ID1}}}\xspace}
\newcommand{\sigpolyevala}{\ensuremath{\mathsf{\bar{s}_{\sigma1}}}\xspace}
\newcommand{\sigpolyevalb}{\ensuremath{\mathsf{\bar{s}_{\sigma2}}}\xspace}
\newcommand{\bctv}{\ensuremath{\mathsf{BCTV}}\xspace}
\newcommand{\PI}{\ensuremath{\mathsf{PI}}\xspace}
\newcommand{\PIb}{\ensuremath{\mathsf{PI_B}}\xspace}
\newcommand{\PIc}{\ensuremath{\mathsf{PI_C}}\xspace}
\newcommand{\dl}[1]{\ensuremath{\widehat{#1}}\xspace}
\newcommand{\obgen}{\ensuremath{\mathcal O}\xspace}
\newcommand{\PC}{\ensuremath{\mathscr{P}}\xspace}
\newcommand{\permscheme}{\ensuremath{\sigma_\mathscr{P}}\xspace}
\newcommand{\selleft}{\ensuremath{\mathbf{q_L}}\xspace}
\newcommand{\selright}{\ensuremath{\mathbf{q_R}}\xspace}
\newcommand{\selout}{\ensuremath{\mathbf{q_O}}\xspace}
\newcommand{\selmult}{\ensuremath{\mathbf{q_M}}\xspace}
\newcommand{\selconst}{\ensuremath{\mathbf{q_C}}\xspace}
\newcommand{\selectors}{\ensuremath{\mathcal{Q}}\xspace}
\newcommand{\lvar}{\ensuremath{\mathbf{a}}\xspace}
\newcommand{\vars}{\ensuremath{\mathcal{V}}\xspace}
\newcommand{\rvar}{\ensuremath{\mathbf{b}}\xspace}
\newcommand{\ovar}{\ensuremath{\mathbf{c}}\xspace}
\newcommand{\pubvars}{\ensuremath{\mathcal{I}}\xspace}
\newcommand{\assignment}{\ensuremath{\mathbf{x}}\xspace}
\newcommand{\constsystem}{\ensuremath{\mathscr{C}}\xspace}
\newcommand{\relof}[1]{\ensuremath{\rel_{#1}}\xspace}
\newcommand{\pubinppoly}{\ensuremath{\mathsf{PI}}\xspace}
\newcommand{\sumi}[1]{\sum_{i\in[#1]}}
\newcommand{\summ}[1]{\sum_{i\in[#1]}}
\newcommand{\sumj}[1]{\sum_{j\in[#1]}}
\newcommand{\ZeroH}{\ensuremath{Z_{H}} \xspace}
\newcommand{\lpoly}{\ensuremath{\mathsf{a}}\xspace}
\newcommand{\rpoly}{\ensuremath{\mathsf{b}}\xspace}
\newcommand{\opoly}{\ensuremath{\mathsf{c}}\xspace}
\newcommand{\idpermpoly}{\ensuremath{\mathsf{z}}\xspace}
\newcommand{\lagrangepoly}{\ensuremath{\mathsf{L}}\xspace}
\newcommand{\zeropoly}{\ensuremath{\mathsf{\ZeroH}}\xspace}
\newcommand{\selmultpoly}{\ensuremath{\mathsf{q_M}}\xspace}
\newcommand{\selleftpoly}{\ensuremath{\mathsf{q_L}}\xspace}
\newcommand{\selrightpoly}{\ensuremath{\mathsf{q_R}}\xspace}
\newcommand{\seloutpoly}{\ensuremath{\mathsf{q_O}}\xspace}
\newcommand{\selconstpoly}{\ensuremath{\mathsf{q_C}}\xspace}
\newcommand{\idcomm}{\ensuremath{[s_{\mathsf{ID1}}]_1}\xspace}
\newcommand{\sigcomma}{\ensuremath{[s_{\mathsf{\sigma1}}]_1}\xspace}
\newcommand{\sigcommb}{\ensuremath{[s_{\mathsf{\sigma2}}]_1}\xspace}
\newcommand{\sigcommc}{\ensuremath{[s_{\mathsf{\sigma3}}]_1}\xspace}
\newcommand{\selleftcomm}{\ensuremath{[q_\mathsf{L}]_1}\xspace}
\newcommand{\selrightcomm}{\ensuremath{[q_\mathsf{R}]_1}\xspace}
\newcommand{\seloutcomm}{\ensuremath{[q_\mathsf{O}]_1}\xspace}
\newcommand{\selconstcomm}{\ensuremath{[q_\mathsf{C}]_1}\xspace}
\newcommand{\selmultcomm}{\ensuremath{[q_\mathsf{M}]_1}\xspace}
\newcommand{\multlinecomment}[1]{\directlua{-- #1}}
\newtheorem{lemma}{Lemma}[section]
\newtheorem{thm}[lemma]{Theorem}
\newtheorem{dfn}[lemma]{Definition}
\newtheorem{remark}[lemma]{Remark}
\newtheorem{claim}[lemma]{Claim}
\newtheorem{corollary}[lemma]{Corollary}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\R}{\mathcal{R}}
\newcommand{\crct}{\ensuremath{\mathsf{C}}\xspace}
\newcommand{\A}{\mathcal{A}}
%\newcommand{\G}{\mathcal{G}}
\newcommand{\Gr}{\mathbb{G}}
%\newcommand{\com}{\textsf{com}} Ariel defined equivalent that also works in math mode
\newcommand{\cgen}{\text{cgen}}
\newcommand{\poly}{\ensuremath{\mathsf{poly(\lambda)}}\xspace}
\newcommand{\snark}{\ensuremath{\mathsf{snark}}\xspace}
\newcommand{\grandprod}{\mathsf{prod}}
\newcommand{\perm}{\mathsf{perm}}
%\newcommand{\open}{\mathsf{open}}
\newcommand{\update}{\mathsf{update}}
\newcommand{\Prove}{\mathcal{P}}
\newcommand{\Verify}{\mathcal{V}}
\newcommand{\Extract}{\mathcal{E}}
\newcommand{\Simulate}{\mathcal{S}}
\newcommand{\Unique}{\mathcal{U}}
\newcommand{\Rpoly}{\R{\poly}}
\newcommand{\Ppoly}{\Prove{\poly}}
\newcommand{\Vpoly}{\Verify{\poly}}
\newcommand{\Psnark}{\prv}%{\Prove{\snark}}
\newcommand{\Vsnark}{\ver}%{\Verify{\snark}}
\newcommand{\Rprod}{\R{\grandprod}}
\newcommand{\Pprod}{\Prove{\grandprod}}
\newcommand{\Vprod}{\Verify{\grandprod}}
\newcommand{\Rperm}{\R{\perm}}
\newcommand{\Pperm}{\Prove{\perm}}
\newcommand{\Vperm}{\Verify{\perm}}
% \newcommand{\zw}[1]{{\textcolor{magenta}{Zac:#1}}}
% \newcommand{\ag}[1]{{\textcolor{blue}{\emph{Ariel:#1}}}}
\newcommand{\prob}{\ensuremath{\mathrm{Pr}}\xspace}
\newcommand{\extprot}{\ensuremath{E_{\prot}}\xspace}
\newcommand{\transcript}{\ensuremath{\mathsf{transcript}}\xspace}
\newcommand{\extpc}{\ensuremath{E_{\PCscheme}}\xspace}
\newcommand{\advpc}{\ensuremath{\mathcal A_{\PCscheme}}\xspace}
\newcommand{\advprot}{\ensuremath{\mathcal A_{\prot}}\xspace}
\newcommand{\protmany}{\ensuremath{ {\prot}_k}\xspace}
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\newcommand{\marlin}{\ensuremath{\mathsf{Marlin}}\xspace}
\newcommand{\fractal}{\ensuremath{\mathsf{Fractal}}\xspace}
\newcommand{\tlo}{\ensuremath{\mathsf{t_{lo}}}\xspace}
\newcommand{\tprimelo}{\ensuremath{\mathsf{t'_{lo}}}\xspace}
\newcommand{\tmid}{\ensuremath{\mathsf{t_{mid}}}\xspace}
\newcommand{\tprimemid}{\ensuremath{\mathsf{t'_{mid}}}\xspace}
\newcommand{\thi}{\ensuremath{\mathsf{t_{hi}}}\xspace}
\newcommand{\tprimehi}{\ensuremath{\mathsf{t'_{hi}}}\xspace}
% \newcommand{\Rsnark}{\R{\snark}}
\newcommand{\Rsnark}{\R}
\begin{document}
\maketitle
\begin{abstract}
zk-SNARK constructions that utilize an updatable universal structured reference string remove one of the main obstacles in deploying zk-SNARKs\cite{firstUniversal}. The important work of Maller et al.\ \cite{sonic} presented \sonic\;- the first potentially practical zk-SNARK with fully succinct verification for general arithmetic circuits with such an SRS.
However, the version of \sonic enabling fully succinct verification still requires relatively high proof construction overheads. We present a universal SNARK construction with fully succinct verification, and significantly lower prover running time (roughly 7.5-20 times fewer group exponentiations than \cite{sonic} in the fully succinct verifier mode depending on circuit structure).
Similarly to \cite{sonic} we rely on a permutation argument based on Bayer and Groth \cite{permorig}. However, we focus on ``Evaluations on a subgroup rather than coefficients of monomials''; which enables simplifying both the permutation argument and the arithmetization step.
\end{abstract}
\section{Introduction}
%
% Zero-knowledge Succinct Non-interactive Arguments of Knowledge (zk-SNARKs) \cite{Kilian,Micali,BCCT} represent a category of zero-knowledge proofs that can be used to prove knowledge of a witness for arbitrary NP relations, without leaking any information about the witness. Additionally, proofs are a only polylogarithmic in the witness size.
%
% A setting that has gained much popularity is that of ``SNARKs with preprocessing'' (cf. e.g., \cite{GGPR}) where a one-time expensive computation of the verifier is allowed, in which a \emph{Structured Reference String} (SRS) is constructed. The advantage of this setting is potentially enabling polylogarithmic proof size and verification time also for non-uniform lang ugages.
%
% More concretely, of great recent interest is the \emph{circuit satisfiability problem}, where given a public assignment for the values of a few of circuit wires, one wishes to demonstrate knowledge of an assignment to the rest of the wires that is consistent with the circuit computation.
%
% Of great practical interest is having the preprocessing phase depend
%
%
% More concretely, when
% In what we call here a \emph{fully succinct} zk-SNARK
% \footnote{Intuitively, one might consider polylogarithmic verification time a necessity for any SNARK, making the term ``fully succinct'' superflous. However, e.g., \cite{GGPR} only require polylogarithmic proof size in a SNARK; and in case verification time is also polylogarithmic call the SNARK \emph{unsubtle}.}
% both the size of these proofs and the computation time are required to be polylogarithmic in witness size.
Due to real-world deployments of zk-SNARKs, it has become of significant interest to have the structured reference string (SRS) be constructible in a ``universal and updatable'' fashion. Meaning that the same SRS can be used for statements about all circuits of a certain bounded size; and that at any point in time the SRS can be updated by a new party, such that the honesty of only one party from all updaters up to that point is required for soundness.
For brevity, let us call a zk-SNARK with such a setup process \emph{universal}.
For the purpose of this introduction, let us say a zk-SNARK for circuit satisfiability is \emph{fully succinct}
if
% In this paper, we are interested in zk-SNARKs that are \emph{universal and fully succinct} in the following sense.
\begin{enumerate}
\item The preprocessing\footnote{We use the term SNARK in this paper for what is sometimes called a ``SNARK with preprocessing''(see e.g. \cite{GGPR}) where one allows a one-time verifier computation that is polynomial rather than polylogarithmic in the circuit size. In return, the SNARK is expected to work for all \emph{non-uniform circuits}, rather than only statements about uniform computation.}
phase/SRS generation run time is quasilinear in circuit size.
\item The prover run time is quasilinear in circuit size.
\item The proof length is logarithmic\footnote{From a theoretical point of view, polylogarithmic proof length is more natural; but logarithmic nicely captures recent constructions with a constant number of group elements, and sometimes is a good indication of the ``practicality barrier''.} in circuit size.
\item The verifier run time is polylogarithmic in circuit size.\footnote{
In many definitions, only proof size is required to be polylogarithmic.
For example, in the terminology of \cite{GGPR}, additionally requiring polylogarithmic verifier run time means the SNARK is \emph{unsubtle}.}
\end{enumerate}
Maller et al.\ \cite{sonic} constructed for the first time a universal fully succinct zk-SNARK for circuit satisfiability, called \sonic.
% Zero-Knowledge Succinct Non-interactive Arguments of Knowledge represent a category of zero-knowledge proofs that can be used to prove arbitrary NP relations, whilst hiding the values of the inputs and/or outputs of the relation. Both the size of these proofs and the computation time required to verify these proofs are constant, regardless of the complexity of the NP relation in question.
% \\
% \\
% This technology is extremely useful in contexts where one must validate an NP relation in a resource or bandwidth-constrained environment. Of particular relevance are distributed ledger technologies, where transaction throughputs are low and data privacy guarantees are minimal. ZK-SNARKs represent a viable solution to both of these problems, but are constrained by the requirement to enact a `trusted setup', where trusted parties must utilizes trapdoors (commonly referred to as `toxic waste') to add structure into a common reference string that is unique to a single SNARK-encoded NP relation. If knowledge of the toxic waste is leaked to an adversary, they can break the soundness of the SNARK protocol in question. This requirement to run a trusted setup is a significant impediment to the practical deployment of ZK-SNARK based proving systems.
% \\
% \\
% `Universal' ZK-SNARKs are a category of ZK-SNARKs that only require a single trusted setup ceremony, to generate a structured reference string that can be used to encode any NP relation up to a certain size determined by the size of the SRS. This removes the key limitation of ZK-SNARKs, as one can construct an arbitrary number of ZK-SNARK `circuits' without having to run additional setup ceremonies. The structured reference string is also updatable, allowing one to add additional randomness into the SRS if there are concerns regarding the security of the original trusted setup ceremony.
% \\
% \\
% The first practical universal ZK-SNARK was the SONIC protocol~\cite{sonic}. However, SONIC relies on `helper' entities to batch validate proofs. To obtain a fully succinct construction, without helpers, both proof construction times and proof verification times suffer considerably.
% \\
% \\
% We present a new universal ZK-SNARK construction that uses Lagrange bases to significantly improve both proof sizes, proof construction times, proof verification times and the overall size of the required structured reference string. This new ZK-SNARK construction is succinct by design and does not rely on helpers, or batch verification of proofs.
\cite{sonic} also give a version of \sonic with dramatically improved prover run time, at the expense of efficient verification only in a certain amortized sense.
\subsection{Our results}
In this work we give a universal fully-succinct zk-SNARK with significantly improved prover run time compared to fully-succinct \sonic.
At a high level our improvements stem from a more direct arithmetization of a circuit as compared to the \cite{Bootle}-inspired arithmetization of \cite{sonic}. This is combined with a permutation argument over univariate evaluations on a multiplicative subgroup rather than over coefficients of a bivariate polynomial as in \cite{sonic}.
In a nutshell, one reason multiplicative subgroups are useful is that several protocols, including \sonic, use a permutation argument based on Bayer and Groth \cite{permorig}. Ultimately, in the ``grand product argument'', this reduces to checking relations between coefficients of polynomials at ``neighbouring monomials''.
We observe that if we think of the points $x,\hgen\cdot x$ as neighbours, where \hgen is a generator of a multiplicative subgroup of a field \F, it is very convenient to check relations between different polynomials at such pairs of points.
A related convenience is that multiplicative subgroups interact well with Lagrange bases.
For example, suppose $H\subset \F$ is a multiplicative subgroup of order $n+1$, and $x\in H$. The polynomial $L_x$ of degree at most $n$ that vanishes on $H\setminus\set{x}$ and has $L_x(x)=1$, has a very sparse representation of the form
\[L_x(X)= \frac{c_x(X^{n+1}-1)}{(X-x)},\]
for a constant $c_x$.
This is beneficial when constructing an efficiently verifiable \cite{permorig}-style permutation argument in terms of polynomial identities.
%
% \subsection{Overview of techniques (messy Rant at this point}
% Permutation arguments are central to SNARK constructions with a universal SRS.
%
% Main technical point - permutation argument is more efficient when on mult subgroup in univariate poly.
%
% Sonic work hader cause degree larger, bivariate, no subgroup
%
%
% \sonic's fully succinct verification mode relies on a ``permutation argument''. However, they use a starting point
% a rather complex arithmetization based on Bootle et al.\ \cite{Bootle}.
%
% We notice here, as is implicit in other works e.g. \cite{BCGRS}, that a permutation argument suffices for a more direct and simple arithmetization, especially when using a ``permutation of values rather than monomials''.
%
% To demonstrate this, let us look at a simplified instance when our arithmetic circuit
% \begin{itemize}
% \item Contains only multiplication gates.
% \item The number $n$ of circuit wires is equal to the number of gates.
% \item Every wire is the left, right, and output wire of exactly one gate.
% \end{itemize}
% Now define three permutations $L,R,O$ of $[n]$
% such that
% \begin{itemize}
% \item $L(i)$ is the left\footnote{In the actual construction we assume $L$ is the identity premutation as an efficiency optimization.} wire of the $i$'th gate.
% \item $R(i)$ is the right wire of the $i$'th gate.
% \item $O(i)$ is the output wire of the $i$'th gate.
% \end{itemize}
%
%
% Suppose now we are given polynomials $W_L,W_R,W_O\in \polysofdeg{n}$ and are guaranteed that
% for some fixed $W\in \polysofdeg{n}$, for each $i\in [n]$,
% $W_L(i) = W(L(i)), W_R(i)=W(R(i)),W_O(i) =W(O(i))$.
%
% In that case, we have that that values $\sett{W(i)}f{i \in [n]}$ are a satisfying assignment for the circuit if and only if,
% for each $i\in H$
% \[W_L(i)\cdot W_R(i) =W_O(i)\]
% which is equivalent to $P\defeq W_L\cdot W_R-W_O$ being divisible by $\ZeroH$.
\subsection{Efficiency Analysis}
We compare the performance of this work to the state of the art, both for non-universal SNARKs and universal SNARKs. At the time of publication, the only fully succinct universal SNARK construction is (the fully-succinct version of) the \sonic protocol~\cite{sonic}. This protocol requires the prover compute $273n$ \G1 group exponentiations, where $n$ is the number of multiplication gates. In fully-succinct \sonic, every wire can only be used in three linear relationships, requiring the addition of `dummy' multiplication gates to accommodate wires used in more than three addition gates. This increase in the multiplication gate count is factored into the prover computation estimate (see~\cite{sonic} for full details).
Our universal SNARK requires the prover to compute 5 polynomial commitments, combined with two opening proofs to evaluate the polynomial commitments at a random challenge point. There are two ``flavours''of \plonk to suit the tastes of the user. By increasing the proof size by two group elements, the total prover computations can be reduced by $\approx10\%$. The combined degree of the polynomials is either $9(n + a)$ (larger proofs) or $11(n + a)$ (smaller proofs, reduced verifier work), where $n$ is the number of multiplication gates and $a$ is the number of addition gates.
Currently, the most efficient fully-succinct SNARK construction available is Groth's 2016 construction~\cite{Groth16}, which requires a unique, non-updateable CRS per circuit. Proof construction times are dominated by $3n + m$ \G1 and $n$ \G2 group exponentiations, where $m$ is formally the number of R1CS variables, and is typically bounded by $n$ (for the rest of this section, the reader may assume $m=n$ for simplicity). If we assume that one \G2 exponentiation is equivalent to three \G1 exponentiations, this yields $6n + m$ equivalent \G1 group exponentiations.
Performing a direct comparison between these SNARK arithmetisations requires some admittedly subjective assumptions. When evaluating common circuits, we found that the number of addition gates is ~2x the number of multiplication gates, however circuits that are optimized under the assumption that addition gates are `free' (as is common in R1CS based systems like \cite{Groth16}) will give worse estimates.
At one extreme, for a circuit containing no addition gates and only fan-in-2 multiplication gates, our universal SNARK proofs require $\approx 1.1$ times more prover work than \cite{Groth16}, and $\approx 30$ times fewer prover work than \sonic. If $a = 2n$, the ratios change to $\approx 2.25$ times more prover work than \cite{Groth16}, and $\approx 10$ times less work than \sonic. If $a = 5n$, this changes to $\approx3$ times more work than \cite{Groth16}, and $\approx 5$ times less work than \sonic. We should note that these comparisons are only comparing the required number of group exponentiations.
We also note that the degree of \plonk's structured reference string is equal to the number of gates in a circuit (if one uses the "fast" flavour of \plonk). This is a significant reduction in the SRS size compared to the state of the art.
\begin{table}[!htbp]
\caption{Prover comparison. $m$ = number of wires, $n$ = number of multiplication gates, $a$ = number of addition gates}
\centering
\begin{adjustbox}{width=1\textwidth}
\begin{tabular}{l|l|l|l|l|l|l}
& \thead{size $\leq d$\\ SRS} & \thead{size $=n$\\ CRS/SRS} & \thead{prover\\ work} & \thead{proof\\ length} & \thead{succinct} & \thead{universal} \\ \hline
\groth
& - & $3n + m$ \G1 & \makecell[l]{$3n + m - \ell$ \G1 exp, \\ $n$ \G2 exp} & $2$ \G1, $1$ \G2 & \cmark & \xmark \\ \hline
\sonic (helped) & $12d$ \G1, $12d$ \G2 & $12n$ \G1 & $18n$ \G1 exp & $4$ \G1, $2$ $\F$ & \xmark & \cmark \\ \hline
\sonic (succinct) & $4d$ \G1, $4d$ \G2 & $36n$ \G1 & $273n$ \G1 exp & $20$ \G1, $16$ \F & \cmark & \cmark \\ \hline
\auroralight & $2d$ \G1, $2d$ \G2 & $2n$ \G1 & $8n$ \G1 exp & $6$ \G1, $4$ \F & \xmark & \cmark \\ \hline
This work (small) & $3d$ \G1, $1$ \G2 & $3n + 3a$ \G1, $1$ \G2 & \makecell[l]{$11n + 11a$ \G1 exp , \\ $\approx54(n+a)\text{log}(n+a)$ \F mul} & $7$ \G1, $6$ \F & \cmark & \cmark \\ \hline
This work (fast prover) & $d$ \G1, $1$ \G2 & $n + a$ \G1, $1$ \G2 & \makecell[l]{$9n + 9a$ \G1 exp , \\ $\approx54(n+a)\text{log}(n+a)$ \F mul} & $9$ \G1, $6$ \F & \cmark & \cmark \\ \hline
\end{tabular}
\end{adjustbox}
\label{table:prover-work}
\end{table} \
When comparing proof construction, we also include the number of field multiplications for \plonk, as the number of fast-fourier-transforms required to construct proofs is non-trivial. All other succinct universal SNARK constructions also have high FFT transform costs, however given the difficulty of finding hard numbers, we cannot include them in the above table. Qualitative analysis suggests that the FFTs consume slightly less compute time than the \G1 group exponentiations. More details on the number of field multiplications are given in section~\ref{sec:benchmarks}.
\\
\\
Verifier computation per proof is shown in table~\ref{table:verifier-work}. Only two bilinear pairing operations are required, due to the simple structure of the committed prover polynomials. In addition, the $\G2$ elements in each pairing are fixed, enabling optimizations that reduce pairing computation time by $\approx 30\%$~\cite{CCSD10}.
%(TODO: ask Mary about how many group exponentiations SONIC verifiers require?)
\begin{table}[!htbp]
\caption{Verifier comparison per proof, $P$=pairing, $\ell$=num of pub inputs. For non-succinct protocols, additional helper work is specified}
\centering
\begin{tabular}{l|l|l|l}
& \thead{verifier\\ work} & \thead{elem. from\\ helper} & \thead{extra verifier \\ work in\\ helper mode} \\ \hline
\groth & $3P$, $\ell$ \G1 exp & - & - \\ \hline
\sonic (helped) & $10P$ & $3$ \G1, $2$ \F & $4P$ \\ \hline
\sonic (succinct) & $13P$ & - & - \\ \hline
\auroralight & $5P$, $6$ \G1 exp & $8$ \G1, $10$ \F & $12P$ \\ \hline
This work (small) & $2P$, $16$ \G1 exp & - & - \\ \hline
This work (fast prover) & $2P$, $18$ \G1 exp & - & - \\ \hline
\end{tabular}
\label{table:verifier-work}
\end{table}
% \subsection{On the subject of arithmetic gates}
%
% We have presented our main results in terms of fan-in two circuits with addition and multiplication gates.
% However, we think it is worth noting that \plonk enables more flexibility in the gate choice; as opposed to some other previous pairing based SNARKs. For example, as \cite{Groth16}'s verifier is based on evaluating an identity at a hidden challenge point using a pairing, it is inherent that only degree two identities/gates can be used. \plonk SNARKs are under no such restrictions - as a polynomial commitment scheme is used to open the polynomials participating in the verifier check at a random point; after which any identity can be checked. It is possible to add highly custom arithmetic "gates" into a \plonk proving system, that are tailored to a specific use-case. For example, one could define a "gate" that evaluates a MiMC hash round~\cite{albrecht2016mimc}, or a gate that accumulates base-3 integers into a sum.
% \\
% \\
% At a higher level, it is possible to construct and verify \plonk circuits using any cryptosystem that supports a succinct polynomial commitment scheme.
\cleardoublepage
\subsection{Performance and Benchmarks} \label{sec:benchmarks}
\begin{figure}[h]
\begin{tikzpicture}[every axis/.append style={width=0.5\linewidth,title style={align=center}}]
\begin{axis}[
name=axis1,
title={\textsf{Proof construction time}},
xlabel={\textsf{Number of gates}},
ylabel={\textsf{Time (s)}},
xmode=log,
ymode=log,
log basis x={2},
ymin={0.1},
ymax={40},
xtick=data,
]
\addplot plot coordinates {
(8192, 0.19)
(16384, 0.38)
(32768, 0.80)
(65536, 1.49)
(131072, 2.89)
(262144, 5.55)
(524288, 11.77)
(1048576, 22.83)
};
\end{axis}
\begin{axis}[
name=axis2,
at={(axis1.outer north east)},anchor=outer north west,
title={\textsf{Circuit preprocessing time}},
xlabel={\textsf{Number of gates}},
ylabel={\textsf{Time (s)}},
xmode=log,
ymode=log,
log basis x={2},
ymin={0.1},
ymax={40},
xtick=data,
]
\addplot plot coordinates {
(8192, 0.12)
(16384, 0.22)
(32768, 0.38)
(65536, 0.77)
(131072, 1.50)
(262144, 2.73)
(524288, 5.34)
(1048576, 11.57)
};
\end{axis}
\begin{axis}[
name=axis3,
at={(axis1.outer south west)},anchor=outer north west,
title={\textsf{Proof verification time}},
xlabel={\textsf{Number of gates}},
ylabel={\textsf{Time (ms)}},
xmode=log,
log basis x={2},
xtick=data,
ytick={0,2,4,6,8,10},
ymin={0},
ymax={10}
]
\addplot plot coordinates {
(8192, 1.4)
(16384, 1.2)
(32768, 1.3)
(65536, 1.4)
(131072, 1.4)
(262144, 1.3)
(524288, 1.3)
(1048576, 1.3)
};
\end{axis}
\end{tikzpicture}
\caption{Benchmarks for test \plonk circuits using the BN254 curve. Does not include witness generation. Tests performed on a Surface pro 6 with 16GB RAM and a core i7-8650U CPU, utilizing all 8 logical/4 physical cores.}
\label{Fig:benchmarks}
\end{figure}
Figure~\ref{Fig:benchmarks} provides some estimates for the time required to construct and verify \plonk proofs. The benchmarks in question utilize the BN254 elliptic curve, using the \href{https://github.com/AztecProtocol/barretenberg}{Barretenberg ecc library}.
\\
\\
Even for circuits with over a million gates, \plonk proofs are capable of being constructed on consumer-grade hardware in under 23 seconds. This marks a significant advancement in the efficiency of universal SNARKs, which are now practical for a wide range of real-world use-cases.
\\
\\
Circuit preprocessing is a one-off computation, required for each program codified into a \plonk circuit. This step generates the polynomial commitments to the `selector' polynomials required to verify proofs.
\\
\\
When constructing proofs, the time taken to perform the required fast fourier transforms is comparable to the time taken for elliptic curve scalar multiplications. The number of field multiplications in table~\ref{table:prover-work} is obtained from $8$ FFTs of size $4n$, $5$ FFTs of size $2n$ and $12$ FFTs of size $n$.
\\
\\
The number of FFT transforms can be significantly reduced, if a circuit's preprocessed polynomials are provided as evaluations over the $4n$'th roots of unity (instead of in Lagrange-base form). However, given this dramatically increases the amount of information required to construct proofs, we omit this optimisation from our benchmarks.
We conclude the introduction with a comparision to relevant concurrent work.
\subsection{Comparison with the randomized sumcheck approach, and \fractal/\marlin:}
Roughly speaking, all succinct proving systems work by using randomness to compress many constraint checks into one.
The general way to obtain such compression, is by taking a random linear combination of the constraints.
In the case of R1CS and similar systems, the more difficult constraints to be compressed are linear relations between the system variables, i.e. constraints of the form
$<a_i,x>=0$ where $x\in \F^m$ are the system variables, and $a_i\in \F^m$ represents one of the constraints.\footnote{We emphasize that the vector $a_i$ here does not precisely correspond to one of the r1cs matrix rows, but rather to a ``flattening'' of it, i.e. it is a constraint of the form $y=\sum a'_{i,j} x_j$ where $a'_i$ is one the r1cs matrix rows.}
These are analogous to the less general ``wiring constraints'' in a circuit satisfiability statement, which
have the form $x_i=x_j$ (e.g. when $x_i$ represents the output wire of a gate $G$, and $x_j$ an input wire from $G$ into another gate $G'$).
A random\footnote{It is a standard derandomization trick to use powers of a single random $r\in \F$ rather than random independent $r_i$.} linear combination of linear constraints might have the form
\[\sum_{i\in [n]} r^i <a_i,x>=0 \]
for a unifrom $r\in \F$
Skipping some details, \cite{sonic} and the subsequent work of \cite{auroralight} (relying on \cite{aurora}) reduce such a check to evaluating a degree $n$ bivariate $S$ at a random point; \emph{such that the number of non-zero monomials in $S$ corresponds to the number of non-zero entries in the constraint vectors \sett{a_i}{i\in [n]}}.
\cite{sonic} at this point devise a clever strategy to amortize the cost of many evaluations of $S$ across many proofs.
This variant of \cite{sonic} is much more prover efficient, but not fully succinct because of the need for the verifier to compute at least one evaluation of $S$ by themselves.
Thus, the barrier to a fully succinct version of the more prover efficient version of \sonic (and for a fully succinct version of \cite{
auroralight}), is a method to efficiently verify an evaluation $S(z,y)$ in the case $S$ only contains $O(n)$ non-zero monomials.
A significant technical contribution of the recent concurrent \fractal and \marlin systems \cite{marlin,fractal}
is a solution to this problem ``in Lagrange Basis''.
Specifically, suppose that $H,K$ are multiplicative subgroups of size $O(n)$ of \F such that $S$ has only $M$ non-zero values on $H\times K$; then \cite{marlin,fractal} devise a protocol to convince a succinct verifier that $S(z,y)=t$ where the prover's work is linear in $M$. This is a good point to note that the solution to this problem by the natural generalization of \cite{kate} to a bi-variate polynomial commitment scheme would have led to $O(n^2)$ proving time.
Coming back to \plonk, the reason we don't require this ``bi-variate evaluation breakthrough'' is that we focus on constant fan-in circuits rather than R1CS/unlimited addition fan-in; and thus our linear constraints are just wiring constraints that can be reduced to a permutation check (as explained in Sections \ref{subsec:copychecks}, \ref{sec:constsystems}). One way to interpret the \cite{permorig} technique is that ``linear constraints that correspond to a permutation can be more simply combined than general linear constraints''. For example, in the above equation each constraint is \emph{multiplied} by a distinct random coefficient, whereas in the \cite{permorig} randomization, it suffices in a sense to \emph{add} the same random shift to each variable value. (See the permutation protocol in Section \ref{sec:permprotocol} for details.)
\paragraph{Concrete comparison to Marlin}
While \fractal leverages the sparse bi-variate evaluation technique in the context of transparent recursive SNARKs, \marlin focuses on constructing a fully succinct (universal) SNARK as in this paper.
It is not completely straightforward to compare this work and \cite{marlin}, as we are in
the realm of concrete constants, and the basic measure both works use is different.
While we take our main parameter $n$ to be the number of addition and multiplication gates in a fan-in two circuit;
\cite{marlin} use as their main parameter the maximal number of non-zeroes in one of the three matrices describing an R1CS. For the same value of $n$ \plonk outperforms \marlin, e.g. by roughly a 2x factor in prover group operations and proof size.
In the extreme case of a circuit with only multiplication gates, this would indeed represent the performance difference between the two systems.
However, in constraint systems with ``frequent large addition fan-in'' \marlin may outperform the currently specified variant\footnote{It seems that the natural variants of \plonk where the addition fan-in is increased to three or four according to the instance could outperform the current numbers given in \marlin for any R1CS.} of \plonk.
For example, this happens in the extreme case of one ``fully dense'' R1CS constraint
\[\left(\sum_{j\in [m]} a_jx_j \right)\cdot \left( \sumj{m} b_jx_j\right) = \sumj{m}c_jx_j.\]
where $a,b,c\in \F^m$ have all non-zero entries.
Morever, it seems ideas implicit in \fractal, or alternatively a ``plug-in'' of the mentioned sparse bi-variate evaluation protocol into \cite{auroralight} will lead to improved performance via this route;
especially in cases where some of the prover work can be delegated to an outside helper (in \plonk there is less opportunity for such delegation, as the wiring is checked on the witness itself, whereas in \cite{auroralight,marlin,fractal} it is in a sense checked on the random coefficients of the verifier).
\section{Preliminaries}
\subsection{Terminology and Conventions}\label{sec:terminology}
We assume our field \F is of prime order.
%We assume we have a
%multiplicative subgroup $H \subset F$ of size $|H| = n$ where $n$ is the number of constraints in our R1CS.
%and denote for simplicity the elements of H as H = {1, . . . , m}.
%We assume the number of private variables n is equal to m.
We denote by \polysofdeg{d} the set of univariate polynomials over \F of degree smaller than d.
We assume all algorithms described receive as an implicit parameter the security parameter $\lambda$.
Whenever we use the term “efficient”, we mean an algorithm running in time \poly. Furthermore,
we assume an “object generator” \obgen that is run with input $\lambda$ before all protocols, and returns all fields and groups used. Specifically, in our protocol $\obgen(\lambda) = (\F, \G1, \G2, \Gt, e, g_1, g_2,g_t)$ where
\begin{itemize}
\item \F is a prime field of super-polynomial size $r = \lambda^{\omega(1)}$
.
\item $\G1,\G2,\Gt$ are all groups of size $r$, and $e$ is an efficiently computable non-degenerate pairing
$e : \G1 \times \G2 \to \Gt$.
\item $g_1,g_2$ are uniformly chosen generators such that $e(g_1, g_2) = g_t$.
\end{itemize}
We usually let the $\lambda$ parameter be implicit, i.e.\ write \F instead of $\F(\lambda)$.
We write \G1 and \G2 additively. We use the notations $\enc1{x}\defeq x\cdot g_1$ and $\enc2{x}\defeq x\cdot g_2$.
We often denote by $[n]$ the integers \set{1,\ldots,n}.
% For example, when we refer below to the field $\F$, it is in fact a function $\F(\lambda)$ of $\lambda$, and part of
% the output of $\obgen(\lambda)$.
We use the acronym e.w.p for ``except with probability''; i.e. e.w.p $\gamma$ means with probability \emph{at least} $1-\gamma$.
\paragraph{universal SRS-based public-coin protocols}
We describe public-coin (meaning the verifier messages are uniformly chosen) interactive protocols between a prover and verifier; when deriving results for non-interactive protocols, we implicitly assume we can get a proof length equal to the total communication of the prover, using the Fiat-Shamir transform/a random oracle. Using this reduction between interactive and non-interactive protocols, we can refer to the ``proof length'' of an interactive protocol.
We allow our protocols to have access to a structured reference string (SRS) that can be derived in deterministic \poly-time from an ``SRS of monomials'' of the form
\sett{\enc1{x^i}}{a\leq i \leq b}, \sett{\enc2{x^i}}{c\leq i \leq d}, for uniform $x\in \F$,
and some integers $a,b,c,d$ with absolute value bounded by \poly.
It then follows from Bowe et al. \cite{SecondMPC} that the required SRS can be derived in a universal and updatable setup requiring only one honest participant; in the sense that an adversary controlling all but one of the participants in the setup does not gain more than a \negl advantage in its probability of producing a proof of any statement.
For notational simplicity, we sometimes use the SRS \srs0 as an implicit parameter in protocols, and do not explicitly write it.
\subsection{Analysis in the AGM model}\label{subsec:AGM}
For security analysis we will use the Algebraic Group Model of Fuchsbauer, Kiltz and Loss\cite{AGM}.
In our protocols, by an \emph{algebraic adversary} \adv in an SRS-based protocol we mean a \poly-time algorithm which satisfies the following.
\begin{itemize}
\item For $i\in \set{1,2}$, whenever \adv outputs an element $A\in \Gi$, it also outputs a vector $v$ over \F such that $A = <v,\srsi>$.
\end{itemize}
\paragraph{Idealized verifier checks for algebraic adversaries}
We introduce some terminology to capture the advantage of analysis in the AGM.
First we say our \srs0 \emph{has degree $Q$} if all elements of \srsi are of the form \enci{f(x)} for $f\in \polysofdeg{Q}$ and uniform $x\in \F$. In the following discussion let us assume we are executing a protocol with a degree $Q$ SRS, and denote by $f_{i,j}$ the corresponding polynomial for the $j$'th element of \srsi.
Denote by $a,b$ the vectors of $\F$-elements whose encodings in $\G1,\G2$ an algebraic adversary \adv outputs during a protocol execution; e.g., the $j$'th $\G1$ element output by \adv is \enc1{a_j}.
By a ``real pairing check'' we mean a check of the form
\[(a\cdot T_1) \cdot (T_2\cdot b)=0\]
for some matrices $T_1,T_2$ over $\F$.
Note that such a check can indeed be done efficiently given the encoded elements and the pairing function $e:\G1\times \G2\to \Gt$.
Given such a ``real pairing check'', and the adversary \adv and protocol execution during which the elements were output, define the corresponding ``ideal check'' as follows.
Since \adv is algebraic when he outputs \enci{a_j} he also outputs a vector $v$ such that, from linearity, $a_j = \sum v_\ell f_{i,\ell}(x)=R_{i,j}(x)$ for $R_{i,j}(X) \defeq \sum v_\ell f_{i,\ell}(X)$.
Denote, for $i\in \set{1,2}$ the vector of polynomials $R_i=(R_{i,j})_j$.
The corresponding ideal check, checks as a polynomial identity whether
\[(R_1 \cdot T_1)\cdot (T_2\cdot R_2) \equiv 0\]
The following lemma is inspired by \cite{AGM}'s analysis of \cite{Groth16},
and tells us that for soundness analysis against algebraic adversaries it suffices to look at ideal checks.
Before stating the lemma we define the $Q$-DLOG assumption similarly to \cite{AGM}.
\begin{dfn}\label{ref:qdlog}
Fix integer $Q$. The \emph{$Q$-DLOG assumption for $(\G1,\G2)$} states that given
\[\enc1{1},\enc1{x},\ldots,\enc1{x^Q},\enc2{1},\enc2{x},\ldots,\enc2{x^Q}\]
for uniformly chosen $x\in \F$, the probability of an efficient \adv outputting $x$
is \negl.
\end{dfn}
\begin{lemma}\label{lem:AGManalysis}
Assume the $Q$-DLOG for $(\G1,\G2)$.
Given an algebraic adversary \adv participating in a protocol with a degree $Q$ SRS,
the probability of any real pairing check passing is larger by at most an additive \negl factor than the probability the corresponding ideal check holds.
\end{lemma}
\begin{proof}
Let $\gamma$ be the difference between the satisfiability of the real and ideal check.
We describe an adversary \advv for the $Q$-DLOG problem that succeeds with probability $\gamma$; this implies $\gamma=\negl$.
\advv receives the challenge
\[\enc1{1},\enc1{x},\ldots,\enc1{x^Q},\enc2{1},\enc2{x},\ldots,\enc2{x^Q}\]
and constructs using group operations the correct SRS for the protocol.
Now \advv runs the protocol with \adv, simulating the verifier role. Note that as \advv receives from \adv the vectors of coefficients $v$, he can compute the polynomials \set{R_{i,j}} and check if we are in the case that the real check passed but ideal check failed.
In case we are in this event, \advv computes
\[R\defeq (R_1 \cdot T_1)(T_2\cdot R_2). \]
We have that $R\in\polysofdeg{2Q}$ is a non-zero polynomial for which
$R(x)=0$. Thus \advv can factor $R$ and find $x$.
\end{proof}
\paragraph{Knowlege soundness in the Algebraic Group Model}
We say a protocol \prot between a prover \prv and verifier \ver for a relation \rel has \emph{Knowledge Soundness in the Algebraic Group Model} if there exists an efficient \ext such that
the probability of any algebraic adversary \adv winning the following game is \negl.
\begin{enumerate}
\item \adv chooses input \inp and plays the role of \prv in \prot with input \inp.
\item \ext given access to all of \adv's messages during the protocol (including the coefficients of the linear combinations) outputs \wit.
\item \adv wins if
\begin{enumerate}
\item \ver outputs \acc at the end of the protocol, and
\item $(\inp,\wit)\notin \rel$.
\end{enumerate}
\end{enumerate}
\section{A batched version of the \cite{kate} scheme}\label{sec:kate}
Crucial to the efficiency of our protocol is a batched version of the \cite{kate} polynomial commitment scheme (PCS) similar to Appendix C of \cite{sonic}, allowing to query multiple committed polynomials at multiple points.
%We are able to use the simplier original \cite{kate} scheme, as we do not care about exact degree bound.
We begin by defining polynomial commitment schemes in a manner conducive to our protocol.
Specifically, we define the \open procedure in a batched setting having multiple polynomials and evaluation points.
\begin{dfn}\label{dfn:PCscheme}
A $d$-polynomial commitment scheme consists of
\begin{itemize}
\item $\gen(d)$ - a randomized algorithm that outputs an SRS \srs0.
\item $\com(f,\srs0)$ - that given a polynomial $f\in \polysofdeg{d}$ returns a commitment \cm to $f$.
\item A public coin protocol \open between parties \prvpc and \verpc. \prvpc is given $ f_1,\ldots,f_t \in \polysofdeg{d}$. \prvpc and \verpc are both given integer $t=\poly$, $\cm_1,\ldots,\cm_t$ - the alleged commitments to $f_1,\ldots,f_t$, $z_1,\ldots,z_t\in\F$ and $s_1,\ldots,s_t\in \F$ - the alleged correct openings $f_1(z_1),\ldots,f_t(z_t)$. At the end of the protocol \verpc outputs \acc or \rej.
\end{itemize}
such that
\begin{itemize}
\item \textbf{Completeness:} Fix integer $t$, $z_1,\ldots,z_t\in \F$, $f_1,\ldots,f_t \in \polysofdeg{d}$.
Suppose that for each $i\in [t]$, $\cm_i = \com(f_i,\srs0)$. Then if \open is run correctly with values
$t, \sett{\cm_i,z_i,s_i=f_i(z_i)}{i\in [t]}$, \verpc outputs \acc with probability one.
\item \textbf{Knowledge soundness in the algebraic group model:} There exists an efficient \ext such that for any algebraic adversary \adv the probability of \adv winning the following game is \negl over the randomness of \adv and \gen.
\begin{enumerate}
\item Given \srs0, \adv outputs $t,\cm_1,\ldots,\cm_t$.
\item \ext, given access to the messages of \adv during the previous step, outputs $f_1,\ldots,f_t \in \polysofdeg{d}$.
\item \adv outputs $ z_1,\ldots,z_t \in \F$, $s_1,\ldots,s_t \in \F$.
\item \adv takes the part of \prvpc in the protocol \open with inputs
$\cm_1,\ldots,\cm_t,z_1,\ldots,z_t,s_1,\ldots,s_t$.
\item $\adv$ wins if
\begin{itemize}
\item \verpc outputs \acc at the end of the protocol.
\item For some $i\in [t]$, $s_i\neq f_i(z_i)$.
\end{itemize}
\end{enumerate}
\end{itemize}
\end{dfn}
\begin{remark}
Note that the above notion of knowledge soundness for a PCS does not coincide with that of knowledge soundness for a \emph{relation} as defined in Section \ref{subsec:AGM}. The goal is to capture the notion of \adv ``knowing'' during commitment time the polynomial they later answer queries about. Arguably, this could have been called \emph{binding knowledge soundness}, but we stick with the shorter term.
It's interesting to note that the algebraic group model is crucial for allowing us to model both binding and knowledge soundness in one clean game - without
it we typically cannot require \ext to return the polynomial immediately after \adv's commitment. Rather, \ext may require rewinding \adv during the \open procedure for that. This is one reason why papers that deal with generic PCS, e.g. Section 2.3 of \cite{hinf}, define separate notions of knowledge soundness and binding.
\end{remark}
\subsection{The PCS}
We describe the following scheme based on \cite{kate,sonic}.
% It is in fact a slightly simpler scheme than in \cite{sonic} because, as explained in the introduction, there is no need to deal with holes in the allowed range of degrees.
\begin{enumerate}
\item $\gen(d)$ - choose uniform $x\in \F$. Output $\srs0 =(\enc1{1},\enc1{x},\ldots,\enc1{x^{d-1}},\enc2{1},\enc2{x})$.
\item $\com(f,\srs0) \defeq \enc1{f(x)}$.
\item We first describe the \open protocol in the case $z_1=\ldots=z_t=z$.\\
\noindent
$\open(\set{cm_i},\set{z_i},\set{s_i})$:
\begin{enumerate}
\item \verpc sends random $\gamma\in \F$.
\item \prvpc computes the polynomial
\[h(X)\defeq \sum_{i=1}^t \gamma^{i-1}\cdot \frac{f_i(X)-f_i(z)}{X-z} \]
and using \srs0 computes and sends $W\defeq \enc1{h(x)}$.
% \[]
\item\label{step:computeW} \verpc computes the elements
\[F\defeq \sum_{i\in [t]} \gamma^{i-1} \cdot \cm_i, v\defeq \enc1{\sum_{i\in [t]} \gamma^{i-1}\cdot s_i}\]
\item \verpc outputs \acc if and only if
\[ e(F-v,\enc2{1})\cdot e(-W,\enc2{x-z} )=1. \]
\end{enumerate}
We argue knowledge soundness for the above protocol. More precisely, we argue the existence of an efficient \ext such that an algebraic adversary \adv can only win the KS game w.p. \negl when restricting itself to choosing $z=z_1=\ldots=z_t$.
Let \adv be such an algebraic adversary.
\adv begins by outputting $\cm_1,\ldots,\cm_t$.
Each $\cm_i$ is a linear combination $\sum_{j=0}^{d-1} a_{i,j} \enc1{x^j}$.
\ext, who is given the coefficients \set{a_{i,j}}, simply outputs the polynomials
\[f_i(X)\defeq \sum_{j=0}^{d-1} a_{i,j} \cdot X^j.\]
\adv now outputs $z,s_1,\ldots,s_t\in \F$.
Assume that for some $i\in [t]$, $f_i(z)\neq s_i$. We show that for any strategy of \adv from this point, \verpoly outputs \acc w.p \negl.
In the first step of \open, \verpoly chooses a random $\gamma \in \F$.
Define
\[f(X)\defeq \sum_{i\in [t]} \gamma^{i-1} \cdot f_i(X), s\defeq \sum_{i\in [t]} \gamma^{i-1} \cdot s_i.\]
We have that e.w.p. $t/|\F|$, $f(z)\neq s$.
Now \adv outputs $W=H(x)$ for some $H\in\polysofdeg{d}$.
According to Lemma \ref{lem:AGManalysis}, it suffices to upper bound the probability that the ideal check corresponding to the real pairing check in the protocol passes. It has the form
\[f(X)-s \equiv H(X)(X-z).\]
The check passing implies that
$f(X)-s$ is divisible by $(X-z)$, which implies $f(z)=s$. Thus the ideal check can only pass w.p. \negl over the randomness of \verpoly, which implies the same thing for the real check according to Lemma \ref{lem:AGManalysis}.
The \open protocol for multiple evaluation points simply consists of running in parallel the \open protocol for each evaluation point and the polynomials evaluated at that point.
And then applying a generic method for batch randomized evaluation of pairing equations.
For notational simplicity we describe the \open protocol explicitly only in the case of two distinct evaluation points among $z_1,\ldots,z_t$ (this also happens to be our case in the main protocol).
For this, let us denote the distinct evaluation points by $z,z'$ and by $t_1,t_2$ the number of polynomials and by $\sett
{f_i}{i\in [t_1]},\sett{f'_i}{i\in [t_2]}$ the polynomials to be evaluated at $z,z'$ respectively.
\underline{$\open(\sett{cm_i}{i\in [t_1]},\sett{cm'_i}{i\in [t_2]},\set{z,z'},\set{s_i,s'_i})$}:
\begin{enumerate}
\item \verpc sends random $\gamma,\gamma' \in \F$.
\item\label{step:computeW} \prvpc computes the polynomials
\[h(X)\defeq \sum_{i=1}^{t_1} \gamma^{i-1}\cdot \frac{f_i(X)-f_i(z)}{X-z} \]
\[h'(X)\defeq \sum_{i=1}^{t_2} \gamma'^{i-1}\cdot \frac{f'_i(X)-f'_i(z')}{X-z'} \]
and using \srs0 computes and sends $W\defeq \enc1{h(x)}, W'\defeq \enc1{h'(x)}$.
% \[]
\item \verpc chooses random $r'\in \F$.
\item\verpc computes the element
\[F\defeq \left(\sum_{i\in [t_1]} \gamma^{i-1} \cdot \cm_i-\enc1{\sum_{i\in [t_1]} \gamma^{i-1}\cdot s_i}\right) + r' \cdot\left(\sum_{i\in [t_2]} \gamma'^{i-1} \cdot \cm'_i -\enc1{\sum_{i\in [t_2]} \gamma'^{i-1}\cdot s'_i}\right)\]
\verpc computes outputs \acc if and only if
\[ e\left(F + z\cdot W +r'z'\cdot W',\enc2{1}\right )\cdot e(-W-r'\cdot W',\enc2{x} )=1. \]
\end{enumerate}
We summarize the efficiency properties of this batched version of the \cite{kate} scheme.
\begin{lemma}\label{lem:kate}
Fix positive integer $d$.
There is a $d$-polynomial commitment scheme \PCscheme such that
\begin{enumerate}
\item For $n\leq d$ and $f\in \polysofdeg{n}$, computing $\com(f)$ requires $n$ \G1-exponentiations.
\item Given $\z \defeq (z_1,\ldots,z_t)\in \F^t, f_1,\ldots, f_t \in \polysofdeg{d}$, denote by $t^*$ the number of distinct values in \z; and for $i\in [t^*]$, $d_i\defeq \max\sett{\deg(f_i)}{i\in S_i}$ where $S_i$ is the set of indices $j$ such that $z_j$ equals the $i$'th distinct point in \z.
Let $\cm_i = \com(f_i)$.
Then \open(\set{cm_i,f_i,z_i,s_i}) requires
\begin{enumerate}
\item $\sum_{i\in [t^*]} d_i$ \G1-exponentiations of \prvpc.
\item $t+2t^*-2$ \G1-exponentiations and 2 pairings of \verpc.
\end{enumerate}
\end{enumerate}
\end{lemma}
\end{enumerate}
% Note that $|\srs| = 2d$ in the above scheme.
% \emph{However}, a crucial point is that once we fix $\ell$ values from which we will always choose \set{d_1,\ldots,d_t},
% we can work with a subvector of \srs of size $d+\ell$. In our SNARK, given a circuit size, we will only need $\ell=3$ of the \G2 values from $\sigma$ in our SRS.
%
%
% The following is implied almost directly by Theorem 6.1 and Appendix C.1 of \cite{sonic}. We leverage that the pairings in step \ref{step:computeW} can be batched for indices $i,j$ such that $d_i=d_j$.
% \begin{lemma}\label{lem:pcSCHEME}
% Fix any $d$ and assume the $d$-power bi-linear Strong Diffie Hellman assumption holds.
% Then the above scheme is a $d$-polynomial commitment scheme such that
% \begin{enumerate}
% \item \prvpoly requires \max \G1 exponentiations for computing $\com(f,\max,\srs)$.
% \item \prvpoly requires $\sum_{i=1}^t O(d_i\log(d_i))$ field operations and $\sum_{i=1}^t d_i$ exponentiations for computing $\open(\sett{cm_i}{i\in [t]},$ $\sett{d_i}{i\in [t]},\sett{s_i}{i\in [t]},$ $z)$.
% \item \verpoly requires $t^*+2$ pairings, where $t^*$ is the number of distinct values amongst $d_1,\ldots,d_t$.
% \end{enumerate}