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

Pod1introducer 1level recursion verifier in the RecursionCircuit & PlonkyPOD #27

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions pod2/src/pod/gadget/introducer.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
use anyhow::{anyhow, Result};

Check warning on line 1 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `anyhow`
use hashbrown::HashMap;

Check warning on line 2 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `hashbrown::HashMap`
use plonky2::field::types::Field;

Check warning on line 3 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `plonky2::field::types::Field`
use plonky2::gates::noop::NoopGate;

Check warning on line 4 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `plonky2::gates::noop::NoopGate`
use plonky2::iop::target::{BoolTarget, Target};

Check warning on line 5 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused imports: `BoolTarget` and `Target`
use plonky2::iop::witness::{PartialWitness, WitnessWrite};

Check warning on line 6 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `WitnessWrite`
use plonky2::plonk::circuit_builder::CircuitBuilder;
use plonky2::plonk::circuit_data::{
CircuitConfig, CircuitData, ProverCircuitData, VerifierCircuitData, VerifierCircuitTarget,

Check warning on line 9 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused imports: `CircuitConfig`, `CircuitData`, `ProverCircuitData`, `VerifierCircuitData`, and `VerifierCircuitTarget`
};
use plonky2::plonk::proof::{ProofWithPublicInputs, ProofWithPublicInputsTarget};

Check warning on line 11 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused imports: `ProofWithPublicInputsTarget` and `ProofWithPublicInputs`
use plonky2::recursion::dummy_circuit::cyclic_base_proof;

Check warning on line 12 in pod2/src/pod/gadget/introducer.rs

View workflow job for this annotation

GitHub Actions / build

unused import: `plonky2::recursion::dummy_circuit::cyclic_base_proof`
use std::array;
use std::marker::PhantomData;
use std::time::Instant;

use crate::pod::gadget::SchnorrPODGadget;
use crate::recursion::IntroducerCircuitTrait;
use crate::{PlonkyProof, C, D, F};

pub struct IntroducerCircuit {}

/// IntroducerCircuit defines the circuit whose plonky2 proof is verified in the RecursiveCircuit
/// (1-level recursion). This is, the POD1-Introducer circuit.
impl IntroducerCircuitTrait for IntroducerCircuit {
type Input = (); // TODO
type Targets = ();

/// return dummy inputs that will satisfy the circuit. This is used to generate the
/// dummy_proof.
fn dummy_inputs() -> Result<Self::Input> {
todo!();
}

/// set up the circuit logic
fn add_targets(builder: &mut CircuitBuilder<F, D>) -> Result<Self::Targets> {
todo!();
}

/// set the actual witness values for the current instance of the circuit. Returns a Vec<F>
/// containing the values that will be set as public inputs
fn set_targets(
pw: &mut PartialWitness<F>,
targets: &Self::Targets,
input: &Self::Input,
) -> Result<()> {
todo!();
}
}
2 changes: 2 additions & 0 deletions pod2/src/pod/gadget/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use core::fmt;
use serde::{Deserialize, Serialize};

pub mod introducer;
pub mod opexecutor;
pub mod plonky_pod;
pub mod schnorr_pod;

pub use introducer::IntroducerCircuit;
pub use opexecutor::OpExecutorGadget;
pub use plonky_pod::PlonkyButNotPlonkyGadget;
pub use schnorr_pod::SchnorrPODGadget;
Expand Down
Loading
Loading