-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to optimize inner-product proof #89
Comments
Seems like it's not the usual multiscalar mul (which produces one point), but a multi-point multiscalar mul. Fully general Pippenger algorithm covers that case (that is, you can compute independent exponentiations faster with a Pippenger's algorithm, than doing them one by one), but we have never needed or implemented it yet. |
Disclaimer: I yet have no intuition on how that sequence of independent multiplications can be computed faster than one multiplication at a time. In this case points are all different, only scalars are the same. |
What I was thinking of was to try collapsing the However, this would mean that the prover would compute
so this would actually end up doing more work. The goal is to avoid having to compute all of the double-base scalar multiplications, but I think this idea doesn't quite work out. |
@hdevalence do you think this is still worth experimenting with, or should we close the issue? |
There's no milestone attached, so we can leave this open and have it be a point of accumulation for ideas about the inner-product proof. |
Benedikt mentioned that the libsecp implementation does a hybrid strategy, jumping a few steps at once (without shrinking), then cutting the sizes of the vectors. Could be worth exploring, at some point in the future, although at the moment we're still faster on the IPP proof for other reasons. |
Another strategy would be to try to speed up the double-base scalar multiplications by vectorizing across points. This would require a change in the upstream curve library, and I'm not sure what kind of API would be useful generally (instead of just in this one weird protocol). |
I observed that you can half the number of multiplications required to scale the witness and generator vectors in each round by computing Another thing to look at is choosing the challenges Note that if the verifier wishes to do a MSM the final scalars will no longer be sparse/small except for perhaps for very small instance sizes. I suspect there exists a threshold instance size where the |
Does this differ from the improved inner product in https://eprint.iacr.org/2019/944.pdf ? |
It seems like they make the same observation on w.r.t. halving the multiplications, but provide some different ideas on how to sample the challenges. |
Another way to sample the challenges, for curves that support a cubic endomorphism, is given by Algorithm 1 in the Halo paper. See also the proof of correctness in Appendix C. It's optimized for use in a circuit but might be useful outside, too (with projective coordinates instead of affine, probably). |
The inner-product proof spends lots of time in this computation https://github.com/chain/ristretto-bulletproofs/blob/main/src/inner_product_proof.rs#L102-L103 performing double-base scalar multiplications.
The verifier's side inlines all of the computation into a single check. This isn't possible for the prover, which has to produce the
L, R
points, but (looking quickly) it seems like it should be possible for the prover to only do one multiscalar mul perL
andR
, and drop all of the double-base scalar muls.Possibly supersedes #80
The text was updated successfully, but these errors were encountered: