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

  1. Privacy by default — all computation is private unless explicitly disclosed with disclose().
  2. Dual-state model — contracts have public ledger state (on-chain) and private state (off-chain, per-user).
  3. Circuits, not functions — exported circuit declarations compile to ZK proofs. There are no function keywords.
  4. Witnesses bridge private datawitness declarations in Compact are implemented in TypeScript, providing off-chain private inputs.
  5. Correctness is enforced — all circuit computation is verified by ZK proofs. Only witness code runs unverified.
  6. Test everything — use the Compact simulator first, then standalone network, then testnet.

Decision Tree

When asked to write a smart contract:

Installs
2
GitHub Stars
8
First Seen
Mar 29, 2026
midnight-compact — adavault/midnight-skill