This repository contains a collection of projects and tutorials for developing on the Midnight Network. It serves as a learning workspace for building privacy-preserving decentralized applications (dApps) using Compact contracts and TypeScript.
A simple introductory project demonstrating the basics of Midnight development.
- Contract:
hello-world.compact - Features:
- Stateless message storage.
- Basic public ledger interaction.
- "Hello World" of Midnight.
A more advanced dApp implementing a community bulletin board with state management and access control.
- Contract:
bulletin-board.compact - Features:
- State Machine: Tracks board state (Vacant/Occupied).
- Access Control: Only the poster can take down their message.
- Witnesses: Uses
local_secret_keyfor private authentication. - Interactive CLI: Post, Read, and Take Down messages.
- Node.js: v18+
- Midnight Compact Compiler: Installed via
@midnight-ntwrk/compactc(or system wide). - Midnight Lace Wallet: For Testnet interaction.
- Docker: (Optional) For running local proof servers or nodes.
-
Clone the repository:
git clone https://github.com/your-username/midnight-dev.git cd midnight-dev -
Setup Environment: Each project requires a
.envfile with your wallet seed.cp my-app/.env.example my-app/.env # Edit .env and add your WALLET_SEED -
Run a Project: Navigate to the project directory (e.g.,
bulletin-board) and run:npm install npm run build npm run deploy npm run start
- Contracts Overview: Detailed analysis of the Compact contracts.
- Learning Journey: Key concepts and takeaways from building these apps.
- Troubleshooting: Common issues and how to fix them.
MIT