Skip to content
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

Add fast wittness generation for r1cs #9

Open
snjax opened this issue Apr 7, 2021 · 0 comments
Open

Add fast wittness generation for r1cs #9

snjax opened this issue Apr 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@snjax
Copy link
Member

snjax commented Apr 7, 2021

Currently, fawkes-crypto decide, should it create new signals or not, by calling as_const method of Signal trait (see example here ) and build both witness and constraint system ([1], [2]).

Signals have complex structures (CNum definition), so, operations with them are not fast.

Also, the constraint system is circuit specific (it does not change at multiple calls), and witness depends on the values of internal signals.

For better performance, we need to split constraint system building and witness building. And prover should work with preloaded from the file constraint system and as_const calls cache.

The as_const calls cache could be stored inside the bit-vector. Also, this data and an additional flag for using the pre-computed constant system could be stored here.

In the case of using precomputed CS, all heavy constraint system-related things when we work on CNum, like LC operations, enforce and enforce_pub should be omitted.

In addition, it is better to store r1cs data in snarkjs-compatible format (look at zkutil for example).

@snjax snjax added the enhancement New feature or request label Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant