ZoKrates icon indicating copy to clipboard operation
ZoKrates copied to clipboard

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

Open mqhe opened this issue 1 year ago • 4 comments

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

mqhe avatar May 03 '23 05:05 mqhe

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.

dark64 avatar May 03 '23 20:05 dark64

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 avatar Nov 22 '23 05:11 sourav-bz

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.

alv-around avatar Nov 22 '23 13:11 alv-around

@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.

sourav-bz avatar Nov 24 '23 13:11 sourav-bz