-
Notifications
You must be signed in to change notification settings - Fork 436
perf/refac: Groth16 MPC setup improvements #1428
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
Comments
Not sure if this belongs here but once we make sure it matches the performance of the regular setup, we can reduce the latter to a wrapper for a trivial MPC (with only one participant, no verification and no beacon contribution) and remove a lot of duplication. |
That would be imo very cool, I think definitely worth considering |
Hey is the issue open , may i work on it ? |
Hi - currently no-one is directly working on it, but I'd recommend starting with some easier issues. Implementing these changes are somewhat difficult so that it would be backwards compatible and would follow the style we have in gnark. For example I'd recommend #1175. |
Sure, thanks for the suggestion! I'll start with issue #1175 and look into it. |
I have few idea about the beacon contribution in MPC. It sounds like a public-and-trustable contribution from third parties. But when refering the following codes, I have some questions. gnark/backend/groth16/bn254/mpcsetup/phase1.go Lines 158 to 162 in b51a3d4
gnark/backend/groth16/bn254/mpcsetup/setup.go Lines 27 to 31 in b51a3d4
Is it only a seed of randomness? Do we need it publicly verifiable (as described in the doc)? E.g. can I give it a simple string or something else that is publicly acknowledged by verifiers? |
It should be fine if you use seed which is agreed by contributors and proof verifiers. Publicly verifiable seed is one option, but this could be done on social layer. |
Collecting tasks from #1372:
Initialize
method we first obtaincoeffTau1
,coeffTau2
,coeffAlphaTau1
andcoeffBetaTau1
and then compute the updated Phase2 key from the circuit description (the big loop which iterates over constraints). This means that we first need to allocate possibly very big slices and then perform computations on the slice elements. Maybe (needs to be benchmarked) it is fine if we only allocate every slice individually and then iterate for every slice the constraints separately. For large circuits this could potentially save tens of GBs of memory we need to allocate.io.UnsafeReaderFrom
andio.BinaryDumper
interfaces. The idea is that when the sequencer stores the contributions, then it doesn't have to do expensive checks when restoring state from storage.io.UnsafeReaderFrom
then we need to consider that theVerify
methods ofPhase1
andPhase2
do not explicitly do subgroup checks and depend that the subgroups checks are done at deserialization. So keep in mind when implementingrand.Reader
which is secure, but in some cases would wan't to use something else (for example for some ceremonial contributions ).srsCommons.update
method we currently don't parallelize the computations. We could do it quite nicely as every loop depends directly ontau
, so it should be sufficient if we only compute the starting pointstau
,tau^k
,tau^2k
etc.The text was updated successfully, but these errors were encountered: