An open API service indexing awesome lists of open source software.

https://github.com/depapp/zk-job-board


https://github.com/depapp/zk-job-board

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# ZK Job Board - Midnight Network Challenge Submission

A privacy-preserving job board where applicants prove they meet job requirements without revealing their personal attributes, built using Midnight Network's Compact language and MidnightJS.

## Full Explanation on DEV.to Article
- https://dev.to/depapp/privacy-first-job-applications-with-midnight-network-ing

## 🎯 Overview

The ZK Job Board enables:
- **Employers** to post jobs with specific requirements (skills, experience, region)
- **Applicants** to prove they meet requirements without revealing their actual credentials
- **Privacy-first** interactions using zero-knowledge proofs
- **Anti-spam** protection via nullifiers (prevents double applications)

### Key Features

- βœ… **Zero-Knowledge Proofs**: Applicants prove eligibility without exposing personal data
- πŸ”’ **Privacy by Design**: Only proof validity is revealed, not underlying attributes
- 🎨 **Accessible UI**: WCAG-compliant interface with clear privacy indicators
- πŸš€ **Midnight Integration**: Uses Compact circuits and MidnightJS for ZK functionality
- πŸ“ **Apache 2.0 Licensed**: Fully open-source

## πŸš€ Quick Start

### Prerequisites

- Node.js 18+ and npm
- Git
- Modern web browser (Chrome, Firefox, Safari, Edge)

### Installation

```bash
# Clone the repository
git clone https://github.com/depapp/zk-job-board.git
cd zk-job-board

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your Midnight testnet configuration

# Compile ZK circuits
npm run compile-circuits

# Deploy verifier contract (testnet)
npm run deploy-verifier

# Start development server
npm run dev
```

Visit `http://localhost:5173` to see the application.

## πŸ—οΈ Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Employer │────▢│ Job Policy │────▢│ On-Chain β”‚
β”‚ UI β”‚ β”‚ Creation β”‚ β”‚ Storage β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Applicant │────▢│ ZK Proof Gen │────▢│ Verifier β”‚
β”‚ UI β”‚ β”‚ (Midnight) β”‚ β”‚ Contract β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### Components

1. **Compact Circuits** (`circuits/`): Define the ZK logic for attribute verification
2. **Smart Contracts** (`contracts/`): On-chain verifier for proof validation
3. **React UI** (`app/`): User interface for employers and applicants
4. **MidnightJS Integration** (`app/lib/midnight.ts`): Proof generation and verification

## πŸ“‹ How It Works

### For Employers
1. Create a job posting with requirements:
- Required skills (e.g., TypeScript, React, ZK)
- Minimum experience level
- Allowed regions
2. Job policy is hashed and stored on-chain
3. Applicants can view requirements and apply

### For Applicants
1. Generate mock credentials (skills, experience, region)
2. Create a ZK proof that you meet job requirements
3. Submit proof without revealing actual attributes
4. System verifies proof and prevents double applications

### Privacy Guarantees
- βœ… Skills are proven as a subset match without revealing all skills
- βœ… Experience is proven as >= minimum without revealing exact years
- βœ… Region membership is proven without revealing specific location
- βœ… Nullifiers prevent double applications while maintaining unlinkability across jobs

## πŸ§ͺ Testing

```bash
# Run unit tests
npm test

# Run e2e tests
npm run test:e2e

# Test circuit constraints
npm run test:circuits
```

## πŸ“ Project Structure

```
zk-job-board/
β”œβ”€β”€ circuits/ # Compact ZK circuits
β”‚ β”œβ”€β”€ job_eligibility.cmp
β”‚ └── params.toml
β”œβ”€β”€ contracts/ # Smart contracts
β”‚ └── JobEligibilityVerifier.ts
β”œβ”€β”€ app/ # React application
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ routes/ # Page components
β”‚ β”‚ β”œβ”€β”€ components/ # Reusable UI components
β”‚ β”‚ β”œβ”€β”€ lib/ # Core logic & Midnight integration
β”‚ β”‚ └── state/ # State management
β”‚ └── index.html
β”œβ”€β”€ scripts/ # Build and deployment scripts
β”œβ”€β”€ tests/ # Test suites
β”œβ”€β”€ docs/ # Documentation
└── config/ # Configuration files
```

## πŸ” Security & Privacy

- All credentials are **mocked** - no real personal data is used
- Proofs are generated client-side - sensitive data never leaves your device
- Nullifiers prevent replay attacks while maintaining privacy
- Open-source for full transparency

## πŸ“„ License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.