https://github.com/aryprogrammer/festfund
Decentralized fundraising platform with Midnight Network integration enabling completely private donations while maintaining full transparency and accountability. Donors get public recognition while keeping donation amounts cryptographically private through dual ZK proof systems.
https://github.com/aryprogrammer/festfund
Last synced: 5 months ago
JSON representation
Decentralized fundraising platform with Midnight Network integration enabling completely private donations while maintaining full transparency and accountability. Donors get public recognition while keeping donation amounts cryptographically private through dual ZK proof systems.
- Host: GitHub
- URL: https://github.com/aryprogrammer/festfund
- Owner: ARYPROGRAMMER
- License: other
- Created: 2025-09-06T10:02:58.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-09-22T10:03:53.000Z (5 months ago)
- Last Synced: 2025-09-22T12:05:31.295Z (5 months ago)
- Language: TypeScript
- Homepage: https://festfund.vercel.app
- Size: 1.31 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ FestFund - Privacy-First Fundraising

[](#architecture)
[](https://festfund.vercel.app/)
[](https://www.youtube.com/watch?v=4dsZVYmTkkY)
[](https://vimeo.com/1116483249?share=copy)
**Tech Stack:**









*Note* : This project is no longer actively maintained. It was built as a demo for the Midnight Network Hackathon and serves as a reference implementation for privacy-first fundraising using zero-knowledge proofs.
**Thanks to Midnight:**
๐ **418x Performance Boost**: ZK proof generation reduced from 418ms to 1ms
๐ **Enterprise-Grade Privacy**: Built-in ZK circuits optimized for scale
๐๏ธ **Production Ready**: Robust testnet-02 infrastructure
- **Insomnia Collection**: https://docs.midnight.network/develop/nodes-and-dapps/nodes-endpoints
- **Testnet-02 RPC**: `https://rpc.testnet-02.midnight.network`
**How I Used in FestFund:**
1. **ZK Proof Infrastructure** - Automatic fallback to self-hosted mode
2. **Privacy Primitives** - Built-in cryptographic operations work in both modes
3. **Wallet Integration** - Seamless user authentication (MetaMask)
4. **Network Reliability** - Self-hosted mode ensures 100% uptime
### ๐ฏ **Integration Benefits**
**For Users:**
- โก Fast proof generation (1ms with Midnight, 418ms self-hosted)
- ๐ True privacy protection (guaranteed in both modes)
- ๐ Transparent rankings without data exposure
- ๐ป Smooth wallet connectivity
**For Developers:**
- ๐ฆ No external dependencies required (self-hosted mode)
- ๐ง Easy-to-use APIs and endpoints
- ๐ Automatic mode switching based on availability
### ๐ **ZK Mode Comparison**
**Traditional ZK Solutions**
- Complex circuit compilation
- Slow proof generation (418ms+)
- Manual infrastructure setup
- Limited documentation
**Midnight Network**
- **1ms proof generation**
- **Pre-optimized circuits**
- **Comprehensive documentation**
- **Active developer community**
**Private donations + Public rankings + Cryptographic verification = Privacy + Transparency solved**
- **๐ Midnight Challenge**: `MIDNIGHT_CHALLENGE_SUBMISSION.md`
- **๐ง API Documentation**: Backend routes in `/backend/routes/`
- **๐ฏ ZK Circuits**: Pre-compiled circuits in `/zk/build/`
---
**๐Quick Explanation for Busy People**
_Built with dual ZK infrastructure - works with or without Midnight Network_
๐ **Private Donations**: Amounts cryptographically hidden using ZK proofs
๐ **Public Recognition**: Verifiable leaderboard rankings without revealing amounts
โก **Flexible Infrastructure**: Midnight Network (1ms) OR self-hosted (418ms)
๐ฏ **Smart Milestones**: Cryptographic proof of goal achievement
๐ฅ **Dual Dashboards**: Separate interfaces for donors and organizers
๐ฎ **Achievement System**: Gamified experience with unlockable badges
๐ฑ **Responsive Design**: Works perfectly on all devices
๐ **Wallet Authentication**: Secure MetaMask integration / Midnight Wallet (if available)
## ๐ **Quick Start**
```bash
# Create hardhat blockchain, deploy contracts and use the wallet address
npx hardhat node
npm run deploy # in root
# Backend Start
cd backend && npm install && npm start
# โ
Backend running on http://localhost:3001
# Start Frontend (new terminal)
cd frontend && npm install && npm run dev
# โ
Frontend running on http://localhost:3000
# Backend .env can be ignored , backend can take from root
root .env:
NODE_ENV=development
APP_URL=http://localhost:3000
USE_MOCK_MODE=true
PORT=3001
BACKEND_URL=http://localhost:3001
CORS_ORIGIN=http://localhost:3000,http://localhost:3001
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
NEXT_PUBLIC_APP_NAME=FestFund
NEXT_PUBLIC_APP_DESCRIPTION=Privacy-First Donation Platform
NEXT_PUBLIC_USE_MOCK_WALLET=true
NEXT_PUBLIC_ENABLE_ANALYTICS=false
NEXT_PUBLIC_ENABLE_NOTIFICATIONS=true
NEXT_PUBLIC_DEFAULT_THEME=light
MONGODB_URI=&appName=
JWT_SECRET=your-super-secret-jwt-key-change-for-production
BCRYPT_SALT_ROUNDS=12
GEMINI_API_KEY=
NEXT_PUBLIC_BLOCKCHAIN_RPC=http://localhost:8545
NEXT_PUBLIC_CHAIN_ID=31337
PRIVATE_KEY=7c60d2cd7f18a7891ae8b169f2fdf082d44206acf9c331e81113343537b81fd0
NEXT_PUBLIC_FUND_MANAGER_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
NEXT_PUBLIC_VERIFIER_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
NEXT_PUBLIC_MOCK_ERC20_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
ZK_MODE=midnight-network
NEXT_PUBLIC_ZK_MODE=midnight-network
ZK_CIRCUIT_PATH=./zk/circuits
ZK_PROVING_KEY_PATH=./zk/build/proving_key.zkey
ZK_VERIFICATION_KEY_PATH=./zk/build/verification_key.json
ZK_CIRCUIT_WASM_PATH=./zk/build/donation_commitment_v1.wasm
VERIFIER_CONTRACT_PATH=./contracts/Verifier.sol
MIDNIGHT_RPC_URL=https://rpc.testnet-02.midnight.network
MIDNIGHT_INDEXER_URL=https://indexer.testnet-02.midnight.network/api/v1/graphql
MIDNIGHT_INDEXER_WS_URL=wss://indexer.testnet-02.midnight.network/api/v1/graphql/ws
MIDNIGHT_NETWORK_ID=TestNet
MIDNIGHT_WALLET_SEED=your_64_character_hex_seed_here_or_mnemonic_phrase
NEXT_PUBLIC_MIDNIGHT_RPC_URL=https://rpc.testnet-02.midnight.network
NEXT_PUBLIC_MIDNIGHT_NETWORK_ID=TestNet
NEXT_PUBLIC_MIDNIGHT_EXPLORER_URL=https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.testnet-02.midnight.network
ENABLE_LOGGING=true
# My Frontend .env.local
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
NEXT_PUBLIC_APP_NAME=FestFund
NEXT_PUBLIC_APP_DESCRIPTION=Privacy-First Donation Platform with Zero-Knowledge Proofs
NEXT_PUBLIC_CHAIN_ID=31337
NEXT_PUBLIC_ENABLE_ANALYTICS=false
NEXT_PUBLIC_ENABLE_NOTIFICATIONS=true
NEXT_PUBLIC_BLOCKCHAIN_RPC=http://localhost:8545
NEXT_PUBLIC_FUND_MANAGER_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
NEXT_PUBLIC_VERIFIER_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
NEXT_PUBLIC_MOCK_TOKEN_ADDRESS=0x5FbDB2315678afecb367f032d93F642f64180aa3
NODE_ENV=development
```
### **Privacy + Transparency Solution**
๐ **Donations stay 100% private** - amounts cryptographically hidden
๐ **Public recognition guaranteed** - verifiable leaderboard rankings
โก **ZK infrastructure** - proves the magic of Midnight Network
๐ฏ **Smart milestone releases** - funds unlock when goals are proven achieved
## **Dual ZK Architecture**
**Midnight Network Mode** โก
- Official testnet-02 integration
- 1ms proof generation
**Self-Hosted Mode** ๐
- Complete independence
- 418ms proof generation
- Full privacy control
## **Tech Stack**
**Privacy Infrastructure**: **Midnight Network** (Testnet-02)
**Frontend**: React/Next.js + TypeScript + Tailwind (Dark Mode)
**Backend**: Express.js + MongoDB + JWT Auth
**Blockchain**: Solidity + Hardhat + ZK Circuits
**ZK Integration**: Circom + SnarkJS + **Official Midnight SDK**
## **Screenshots**









## **Architecture Diagram**
```mermaid
graph TB
%% Core Components (8 total)
USER[๐ฅ Users & Donors]
FRONTEND[๐จ Next.js Frontend
:3000]
BACKEND[โก Express.js API
:3001]
DATABASE[(๐พ MongoDB
Database)]
BLOCKCHAIN[๐ Smart Contracts
Hardhat Network/Midnight Network]
%% ZK Infrastructure
ZK_LOCAL[๐ Self-Hosted ZK
Circom + SnarkJS
418ms Proofs
]
MIDNIGHT[๐ Midnight Network
Testnet-02
1ms ZK Proofs
โ
Default Mode]
%% Privacy Layer
PRIVACY[๐ Privacy Layer
Private Donations
Public Rankings]
%% Main Flow
USER --> FRONTEND
FRONTEND <--> BACKEND
BACKEND <--> DATABASE
BACKEND <--> BLOCKCHAIN
%% ZK Integration (Dual Mode - Self-hosted is primary)
BACKEND --> ZK_LOCAL
BACKEND -.-> MIDNIGHT
ZK_LOCAL --> PRIVACY
MIDNIGHT -.-> PRIVACY
%% Smart Contract Integration
FRONTEND --> BLOCKCHAIN
%% Styling
classDef userNode fill:#6b7280,stroke:#374151,color:#fff
classDef frontendNode fill:#3b82f6,stroke:#1d4ed8,color:#fff
classDef backendNode fill:#10b981,stroke:#047857,color:#fff
classDef dbNode fill:#f59e0b,stroke:#d97706,color:#fff
classDef blockchainNode fill:#6366f1,stroke:#4338ca,color:#fff
classDef zkNode fill:#ec4899,stroke:#be185d,color:#fff
classDef midnightNode fill:#7c3aed,stroke:#5b21b6,color:#fff,stroke-dasharray: 5 5
classDef privacyNode fill:#8b5cf6,stroke:#7c2d12,color:#fff
class USER userNode
class FRONTEND frontendNode
class BACKEND backendNode
class DATABASE dbNode
class BLOCKCHAIN blockchainNode
class ZK_LOCAL zkNode
class MIDNIGHT midnightNode
class PRIVACY privacyNode
```
## **Project Structure**
```
festfund/
โโโ backend/ # Express.js API server
โ โโโ routes/ # API endpoints (auth, privacy, proofs, rankings, achievements)
โ โโโ models/ # MongoDB data models
โ โโโ services/ # Business logic services
โ โโโ utils/ # Midnight integration & utilities
โโโ frontend/ # Next.js React application
โ โโโ components/ # UI components (privacy, campaigns, leaderboards)
โ โโโ pages/ # Application pages
โ โโโ contexts/ # React contexts (wallet, auth)
โ โโโ lib/ # Smart contract integration & utilities
โโโ contracts/ # Solidity smart contracts (FundManager, Verifier, MockERC20)
โโโ zk/ # ZK circuit files (Circom circuits, compiled artifacts)
โโโ scripts/ # Deployment and setup scripts
โโโ artifacts/ # Hardhat compilation artifacts
```
**๐ Privacy + Transparency = Cryptographic Magic**
_Powered by Midnight Network's ZK and Wallet infrastructure_
*Built with ๐ for the Midnight Network community - Arya Singh*