jellyfish icon indicating copy to clipboard operation
jellyfish copied to clipboard

Evaluate batch-affine MSM circuit complexity

Open zhenfeizhang opened this issue 2 years ago • 0 comments

We may be able to reduce constraint count for MSM a bit further.

https://hackmd.io/@tazAymRSQCGXTUKkbh1BAg/Sk27liTW9

https://github.com/Manta-Network/wasm-zkp-challenge/blob/optimized_pippenger/src/pippenger_msm.rs

https://github.com/arkworks-rs/algebra/issues/380, https://github.com/AztecProtocol/barretenberg/blob/f45c27ecd70a3c5607cf30ad5e36bcb4b7385b6d/barretenberg/src/aztec/ecc/curves/bn254/scalar_multiplication/scalar_multiplication.cpp#L114

Let's consider native computation. When we add a projective point with an affine point, we use mixed-addition formula and require 11 field multiplications. In batch affine, we add two vectors of affine points and require only 6 field multiplications and 0 division amortized for each point addition. This saves a lot and motivates us to use batch affine in MSM.

The improvement are not likely to hold for circuits, but it would be interesting to find out.

zhenfeizhang avatar Apr 10 '22 00:04 zhenfeizhang