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

feat: quicksilver #198

Merged
merged 5 commits into from
Jan 7, 2025
Merged

feat: quicksilver #198

merged 5 commits into from
Jan 7, 2025

Conversation

sinui0
Copy link
Collaborator

@sinui0 sinui0 commented Dec 13, 2024

This PR provides a zkVM implementation using Quicksilver. Builds on work from @xiangxiecrypto and supercedes #172 and #182.

Copy link
Member

@th4s th4s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👍, looking pretty clean. Not much to add.

crates/mpz-zk-core/src/check.rs Outdated Show resolved Hide resolved
crates/mpz-zk-core/src/check.rs Outdated Show resolved Hide resolved
Comment on lines +3 to +4
//! This implementation is specifically for degree 1, i.e. VOLE over the
//! extension field.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you meant VOPE in this file?
This implementation simplies figure 4 for a polynomial with degree 1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't degree 1 VOPE equivalent to VOLE?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is different. For boolean circuits, VOLE is Random COT. VOLE is a generalized version to extend boolean to arithmetic circuits.
VOPE focuses on polynomial relations. B = A_0 + A_1*Delta +..., but all the B and A_i are in F_2^{128}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that VOLE is exactly equivalent to VOPE for degree 1, ie a linear function. All the terms in a VOLE are of the same field $\mathbb{F}_{2^{128}}$. The "boolean" variant is often referred to as subfield VOLE (or COT) where A_1 is in $\mathbb{F}_2$.

If I'm not mistaken, the algorithm used here is the typical way to construct a VOLE from sVOLEs. The QS paper generalizes it for proving higher degrees but we won't be needing that

Copy link
Collaborator

@xiangxiecrypto xiangxiecrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have too much context of the vm design here. But I checked the impl. of the protocol itself, and it looks pretty good to me.

Just one more thing. In the current implementation, check always occurs at the end of executing the circuit?

@sinui0
Copy link
Collaborator Author

sinui0 commented Jan 6, 2025

Just one more thing. In the current implementation, check always occurs at the end of executing the circuit?

Yes, the consistency check is always performed after executing the entire callstack. It batches the checks of all circuits together

@xiangxiecrypto
Copy link
Collaborator

Just one more thing. In the current implementation, check always occurs at the end of executing the circuit?

Yes, the consistency check is always performed after executing the entire callstack. It batches the checks of all circuits together

So that means if the circuit is huge, we have to handle very long vectors of F_2^{128} for the check, which may cause memory issues?

@sinui0
Copy link
Collaborator Author

sinui0 commented Jan 7, 2025

So that means if the circuit is huge, we have to handle very long vectors of F_2^{128} for the check, which may cause memory issues?

This is true, and something which we may need to address by introducing a buffer limit which triggers a check. There is a round complexity vs memory trade off there. Shouldn't be an issue and implementing said limit is fairly simple

@xiangxiecrypto
Copy link
Collaborator

So that means if the circuit is huge, we have to handle very long vectors of F_2^{128} for the check, which may cause memory issues?

This is true, and something which we may need to address by introducing a buffer limit which triggers a check. There is a round complexity vs memory trade off there. Shouldn't be an issue and implementing said limit is fairly simple

Ok, the original version uses a buffer to handle this. I think it wont increase round complexity, since there is only one round. But anyway it is not a big issue.

@sinui0
Copy link
Collaborator Author

sinui0 commented Jan 7, 2025

Ok, the original version uses a buffer to handle this. I think it wont increase round complexity, since there is only one round. But anyway it is not a big issue.

Good point, I forgot that it is only 1 message from P to V. I was focused on batching multiple circuits together and lost that detail.

@sinui0 sinui0 merged commit 9e264e8 into alpha.1 Jan 7, 2025
@sinui0 sinui0 deleted the feat/zk-vm branch January 7, 2025 16:03
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