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

Bigger hard-coded circuits #496

Closed
wants to merge 1 commit into from
Closed

Bigger hard-coded circuits #496

wants to merge 1 commit into from

Conversation

mitschabaude
Copy link
Member

@mitschabaude mitschabaude commented Oct 19, 2022

Hard coded circuit size increased by 16x, from $2^{16}$ to $2^{20}$

  • This is not for merging, just for experiments with bigger circuits
  • The bigger circuit size won't work for smart contracts, just with the Circuit API which represents plain kimchi circuits without recursion stuff

Mina branch: MinaProtocol/mina#12007

@zhfnjust
Copy link

still can not compile the recursion sha256.

error:
image

https://gist.github.com/zhfnjust/4996fc397b38562eb230c73a059e4a3f

@mitschabaude
Copy link
Member Author

mitschabaude commented Oct 20, 2022

Yes as I wrote above, the bigger circuit size will only work with the Circuit API. Increasing sizes of ZkProgram would need a bit more digging. But I don't see the point of doing that because it just will run into the same OOM error.

Maybe the issue with the recursion SHA256 is that, since it includes a verifier circuit in addition to the SHA256 circuit, it is probably too big already with 1 SHA256 invocation, so needs to be split up further

@zhfnjust
Copy link

how to split up SHA256 circuit?

@mitschabaude
Copy link
Member Author

mitschabaude commented Oct 20, 2022

how to split up SHA256 circuit?

you probably know the details better than me.. a first idea: looking at your code, it seems that both the g function and the compression function do their main work in a loop of 64 steps. So it seems plausible that this work can be split up into smaller portions of those loop, where an unfinished proof would maintain some current state as its public input

@mitschabaude
Copy link
Member Author

unused

@xhliu
Copy link

xhliu commented Dec 8, 2023

We still need this.

@mitschabaude
Copy link
Member Author

We still need this

Btw @xhliu we have a sha256 in the works that can hash ~10 blocks per circuit
#1285

@xhliu
Copy link

xhliu commented Dec 10, 2023

When can it be used? @mitschabaude

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

Successfully merging this pull request may close these issues.

3 participants