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

Feature Request: zkey new flag for using crypto.randomBytes #100

Closed
kumavis opened this issue Sep 18, 2021 · 2 comments
Closed

Feature Request: zkey new flag for using crypto.randomBytes #100

kumavis opened this issue Sep 18, 2021 · 2 comments

Comments

@kumavis
Copy link

kumavis commented Sep 18, 2021

while user generated entropy is a nice option, using the platform's source of secure entropy would be nice for non-interactive usage

@weijiekoh
Copy link
Contributor

Looks like snarkjs already uses crypto.randomBytes in addition to user-provided entropy:

https://github.com/iden3/snarkjs/blob/master/src/zkey_contribute.js#L45

https://github.com/iden3/snarkjs/blob/master/src/misc.js#L123

Non-interactive usage can be achieved using a shell pipe:

const cmd = `node ./node_modules/snarkjs/build/cli.cjs zkey contribute ${o} ${n}`
const out = shelljs.exec(`echo ${currentEntropy} | ${cmd}`, { silent: true })

https://github.com/appliedzkp/multisetups/blob/master/ts/contribute.ts#L116-L117

Hope this helps!

@phated
Copy link
Contributor

phated commented Sep 7, 2022

Going to close this because (as stated above) it should already be supported. Please re-open if it isn't true.

@phated phated closed this as completed Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants