-
Notifications
You must be signed in to change notification settings - Fork 48
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
Onchain decider circuit for Protogalaxy #145
Open
winderica
wants to merge
16
commits into
privacy-scaling-explorations:main
Choose a base branch
from
winderica:protogalaxy-decider-circuit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Onchain decider circuit for Protogalaxy #145
winderica
wants to merge
16
commits into
privacy-scaling-explorations:main
from
winderica:protogalaxy-decider-circuit
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merged
This was referenced Sep 8, 2024
Merged
winderica
force-pushed
the
protogalaxy-decider-circuit
branch
2 times, most recently
from
October 5, 2024 17:04
80e991a
to
c447906
Compare
winderica
force-pushed
the
protogalaxy-decider-circuit
branch
from
October 14, 2024 08:42
5dc7e5f
to
a8f3449
Compare
Together with the existing `MatrixGadget` and `VectorGadget`, we can now use the same logic for checking R1CS satisfiability of `R1CSVar` both natively and non-natively.
… folding commitments
winderica
force-pushed
the
protogalaxy-decider-circuit
branch
from
October 23, 2024 18:31
9ad522f
to
74a08d5
Compare
winderica
changed the title
Protogalaxy decider circuit
Onchain decider circuit for Protogalaxy
Oct 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following #157 and #162, this PR implements generic on-chain and off-chain decider circuits
GenericOnchainDeciderCircuit
andGenericOffchainDeciderCircuit{1, 2}
that can handle all folding schemes (Nova, HyperNova, and Protogalaxy, hopefully even Mova and Ova in the future).The abstraction in #157 and #162 provide a unified yet flexible usage of these objects, leading to highly reuseable decider circuits. As an example, we can take a look at the definition and internal logic of
GenericOnchainDeciderCircuit
below:sonobe/folding-schemes/src/folding/circuits/decider/on_chain.rs
Lines 64 to 110 in 7add907
sonobe/folding-schemes/src/folding/circuits/decider/on_chain.rs
Lines 232 to 321 in 7add907
With
GenericOnchainDeciderCircuit
, creating the on-chain decider circuit for Protogalaxy is as simple as giving a type alias and implementing theTryFrom
trait:sonobe/folding-schemes/src/folding/protogalaxy/decider_eth_circuit.rs
Lines 74 to 150 in 7add907
Below I list several additional modifications made in this PR:
EquivalenceGadget
that can check the equivalence (equality for native field elements, congruence for non-native field elements) between two in-circuit variables.DeciderEthCircuit
of HyperNova, which verifies the field operations in NIFS.V in-circuit. (Note that in c447906, I mistakenly ignored the group operations in NIFS.V. In fact, these operations are expensive in-circuit and should be handled by the verifier, which is added in 5dc7e5f .)u
andx
in Nova) are no longer necessary to be public. They are thus removed from public inputs to reduce the verifier's costs. The smart contract for on-chain verification is also updated.P.S.
While this PR should already be ready for review, please focus on what you are working on now (such as #133). I don't want to bother the other contributors with merge conflicts due to this huge PR and am happy to rebase at my end after the pending PRs get merged :)Conflicts resolved :)