Skip to content

ZkRollup and RedJubjub Prototype

Latest
Compare
Choose a tag to compare
@ashWhiteHat ashWhiteHat released this 05 Nov 06:09
· 241 commits to master since this release
6ac2ccd

ZkRollup and RedJubjub Prototype

Abstract

ZkRollup prototype implementation which collect the transfer transaction and synchronize it on-chain at once.
RedJubjub prototype implementation which divide key permission and prove the relationship of keys.
These functionalities are implemented as pallet in order to run it on Substrate runtime and totally compatible with no_std and parity-scale-codec.

Use Case

Operator collects transfer transactions and synchronize the state transition with on-chain at once.
Signer generate the one-time encryption key which doesn't have permission to migrate asset but encrypt transaction.
The one-time encryption key corresponds decryption key and it can be used for audit.

Significant Changes

Divide Pairing and Jubjub Curve Trait.

New Libraries

This release includes following libraries implementation.

Primitives

  • zkstd crates.io badge
  • jub-jub crates.io badge
  • bls-12-381 crates.io badge
  • she-elgamal crates.io badge
  • ec-pairing crates.io badge
  • poly-commit crates.io badge
  • red-jubjub crates.io badge
  • zksnarks crates.io badge
  • zkplonk crates.io badge
  • zkrollup crates.io badge

Pallets

Benchmark

Benchmark

Bls12 381

_ add sub double scalar / mul square invert pow
g1_affine 714.20 ns 717.54 ns 720.93 ns 737.37 ns 739.75 ns 742.30 ns 848.32 ns 850.93 ns 853.75 ns 327.94 µs 329.21 µs 330.41 µs
g1_projective 1.3477 µs 1.3517 µs 1.3561 µs 1.3215 µs 1.3280 µs 1.3349 µs 847.98 ns 851.55 ns 854.92 ns 323.29 µs 324.52 µs 325.68 µs
g2_affine 2.8349 µs 2.8518 µs 2.8683 µs 2.9519 µs 2.9560 µs 2.9591 µs 3.3792 µs 3.3911 µs 3.4030 µs 1.2352 ms 1.2392 ms 1.2438 ms
g2_projective 5.5165 µs 5.5350 µs 5.5538 µs 5.4515 µs 5.4753 µs 5.4981 µs 3.3105 µs 3.3270 µs 3.3440 µs 1.2990 ms 1.3015 ms 1.3038 ms
fr 8.7629 ns 8.7929 ns 8.8236 ns 8.3257 ns 8.3504 ns 8.3758 ns 8.1719 ns 8.1975 ns 8.2238 ns 41.645 ns 41.818 ns 41.968 ns 34.843 ns 35.000 ns 35.163 ns 15.079 µs 15.138 µs 15.200 µs 10.222 µs 10.246 µs 10.270 µs
fq 14.625 ns 14.680 ns 14.736 ns 12.624 ns 12.657 ns 12.691 ns 13.567 ns 13.640 ns 13.710 ns 90.736 ns 91.281 ns 91.834 ns 76.947 ns 77.076 ns 77.205 ns 44.666 µs 44.784 µs 44.911 µs
Fq2 31.117 ns 31.188 ns 31.253 ns 29.603 ns 29.659 ns 29.701 ns 32.138 ns 32.277 ns 32.430 ns 378.35 ns 380.17 ns 381.97 ns 271.52 ns 271.85 ns 272.14 ns 44.086 µs 44.282 µs 44.478 µs
Fq6 146.06 ns 146.60 ns 147.12 ns 134.37 ns 134.77 ns 135.12 ns 129.85 ns 130.49 ns 131.16 ns 2.6791 µs 2.6931 µs 2.7079 µs 1.8952 µs 1.8973 µs 1.8992 µs 48.959 µs 49.066 µs 49.168 µs
Fq12 353.21 ns 354.92 ns 356.55 ns 324.66 ns 326.38 ns 328.51 ns 314.77 ns 316.04 ns 317.36 ns 8.6387 µs 8.6738 µs 8.7050 µs 6.1444 µs 6.1606 µs 6.1755 µs 57.105 µs 57.419 µs 57.741 µs

Confidential Transfer

_ Time
setup 6.2983 s 6.3533 s 6.4040 s
gen_proof 6.7157 s 6.7444 s 6.7776 s
verify_proof 16.033 ms 16.226 ms 16.479 ms

Jubjub

_ add sub double scalar / mul square invert pow
affine 421.54 ns 423.65 ns 425.96 ns 427.31 ns 429.03 ns 430.80 ns 399.37 ns 400.58 ns 401.84 ns 133.24 µs 133.83 µs 134.38 µs
extended 478.96 ns 481.22 ns 483.33 ns 497.09 ns 497.88 ns 498.57 ns 365.74 ns 366.97 ns 368.22 ns 131.00 µs 131.50 µs 132.02 µs
fp 8.5002 ns 8.5156 ns 8.5316 ns 7.9557 ns 7.9951 ns 8.0340 ns 7.7814 ns 7.8354 ns 7.8903 ns 41.881 ns 41.951 ns 42.020 ns 34.631 ns 34.749 ns 34.869 ns 13.367 µs 13.391 µs 13.416 µs 10.443 µs 10.469 µs 10.494 µs

Plonk

  • msm
_ Time
8 9.0083 ms 9.1812 ms 9.4171 ms
9 13.195 ms 13.255 ms 13.328 ms
10 22.831 ms 22.925 ms 23.051 ms
11 41.207 ms 41.385 ms 41.623 ms
12 67.315 ms 67.763 ms 68.308 ms
13 123.13 ms 123.82 ms 124.64 ms
14 231.91 ms 232.80 ms 233.83 ms
  • pairing
_ Time
tate 2.4814 ms 2.4909 ms 2.5003 ms
final_exp 1.4885 ms 1.4921 ms 1.4959 ms
miller_loop 1.0106 ms 1.0153 ms 1.0202 ms
multi_miller_loop 2.3763 ms 2.3851 ms 2.3937 ms

Next

Nova Folding and Horizontal Integration of Layer 2