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

Plonk Anchor Vanchor #169

Merged
merged 24 commits into from
Mar 1, 2022
Merged
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
2 changes: 2 additions & 0 deletions arkworks-circuits/src/circuit/vanchor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::Vec;

use ark_crypto_primitives::{crh::CRHGadget, CRH};
use ark_ec::TEModelParameters;
use ark_ff::fields::PrimeField;
use ark_r1cs_std::{eq::EqGadget, fields::fp::FpVar, prelude::*};
use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystemRef, SynthesisError};
Expand All @@ -20,6 +21,7 @@ use arkworks_gadgets::{
merkle_tree::{constraints::PathVar, Config as MerkleConfig, Path},
set::constraints::SetGadget,
};
use arkworks_utils::poseidon::PoseidonParameters;

pub struct VAnchorCircuit<
F: PrimeField,
Expand Down
3 changes: 2 additions & 1 deletion arkworks-gadgets/src/merkle_tree/simple_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ark_std::error::Error for MerkleError {}
#[derive(Clone)]
pub struct Path<F: PrimeField, H: FieldHasher<F>, const N: usize> {
pub path: [(F, F); N],
_marker: PhantomData<H>,
pub _marker: PhantomData<H>,
}

impl<F: PrimeField, H: FieldHasher<F>, const N: usize> Path<F, H, N> {
Expand Down Expand Up @@ -167,6 +167,7 @@ impl<F: PrimeField, H: FieldHasher<F>, const N: usize> SparseMerkleTree<F, H, N>
Ok(smt)
}

/// This returns the Merkle tree root
pub fn root(&self) -> F {
self.tree
.get(&0)
Expand Down
1 change: 1 addition & 0 deletions arkworks-plonk-circuits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ark-crypto-primitives = { version = "^0.3.0", features = ["r1cs"], default-featu
ark-ff = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
plonk-core = { version = "^0.8", git = "https://github.com/ZK-Garage/plonk", features = ["trace"], default-features = false }
plonk-hashing = { git = "https://github.com/ZK-Garage/plonk.git", branch = "poseidon_hash" }

ark-poly-commit = { version = "^0.3.0", default-features = false }
ark-poly = { version = "^0.3.0", default-features = false }
Expand Down
Loading