Git Product home page Git Product logo

circuits's People

Contributors

andriianchestnykh avatar arnaucube avatar demonsh avatar dependabot[bot] avatar ed255 avatar ilya-korotya avatar jbaylina avatar kolezhniuk avatar obrezhniev avatar olomix avatar tronch0 avatar vmidyllic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circuits's Issues

Review of circuits/idState.circom

Here's a review of circuits/idState.circom.

Checking that newIdState != 0 is done twice:

// check newIdState is not zero
component idStateIsNotZero = IsZero();
idStateIsNotZero.in <==newIdState;
idStateIsNotZero.out === 0;

component newNotZero = IsEqual();
newNotZero.in[0] <== newIdState;
newNotZero.in[1] <== 0;
newNotZero.out === 0;

The rest looks good and matches the design we discussed!

Can LessThan254 template be simplified?

In the comparators, the LessThan254 template has a component hiBitGt = GreaterThan(4) for comparing the high two bits (not four) but it looks like this is redundant. The output is calculated as out <== (hiBitEq.out * lt.out) + (hiBitLt.out * 1) + (hiBitGt.out * 0), where hiBitGt.out * 0 will always be 0. Can this be simplified to just: out <== (hiBitEq.out * lt.out) + (hiBitLt.out * 1)?

FYI @OBrezhniev

Enhancement: support >= and <= operators

For some scenarios, a GTE (>=) operator would be clearer than using GT. e.g. testing minimum asset value of $100,000 must currently be expressed as operator = GT with value = [99999], but GTE 100000 would be simpler and more in line with the intent.

It appears this could be implemented easily as an OR of the outputs for EQ and GT.

Similarly for LTE (<=).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.