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

MaxPublicInputs limit the public proof input in groth16.move #19860

Open
kaiweicai opened this issue Oct 15, 2024 · 4 comments
Open

MaxPublicInputs limit the public proof input in groth16.move #19860

kaiweicai opened this issue Oct 15, 2024 · 4 comments
Assignees

Comments

@kaiweicai
Copy link

Steps to Reproduce Issue

I am programming a porker game with zkShuffle. There will be made public prove input which size is very large.
There is a ETooManyPublicInputs error when I want to verify the proof using the groth16::verify_groth16_proof() method.
I checked the sui source code, I found the MaxPublicInputs is 32, So the max size of Public Proof Input is 32*8=256byte.

I think the most size of Public Prove Input will over the 256Byte.

What should I do or any suggust. Such as make the Public Proof Input smaller.

Thanks

@jonas-lj
Copy link
Contributor

The max number of inputs is 8, but each input is roughly 32 bytes, so your estimate is corret.

I think it should be possible to modify the circuit to not exceed this. Eg. by putting some of those inputs as private inputs and then perhaps a hash of these as public inputs? It will probably depend on the application.

@kaiweicai
Copy link
Author

I static the length of my Public proof input is 6880. Then I expect the MaxPublicInputs is 6880/32 = 215 instead of current value 8.

@kaiweicai
Copy link
Author

I have a idear, I can create layer2 network base on sui with zk. Then I can change the MaxPublicInputs freely.

@kaiweicai
Copy link
Author

kaiweicai commented Oct 18, 2024

The max number of inputs is 8, but each input is roughly 32 bytes, so your estimate is corret.

I think it should be possible to modify the circuit to not exceed this. Eg. by putting some of those inputs as private inputs and then perhaps a hash of these as public inputs? It will probably depend on the application.

Thanks! I have passed the verification function by setting the serial public proof input as private input. However, I am wondering what the effect of this operation is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants