Skip to content

tusharpamnani/midnight-programs-list

Repository files navigation

Midnight Network

Midnight Programs Collection

Privacy-First Smart Contracts & Full-Stack DApps on Midnight Network

A curated collection of Midnight programs — from pure Compact contracts to full-stack DApps — built with Compact and TypeScript.

Repository Structure

Each program is organized in its own dedicated folder:

  • compact-[programname] — Pure Compact contract programs (CLI-based)
  • midnight-[projectname] — Full-stack DApps with frontend + contract

Programs Included

Legend:

  • 🟢 Completed
  • 🟡 In Progress
  • 🔴 Planned
  • 🏗️ Work in Progress
  • ✅ Tests Available
  • ❌ No Tests

Compact Programs (CLI)

Program Description Features Status
Hello World Hello World on Midnight Compact Public State ZK Proofs CLI 🟢 ❌
Counter Counter on Midnight Compact Public State ZK Proofs CLI 🟢 ❌
Escrow Escrow on Midnight Compact Public State ZK Proofs CLI 🟢 ✅
Todo Todo App on Midnight Compact Private State ZK Proofs CLI 🟢 ❌
Voting Voting App on Midnight Compact Commit-Reveal ZK Proofs CLI 🟢 ❌
Calculator Calculator on Midnight Compact Witness Function Verification CLI 🟢 ❌
Token Transfers Token Transfers on Midnight Compact Mint Shielded Unshielded CLI 🟢 ❌
Bulletin Board Bulletin Board on Midnight Compact Public State ZK Proofs CLI 🟢 ❌
Battleship Battleship game on Midnight Compact Private State ZK Proofs CLI 🟢 ❌
Allowlist Allowlist on Midnight Compact Private State ZK Proofs CLI 🟢 ✅
Bonding Curve Bonding Curve on Midnight Compact Private State ZK Proofs CLI 🟢 ✅
Quadratic Voting Quadratic Voting on Midnight Compact Private State ZK Proofs CLI 🟢 ❌
Coinflip Coinflip game on Midnight Compact Private State ZK Proofs CLI 🟢 ✅

Full-Stack DApps

Project Description Stack Status
Coinflip Coinflip game on Midnight Compact Private State ZK Proofs CLI 🟢 ✅
NFT Launchpad NFT Launchpad on Midnight Compact Private State ZK Proofs CLI 🟢 ❌

Programs and DApps are being added actively. Watch the repo for updates.

Prerequisites

Getting Started

  1. Clone the repository
git clone https://github.com/tusharpamnani/midnight-programs-list.git
cd midnight-programs-list
  1. Navigate to a program or DApp directory
# For a CLI program
cd compact-hello-world

# For a full-stack DApp
cd midnight-[projectname]
  1. Follow the program's own README.md for setup and deployment instructions

Project Structure

CLI Programs (compact-[programname]/)

compact-[programname]/
├── contracts/
│   ├── contract.compact       # Compact smart contract source
│   └── managed/               # Compiled artifacts (generated)
├── src/
│   ├── deploy.ts              # Deployment script
│   ├── cli.ts                 # Interactive CLI
│   └── check-balance.ts       # Wallet balance checker
├── docker-compose.yml         # Proof server config
├── package.json
└── README.md

Full-Stack DApps (midnight-[projectname]/)

midnight-[projectname]/
├── contracts/
│   ├── contract.compact       # Compact smart contract source
│   └── managed/               # Compiled artifacts (generated)
│   ├── src/
│   │   ├── index.ts           # Contract API & deployment logic
│   │   └── witnesses.ts       # Witness functions
│   └── package.json
├── ui/                        # Frontend application
│   ├── src/
│   │   ├── components/        # UI components
│   │   ├── hooks/             # Midnight.js React hooks
│   │   └── App.tsx
│   └── package.json
├── docker-compose.yml         # Proof server config
├── package.json
└── README.md

Key Concepts

Compact is Midnight's domain-specific language for writing ZK-provable smart contracts. It distinguishes between:

  • Private state — known only to the user, proved via ZK
  • Public ledger state — visible on-chain to everyone

Understanding this distinction is essential before diving into any program here.

Full-stack DApps connect Compact contracts to a browser-based UI using:

  • Midnight.js SDK — TypeScript SDK for interacting with contracts and the Midnight wallet
  • Lace Wallet — browser extension for signing transactions and managing keys
  • Proof Server — local Docker service that generates ZK proofs client-side

Getting Preprod Tokens

  1. Deploy any program to get your wallet address
  2. Visit https://faucet.preprod.midnight.network/
  3. Enter your address to receive test tokens (tNight)

Learn More

Contributing

PRs are welcome! Please open an issue first to discuss what you'd like to add.

License

MIT

About

Collection of Midnight programs to learn

Topics

Resources

License

Stars

Watchers

Forks

Contributors