dapp-sdd:implement
Use when executing implementation tasks with commits after each task and reviews after each phase.
Use when setting up Midnight development environment, installing Compact compiler and developer tools, configuring proof server, verifying prerequisites, or getting started with Midnight development.
Full skill instructions
Guide developers through setting up a complete Midnight development environment for building zero-knowledge smart contracts and dApps.
Before installing Midnight-specific tools, verify these prerequisites:
| Requirement | Minimum | Recommended | Check Command |
|---|---|---|---|
| Node.js | 18.x | 20.x LTS | node --version |
| npm | 9.x | Latest | npm --version |
| Docker | 20.x | Latest | docker --version |
| Git | 2.x | Latest | git --version |
| Chrome | Latest | Latest | Required for Lace wallet |
Run the prerequisite check script to verify:
bash ${CLAUDE_PLUGIN_ROOT}/skills/midnight-setup/scripts/check-prerequisites.sh
For detailed prerequisite verification:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/midnight-setup/scripts/check-prerequisites.py
Using nvm provides easy version management:
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Restart terminal or source profile
source ~/.zshrc # or ~/.bashrc
# Install Node.js 18 LTS
nvm install 18 --lts
nvm alias default 18
Important: After installing or switching Node versions, open a new terminal window. Simply sourcing the profile may leave stale references.
Download from docker.com/products/docker-desktop for your platform. After installation:
docker infoThe Compact developer tools manage compiler versions and provide the compact CLI:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh
After installation, add the binary to your PATH. The installer will show the exact path, typically:
# Add to ~/.zshrc or ~/.bashrc
export PATH="$HOME/.compact/bin:$PATH"
Then restart your terminal or source the profile.
With the developer tools installed, download the compiler:
# Download latest compiler
compact update
# Verify installation
compact --version # Shows developer tools version
compact compile --version # Shows compiler version
The proof server generates zero-knowledge proofs locally:
docker pull midnightnetwork/proof-server:latest
To start the proof server (when needed for development):
docker run -p 6300:6300 midnightnetwork/proof-server -- midnight-proof-server --network testnet
The Midnight Compact VS Code extension provides syntax highlighting and IntelliSense:
.vsix file from the Compact releasesFor testing dApps with a wallet:
After completing setup, verify everything works:
# Check all tools
node --version # Should be 18+
docker info # Should show Docker running
compact --version # Should show developer tools version
compact compile --version # Should show compiler version
# Check proof server image
docker images | grep proof-server
Or run the environment check command: /midnight:check
| Command | Purpose |
|---|---|
compact update | Download/update to latest compiler |
compact update <version> | Switch to specific version |
compact list | Show all available versions |
compact list --installed | Show locally installed versions |
compact check | Check for updates without downloading |
compact compile <file> <outdir> | Compile a contract |
compact compile +0.25.0 <file> <outdir> | Compile with specific version |
compact self update | Update the developer tools themselves |
compact help | Show help |
| Issue | Solution |
|---|---|
compact: command not found | Add ~/.compact/bin to PATH, restart terminal |
| Node version wrong after install | Open a new terminal window |
| Docker daemon not running | Start Docker Desktop application |
| Proof server won't start | Check Docker is running, port 6300 is free |
references/installation-steps.md - Detailed platform-specific instructionsreferences/bun-setup.md - Alternative setup using Bun runtimeFor troubleshooting, use the /midnight:doctor command or consult the midnight-debugging skill.
Use when executing implementation tasks with commits after each task and reviews after each phase.
Use when starting a new Midnight project, cloning example contracts (counter, tokens, NFTs, DEX), scaffolding from OpenZeppelin templates, or bootstrapping a Compact contract development environment with working starter code.
Use when caching ZK proofs for performance, implementing proof cache invalidation, storing verification results, caching intermediate proof components, or building distributed proof caches with Redis.
Use when setting up CI/CD for Midnight projects, configuring GitHub Actions for Compact contract compilation, running TypeScript tests in CI, validating version consistency, or automating contract builds.
Use when building witness data for ZK proofs, showing proof generation progress to users, implementing disclosure consent flows, handling proof timeouts and retries, or explaining privacy guarantees.
Use when implementing any Midnight example dApp to ensure compliance with quality standards and project conventions.
Use when implementing witness functions in TypeScript, mapping Compact types to TypeScript (Field→bigint, Bytes→Uint8Array), deploying contracts, calling circuits from TypeScript, reading ledger state, or building Midnight DApps with the JavaScript SDK.
Use when reading public ledger state, implementing reactive UI that updates with chain state, caching state for performance, or understanding public vs private state in Midnight DApps.
Use when optimizing prover performance, reducing proof generation memory usage, configuring prover infrastructure in Docker or Kubernetes, implementing parallel proof generation, or diagnosing prover bottlenecks.
Use when creating a phased implementation plan from a specification, with review gates after each phase.
Use when expanding a README-based dApp description into a full specification with user stories and acceptance criteria.
Use when calling deployed Midnight contracts from Node.js backends, querying contract state, executing state-changing transactions, building API endpoints that interact with contracts, or automating contract interactions.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience