Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.81k stars 361 forks source link

any method to export/save artifacts/keypairs in zokrates-js? #1305

Open mqhe opened 1 year ago

mqhe commented 1 year ago

Is any method to export/save artifacts/keypairs efficiently in zokrates-js? so that we do not need to run the setup every time ?

dark64 commented 1 year ago

You only compile and run the setup once. It is up to you to decide how to deal with the artifacts, as this usually might differ depending on the environment, etc. Have a look at this nextjs demo as an example. For backend applications, you could store with fs.writeFileSync() and so on.

sourav-bz commented 9 months ago

hey @dark64 @alvaro-alonso, I am not able to write/export the artifacts and keypair into a file as it's really huge. have tried creating multiple chunks, but it's always failing to save into the file as it's running out heap memory. can you please suggest a better way to go about this?

alv-around commented 9 months ago

hey @dark64 @alvaro-alonso, I am not able to write/export the artifacts and keypair into a file as it's really huge. have tried creating multiple chunks, but it's always failing to save into the file as it's running out heap memory. can you please suggest a better way to go about this?

@sourav-bz this seems to be more of a JS problem that of ZoKrates itself. For questions rather than bug reports, it is more appropriate the gitter channel rather than tickets.

As dark64 said, the setup is thought to be run once and prove/verify multiple times, so I would suggest you do this setup with the CLI. Moreover, the setup should be taken place in a very safe environment as if not performed correctly this can allow an attacker to generate false proofs. So except for experimental/teaching purpose this step should not be happening in a browser or in a server.

sourav-bz commented 9 months ago

@alvaro-alonso thank you so much these contexts, it really helped me. I have tried having conversations or raising queries on gitter, but never got any active response back. will recommend to switch to telegram or discord (if possible). sorry, about asking it here. but it was an open issue already. I think we can close this now.