This repository implements a decentralized lottery system that utilizes zero-knowledge proofs to ensure secure, private, and verifiable lottery operations. The project is divided into several components:
- circuits/: Contains Circom circuits and related scripts for generating zero-knowledge proofs.
- contracts/: Houses Solidity smart contracts for lottery logic, ticket management, and proof verification.
- frontend/ (optional): A Next.js-based decentralized application (DApp) for interacting with the smart contracts.
``` . ├── circuits/ # ZK circuits, artifacts, scripts, and tests ├── contracts/ # Solidity contracts, tests, and deployment scripts ├── frontend/ # (Optional) Next.js frontend DApp using ethers.js └── README.md # This file ```
- Node.js and npm/yarn.
- Foundry (for smart contract development).
- Circom and snarkjs (for zero-knowledge circuit compilation and proof generation).
- (Optional) Next.js for the frontend.
-
Navigate to the
contracts/directory. -
Install dependencies:
``` yarn install ```
-
Compile the contracts:
``` forge build ```
-
Run tests:
``` forge test --ffi ```
-
Navigate to the
circuits/directory. -
Install dependencies:
``` yarn install ```
-
Navigate to the
frontend/directory. -
Install dependencies:
``` npm install ```
-
Start the development server:
``` npm run dev ```
This project is licensed under the MIT License.