compact
Installation
SKILL.md
Compact Language Skill
Compact is Midnight's smart contract language. It looks like TypeScript but compiles to zero-knowledge circuits. The compiler handles all cryptographic machinery — you write business logic.
Primary references:
compact-book.vercel.app— structured example-driven reference (your best source)docs.midnight.network/compact— official spec (testing/security pages are "coming soon" as of 2026)
1) The Mental Model
Three non-negotiables before writing anything:
1. A circuit is a constraint system, not a function.
It declares relationships that MUST hold. The proof proves they held.