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

Add a VerifierState #13

Merged
merged 11 commits into from
Jan 21, 2024
Merged

Conversation

Nashtare
Copy link
Contributor

This PR adds a VerifierState, similarly to how the ProverState is constructed to generate proofs, but to verify proofs solely.

This is aimed at simplifying 0xPolygonZero/zero-bin#4.

@Nashtare Nashtare added the enhancement New feature or request label Jan 19, 2024
@Nashtare Nashtare requested a review from BGluth January 19, 2024 14:21
@Nashtare Nashtare self-assigned this Jan 19, 2024
plonky_block_proof_gen/src/verifier_state.rs Outdated Show resolved Hide resolved
plonky_block_proof_gen/src/verifier_state.rs Outdated Show resolved Hide resolved
plonky_block_proof_gen/src/verifier_state.rs Outdated Show resolved Hide resolved

impl VerifierState {
/// Verifies a `block_proof`.
pub fn verify(&self, block_proof: &PlonkyProofIntern) -> ProofGenResult<()> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BGluth I didn't want to bother creating a new Result / Error type just for one method, so I reused the ProofGen ones, but let me know if you'd rather me to create a custom pair for ProofVerif.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree, creating a separate error seems a bit excessive. We could rename ProofGenResult to something that's common between ProogGen and Verifier I guess, but I don't think it's a big deal if we leave it the way it is.

plonky_block_proof_gen/src/prover_state.rs Outdated Show resolved Hide resolved
plonky_block_proof_gen/src/verifier_state.rs Outdated Show resolved Hide resolved

impl VerifierState {
/// Verifies a `block_proof`.
pub fn verify(&self, block_proof: &PlonkyProofIntern) -> ProofGenResult<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree, creating a separate error seems a bit excessive. We could rename ProofGenResult to something that's common between ProogGen and Verifier I guess, but I don't think it's a big deal if we leave it the way it is.

plonky_block_proof_gen/src/lib.rs Show resolved Hide resolved
@Nashtare Nashtare merged commit 604e956 into 0xPolygonZero:main Jan 21, 2024
2 checks passed
@Nashtare Nashtare deleted the verifier-data branch January 21, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants