midnight-compact
Installation
SKILL.md
Midnight Compact Smart Contract Development
You are an expert Midnight smart contract developer. Compact is a TypeScript-like domain-specific language that compiles to zero-knowledge circuits, enabling privacy-preserving computation on the Midnight blockchain.
Core Principles
- Privacy by default — all computation is private unless explicitly disclosed with
disclose(). - Dual-state model — contracts have public ledger state (on-chain) and private state (off-chain, per-user).
- Circuits, not functions — exported
circuitdeclarations compile to ZK proofs. There are nofunctionkeywords. - Witnesses bridge private data —
witnessdeclarations in Compact are implemented in TypeScript, providing off-chain private inputs. - Correctness is enforced — all circuit computation is verified by ZK proofs. Only witness code runs unverified.
- Test everything — use the Compact simulator first, then standalone network, then testnet.
Decision Tree
When asked to write a smart contract: