Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Circuit trait impl for BlindBid circuit #70

Merged
merged 4 commits into from
Sep 30, 2020
Merged

Conversation

CPerezz
Copy link
Contributor

@CPerezz CPerezz commented Sep 28, 2020

Closes #65

CPerezz added 2 commits September 23, 2020 19:01
This is needed because the `Circuit` trait was released on this version.
@CPerezz CPerezz added area:cryptography anything related to cryptographic primitives, hashing and ZKP type:refactor labels Sep 28, 2020
@CPerezz CPerezz marked this pull request as ready for review September 29, 2020 12:17
Copy link
Contributor

@LukePearson1 LukePearson1 left a comment

Choose a reason for hiding this comment

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

Just a few small things. I didn't add a comment each time but its worth changing the misspelling of 'eligibility' or 'eligible', it's often written as variations of 'elegible'.

src/proof.rs Outdated
&mut self,
composer: &mut StandardComposer,
) -> Result<Vec<PublicInput>, Error> {
// Instanciate PI vector.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. *instantiate

src/proof.rs Outdated
bid.stealth_address.R().into(),
),
);
let bid_elegibility_ts =
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. *eligibility.

pi.push(PublicInput::BlsScalar(
-branch.root,
composer.circuit_size(),
));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be a double closure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WDYM by double closure? There's no closure in here. Is just pushing an enum to a vec.

Copy link
Contributor

Choose a reason for hiding this comment

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

The format on my screen was squashed and messed up, so it placed the braces in the wrong place.


// 6. 0 < value <= 2^64 range check
// v < 2^64
composer.range_gate(bid_value.var, 64usize);
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the range function naturally taking in a usize? If so, is the input of it here redundant?

src/proof.rs Outdated
let (ck, _) = pub_params.trim(1 << 16)?;
// Generate & save `ProverKey` with some random values.
let mut prover = Prover::new(b"TestCircuit");
// Set size & Pi builder
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. *PI

Copy link
Contributor

@vlopes11 vlopes11 left a comment

Choose a reason for hiding this comment

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

LGTM, lets consider in the future splitting the fn gadget into two phases

  • Prepare the required data
  • The circuit itself

Right now we have these two mixed into a single huge function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:cryptography anything related to cryptographic primitives, hashing and ZKP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement CircuitBuilder trait for blindbidproof
3 participants