Code Monkey home page Code Monkey logo

polygon-zkevm's Introduction

Multiplier2 Circuit Template

This is a Circom circuit template that checks whether the value c is the result of multiplying values a and b. The circuit is built using custom gates for logical operations such as AND, NOT, and OR.

Circuit Overview

The circuit consists of the following components:

  1. Multiplier2: The main template that checks the multiplication relationship between inputs a and b.

  2. NOT: A template representing a NOT gate, which inverts the input signal.

  3. AND: A template representing an AND gate, which outputs 1 if both input signals are 1, otherwise 0.

  4. OR: A template representing an OR gate, which outputs 1 if at least one of the input signals is 1, otherwise 0.

Circuit Logic

  1. Multiplier2 template calculates the multiplication result using custom gates:
    • An AND gate is used to check whether both inputs a and b are 1. The output is stored in signal x.
    • A NOT gate is used to invert the input b. The output is stored in signal y.
    • An OR gate is used to check whether either x (result of AND) or y (inverted b) is 1, indicating that the multiplication condition is met. The final result is stored in signal q.

How to Use

  1. Install Circom version 2.0.0 or compatible version.

  2. Create your own Circom file and include the provided templates and logic as needed for your application.

  3. Instantiate the Multiplier2 template or any other components you need within your Circom file.

  4. Compile the Circom file to generate the corresponding circuit and constraints files using the Circom compiler.

  5. You can then use the generated circuit and constraints files with a compatible zk-SNARK library to perform zero-knowledge proofs on the circuit's correctness.

Credits

This project is created by Rajat Verma.

License

This project is licensed under the MIT License. For more details, refer to the LICENSE file included in the repository.

polygon-zkevm's People

Contributors

gmchad avatar thewreckingpanda avatar

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.