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

The Groth 16 paper reduces the number of pairings from 8 to 3, so that should reduce the gas cost of withdrawals by ~2x. #20

Open
barryWhiteHat opened this issue Jun 22, 2018 · 9 comments

Comments

@barryWhiteHat
Copy link
Owner

@barryWhiteHat
Copy link
Owner Author

Our friends @ ZoKrates are working on this Zokrates/ZoKrates@develop...Schaeff:implement-groth16

@davidp94
Copy link

davidp94 commented Jun 22, 2018 via email

@barryWhiteHat
Copy link
Owner Author

@davidp94 the number of constraints is only a factor when you want to optimize proving time. The verification time is constant regardless of the number of constraints.

That said currently the proving time is 7 minutes on a laptop. so right now mobile i pretty much excluded unless we reduce the number of constraints.

@HarryR
Copy link

HarryR commented Jul 10, 2018

As per the slides davidp94 linked, BLAKE2s could be used instead of SHA256 to significantly reduce verification time, e.g. 10 rounds of 21518 constraints, versus 64 rounds of 25840 constraints. However Ethereum doesn't support BLAKE2s natively.

@barryWhiteHat
Copy link
Owner Author

I was thinking of going the jubjub route. Embed a twisted edwards curve in alt-bn-128253 and us that to do pedersen hashes, pedersen commitments. That would reduce the number of constraints drastically. But doing the pedersen in the EVM could be quite expensive gas wise. My intuition is we would have to wait for ewasm.

@HarryR
Copy link

HarryR commented Jul 11, 2018

Yup, even the response I had from one of the eth dev meetings was basically 'wait for ewasm'... Until then, I guess it's just about tooling, proof of concept, security, usability etc. and figuring out all those bits?

But I'm not sure I'd want to write code in Solidity when there's a C++ compiler that targets wasm...

Alternatively implement it all on EOS?

@barryWhiteHat
Copy link
Owner Author

Seems like it. But we can get pretty far with sha256 and zksnarks. Tho the biggest pain is the 7 min proving time. Tho i think we can get that down to 1 minute.

Oh do EOS have ec operations for alt-bn253? Or do they just use wasm?

@HarryR
Copy link

HarryR commented Jul 11, 2018

Getting the proving time down as much as possible is the HUUGE step towards general usability, maybe there some optimisations which can be made? Zcash's 40 second proving time is about as good as you're going to get at the moment.

EOS just use wasm, you'd have to link-in the library for alt-bn256.

@barryWhiteHat
Copy link
Owner Author

Yes. 40 seconds is a good target for now. But using Pedersen hashes and commitments we should be able to get this down a lot.

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