Skip to content

Commit

Permalink
chore: add leanimt paper (privacy-scaling-explorations#332)
Browse files Browse the repository at this point in the history
* chore: add the leanimt paper

re privacy-scaling-explorations#331

* docs: update leanimt paper readme file

re privacy-scaling-explorations#331

* chore: update folder name

* refactor: update the created date
  • Loading branch information
vplasencia authored Sep 23, 2024
1 parent 2173bc8 commit 71db371
Show file tree
Hide file tree
Showing 22 changed files with 1,831 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ yarn-error.log*

# others
target

!papers
14 changes: 14 additions & 0 deletions papers/leanimt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Latex files
*.aux
*.fdb_latexmk
*.fls
*.log
*.gz
*.toc
*.out
*.bbl*
*.bcf
*.xml
*.blg
*.synctex*
*.bcf*
42 changes: 42 additions & 0 deletions papers/leanimt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# LeanIMT Paper

This folder contains the LeanIMT Paper.

## Related work

- LeanIMT document: https://hackmd.io/@vplasencia/S1whLBN16

- LeanIMT benchmarks on browser and Node.js: https://github.com/vplasencia/imt-benchmarks

## Code

- LeanIMT TypeScript implementation: https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/lean-imt.

- LeanIMT Solidity implementation: https://github.com/privacy-scaling-explorations/zk-kit.solidity/tree/main/packages/lean-imt.

## Install Latex to work with VSCode on Mac

1. Install [Miktex](https://miktex.org/).

2. Install [LaTeX Workshop VSCode extension](https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop).

3. Add the path by running:

```bash
echo -n 'export PATH=$HOME/bin:$PATH' >> ~/.zshrc
```

Read more about it [here](https://stackoverflow.com/questions/11530090/adding-a-new-entry-to-the-path-variable-in-zsh/47795375#47795375).

4. Add Latex formatter in VSCode.

```bash
sudo cpan Unicode::GCString
sudo cpan App::cpanminus
sudo cpan YAML::Tiny
sudo perl -MCPAN -e 'install "File::HomeDir"'
```

Read more about it [here](https://github.com/James-Yu/LaTeX-Workshop/issues/376#issuecomment-372497291).

**Note**: Prettier does not format `.tex` files.
7 changes: 7 additions & 0 deletions papers/leanimt/paper/data/functions-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Function,IMT,LeanIMT
Insert,0.77687,0.42391
InsertMany,77.98467,6.94025
Update,0.77933,0.81708
Remove,0.76554,0.76838
GenerateProof,0.00332,0.00311
VerifyProof,0.75121,0.74810
7 changes: 7 additions & 0 deletions papers/leanimt/paper/data/functions-browser-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Function,IMT,LeanIMT
Insert,0.90300,0.38600
InsertMany,68.53200,6.30200
Update,0.68700,0.68000
Remove,0.69500,0.67900
GenerateProof,0.00100,0.00100
VerifyProof,0.67900,0.66300
13 changes: 13 additions & 0 deletions papers/leanimt/paper/data/functions-browser-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Function,ops/sec,Average Time (ms),Relative to IMT
IMT - Insert,1107,0.90300,
LeanIMT - Insert,2590,0.38600,2.34 x faster
IMT - InsertMany,14,68.53200,
LeanIMT - InsertMany,158,6.30200,10.87 x faster
IMT - Update,1455,0.68700,
LeanIMT - Update,1470,0.68000,1.01 x faster
IMT - Remove,1438,0.69500,
LeanIMT - Remove,1472,0.67900,1.02 x faster
IMT - GenerateProof,1000000,0.00100,
LeanIMT - GenerateProof,1000000,0.00100,1.00 x slower
IMT - VerifyProof,1472,0.67900,
LeanIMT - VerifyProof,1508,0.66300,1.02 x faster
13 changes: 13 additions & 0 deletions papers/leanimt/paper/data/functions-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Function,ops/sec,Average Time (ms),Relative to IMT
IMT - Insert,1287,0.77687,
LeanIMT - Insert,2358,0.42391,1.83 x faster
IMT - InsertMany,12,77.98467,
LeanIMT - InsertMany,144,6.94025,11.24 x faster
IMT - Update,1283,0.77933,
LeanIMT - Update,1223,0.81708,1.05 x slower
IMT - Remove,1306,0.76554,
LeanIMT - Remove,1301,0.76838,1.00 x slower
IMT - GenerateProof,300868,0.00332,
LeanIMT - GenerateProof,321586,0.00311,1.07 x faster
IMT - VerifyProof,1331,0.75121,
LeanIMT - VerifyProof,1336,0.74810,1.00 x faster
4 changes: 4 additions & 0 deletions papers/leanimt/paper/data/gas-cost-functions-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Function,IMT,LeanIMT
Insert,560351,119051
Update,474000,197830
Remove,472710,233235
2 changes: 2 additions & 0 deletions papers/leanimt/paper/data/insert-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Function,IMT,LeanIMT
Insert,1.22803,0.68790
101 changes: 101 additions & 0 deletions papers/leanimt/paper/data/insert-line.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Members,IMT,LeanIMT
1,0.23729205131530762,0.0473330020904541
11,0.5993330478668213,0.1690000295639038
21,0.679582953453064,0.26999998092651367
31,0.7960419654846191,0.2715829610824585
41,0.8135420083999634,0.2764589786529541
51,0.8352079391479492,0.28870904445648193
61,0.9145839214324951,0.39683306217193604
71,0.9173750877380371,0.4024159908294678
81,0.9224170446395874,0.40404200553894043
91,0.9335840940475464,0.4050419330596924
101,0.9457499980926514,0.406000018119812
111,0.9802498817443848,0.4068340063095093
121,1.0164589881896973,0.40904200077056885
131,1.046125054359436,0.410957932472229
141,1.0477079153060913,0.41404199600219727
151,1.0489579439163208,0.419374942779541
161,1.050041913986206,0.437999963760376
171,1.051124930381775,0.47104203701019287
181,1.0525410175323486,0.5272499322891235
191,1.0570420026779175,0.5297919511795044
201,1.0616669654846191,0.5335420370101929
211,1.06516695022583,0.5375829935073853
221,1.0733330249786377,0.5387920141220093
231,1.0849159955978394,0.5395839214324951
241,1.1144999265670776,0.5407090187072754
251,1.1755419969558716,0.5415420532226562
261,1.177083969116211,0.543166995048523
271,1.1779589653015137,0.5440000295639038
281,1.1799589395523071,0.5456670522689819
291,1.1809159517288208,0.547834038734436
301,1.1818751096725464,0.5500000715255737
311,1.183042049407959,0.5526249408721924
321,1.1836669445037842,0.5548750162124634
331,1.1847079992294312,0.561040997505188
341,1.1855829954147339,0.5645840167999268
351,1.1870421171188354,0.5744999647140503
361,1.1888749599456787,0.5893750190734863
371,1.1909170150756836,0.630666971206665
381,1.1942919492721558,0.6545840501785278
391,1.1967500448226929,0.6575829982757568
401,1.1988749504089355,0.6606669425964355
411,1.203624963760376,0.6623330116271973
421,1.2099169492721558,0.6653749942779541
431,1.2147499322891235,0.6698330640792847
441,1.2289578914642334,0.6722079515457153
451,1.2361669540405273,0.6730829477310181
461,1.2416249513626099,0.6749579906463623
471,1.2454999685287476,0.6762919425964355
481,1.2869590520858765,0.6772090196609497
491,1.3046669960021973,0.6791249513626099
501,1.3080840110778809,0.6810410022735596
511,1.3094170093536377,0.6822919845581055
521,1.3104580640792847,0.6836669445037842
531,1.3120410442352295,0.6861660480499268
541,1.3134169578552246,0.6908750534057617
551,1.3139159679412842,0.6963330507278442
561,1.3143750429153442,0.6993749141693115
571,1.3152920007705688,0.705375075340271
581,1.3159589767456055,0.7115000486373901
591,1.3175830841064453,0.7174580097198486
601,1.318208932876587,0.7288329601287842
611,1.3191659450531006,0.7482500076293945
621,1.3208750486373901,0.7826249599456787
631,1.3219159841537476,0.7882080078125
641,1.3239589929580688,0.7923330068588257
651,1.324958086013794,0.7964160442352295
661,1.3258329629898071,0.7984580993652344
671,1.3272089958190918,0.8025839328765869
681,1.328374981880188,0.8050830364227295
691,1.3302079439163208,0.8075000047683716
701,1.3311669826507568,0.8103339672088623
711,1.332666039466858,0.8150420188903809
721,1.3350419998168945,0.8164999485015869
731,1.3361250162124634,0.8200830221176147
741,1.338582992553711,0.8226670026779175
751,1.3403329849243164,0.8245829343795776
761,1.3420830965042114,0.8294589519500732
771,1.3435419797897339,0.8331670761108398
781,1.34641695022583,0.8413749933242798
791,1.3490409851074219,0.8468749523162842
801,1.3517500162124634,0.8527910709381104
811,1.3557920455932617,0.8699580430984497
821,1.3597500324249268,0.8956249952316284
831,1.362333059310913,0.9213340282440186
841,1.3654999732971191,0.9299999475479126
851,1.369791030883789,0.9360829591751099
861,1.373790979385376,0.9416670799255371
871,1.3819169998168945,0.9453340768814087
881,1.3895419836044312,0.9526659250259399
891,1.4049999713897705,0.9579169750213623
901,1.4125419855117798,0.9672080278396606
911,1.424625039100647,0.9760830402374268
921,1.4320000410079956,0.9818340539932251
931,1.451665997505188,0.9930830001831055
941,1.4655839204788208,1.0107909440994263
951,1.4785839319229126,1.0609170198440552
961,1.493499994277954,1.0795419216156006
971,1.5095000267028809,1.088582992553711
981,1.564458966255188,1.110082983970642
991,1.6614160537719727,1.1965839862823486
2 changes: 2 additions & 0 deletions papers/leanimt/paper/data/insert-many-leanimt-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Data Structure,Insert Loop,InsertMany
LeanIMT,20.97820,7.31698
11 changes: 11 additions & 0 deletions papers/leanimt/paper/data/insert-many-leanimt-line.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Members,InsertLoop,InsertMany
1,0.035375118255615234,0.0566248893737793
11,2.8284590244293213,1.4578750133514404
21,5.8995420932769775,3.125458002090454
31,10.724499940872192,4.42845892906189
41,16.496457815170288,6.145542144775391
51,20.178709030151367,7.860708951950073
61,25.595208883285522,8.927959203720093
71,30.66249990463257,10.164207935333252
81,34.70812511444092,11.86887502670288
91,40.90762495994568,12.962291955947876
3 changes: 3 additions & 0 deletions papers/leanimt/paper/data/insert-many-leanimt-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Function,ops/sec,Average Time (ms),Relative to Insert
Insert in Loop,47,20.97820,
InsertMany,136,7.31698,2.87 x faster
3 changes: 3 additions & 0 deletions papers/leanimt/paper/data/insert-table.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Function,ops/sec,Average Time (ms),Relative to IMT
IMT,814,1.22803,
LeanIMT,1453,0.68790,1.79 x faster
7 changes: 7 additions & 0 deletions papers/leanimt/paper/data/leanimt-nodejs-browser-bar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Function,Node.js,Browser
Insert,0.42391,0.386
InsertMany,6.94025,6.302
Update,0.81708,0.68
Remove,0.76838,0.679
GenerateProof,0.00311,0.001
VerifyProof,0.7481,0.663
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added papers/leanimt/paper/images/imt-gas-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added papers/leanimt/paper/leanimt-paper.pdf
Binary file not shown.
Loading

0 comments on commit 71db371

Please sign in to comment.