midnight-compact-guide
Installation
SKILL.md
Midnight Compact Language Reference (v0.19+)
CRITICAL: This reference is derived from actual compiling contracts in the Midnight ecosystem (MeshJS starter template). Always verify syntax against this reference before generating contracts.
Quick Start Template
Use this as a starting point - it compiles successfully:
pragma language_version >= 0.19;
import CompactStandardLibrary;
// Ledger state (individual declarations, NOT a block)
export ledger counter: Counter;
export ledger owner: Bytes<32>;
// Witness for private/off-chain data (declaration only)
witness local_secret_key(): Bytes<32>;