Giter VIP home page Giter VIP logo

bls-agg-dao's Introduction

DAO Protocol with BLS Aggregate Signature Verification

This DAO protocol allows for on-chain voting with BLS aggregate signature verification. It follows the OpenZeppelin standards for smart contract development and uses the elliptic curve 'alt_bn128' for BLS.

Features

  • On-chain voting: Allows for transparent and verifiable voting on the blockchain.
  • BLS aggregate signature verification: Uses BLS aggregate signatures to verify votes on chain. This approach allows multiple signatures to be combined into a single signature, which can be verified more efficiently than verifying each signature individually.
  • OpenZeppelin standards: Follows the best practices and standards set by OpenZeppelin for secure and reliable smart contract development.
  • Elliptic curve 'alt_bn128': Uses the elliptic curve 'alt_bn128' for BLS, which provides a balance of security and efficiency.

Dependencies

This project uses the following dependencies:

  • @nomiclabs/hardhat-ethers: For Ethereum development tasks.
  • @openzeppelin/contracts: For reusable smart contracts following best practices.
  • ethers: For interacting with the Ethereum blockchain.
  • mcl-wasm: For BLS signature operations.

Setup

  1. Clone the repository.
  2. Install the dependencies with yarn install.
  3. Generate key pairs with npx hardhat run scripts/generate-pairs.ts.
  4. Start a local Ethereum network with npx hardhat node.

Testing

To test the full DAO process, run the following scripts in order:

  1. Propose a new proposal with npx hardhat run scripts/propose.ts --network localhost.
  2. Vote on the proposal with npx hardhat run scripts/vote.ts --network localhost.
  3. Queue and execute the proposal with npx hardhat run scripts/queue-and-execute.ts --network localhost.

Running Tests

Run the tests with npx hardhat test.

Elliptic Curve 'alt_bn128' (also known as 'bn254')

This protocol uses the elliptic curve 'alt_bn128' which works on a 254 bit prime field, hence also referred to as 'bn254'.

  • We use ๐บ2 for public keys, and ๐บ1 for signatures and messages.
  • ๐บ1 Uncompressed is 64 bytes.
  • ๐บ2 Uncompressed is 128 bytes.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT license.

Credits

For more information on the implementation of BLS in Solidity, you can refer to this guide.

A special thanks to Kobi Gurkan for his pioneering work on implementing BLS in Solidity for the alt-bn128 (also known as bn254) elliptic curve. You can refer to his implementation here.

Parts of this project are based on the work done in this repository. I have used some of their code and adapted it for my purposes. I am grateful for their contribution to the open source community.

bls-agg-dao's People

Contributors

jjeangal avatar

Stargazers

 avatar  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.