Giter Site home page Giter Site logo

ovoir's Introduction

๐Ÿ•ต๏ธ Noir Zero-Knowledge Voting Circuit

Overview ๐Ÿ“„

This project implements a zero-knowledge proof circuit using the Noir programming language, designed for secure and anonymous voting on a blockchain ๐ŸŒ. The circuit ensures that votes are counted without revealing the identity of the voters, leveraging cryptographic techniques to maintain privacy and integrity ๐Ÿ”’.

Features ๐ŸŒŸ

  • Anonymity ๐ŸŽญ: Ensures voter anonymity using zero-knowledge proofs.
  • Security ๐Ÿ”: Utilizes the ecrecover library for secure ECDSA signature recovery.
  • Efficiency โšก: Supports up to 64 votes in a single transaction, optimized for gas efficiency.
  • Verifiability โœ…: Each vote is verifiable without compromising voter privacy.

Requirements ๐Ÿ“‹

  • Rust programming language ๐Ÿฆ€
  • Noir Compiler ๐Ÿ–ฅ๏ธ

Structure ๐Ÿ—๏ธ

  • main: The main function that executes the zero-knowledge proof, verifying votes ๐Ÿ—ณ๏ธ.
  • test_main: A test function that demonstrates how to call the main function with sample data ๐Ÿงช.

Parameters ๐Ÿ“

  • chain_id: Blockchain identifier ๐Ÿ†”
  • proposal_id: On-chain proposal ID ๐Ÿ”–
  • num_votes: Number of votes ๐Ÿ“Š
  • vote: Array indicating votes (1 for yes, 0 for no) ๐Ÿ‘๐Ÿ‘Ž
  • pub_key_x, pub_key_y: Public key coordinates for ECDSA ๐Ÿ”‘
  • signature: Signatures corresponding to each vote ๐Ÿ–‹๏ธ
  • hashed_message: Hashed messages that correspond to each vote ๐Ÿ“
  • index, hashpath: Merkle proof components ๐ŸŒฒ
  • root: Merkle root for validation ๐Ÿ

Usage ๐Ÿš€

  1. Compilation: Compile the circuit using the Noir compiler ๐Ÿ› ๏ธ.
  2. Deployment: Deploy the compiled circuit to your preferred blockchain platform ๐Ÿ“ค.
  3. Execution: Execute the circuit by passing the required parameters (as demonstrated in test_main) ๐Ÿƒโ€โ™‚๏ธ.

Relevant commands ๐Ÿ› ๏ธ

nargo test: Run the test suite to ensure the circuit is functioning as expected.

nargo check: Build circuit constraints system and check for errors and warnings.

nargo prove: Generate a proof for the circuit using the specified parameters.

nargo verify: Verify a proof for the circuit using the specified parameters.

Contributing ๐Ÿค

Contributions are welcome! Please fork the repository and submit a pull request with your improvements ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป.

ovoir's People

Contributors

carlosgj94 avatar mario-so avatar

Watchers

 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.