Build MidnightSmart Contractsin Minutes.
A browser-based playground for learning and building with Compact. Write, simulate, and deploy — no setup required.
pragma language_version >= 0.20; import CompactStandardLibrary; export enum Status { OPEN, PAUSED } // public on-chain stateexport ledger count: Counter;export ledger status: Status;export ledger owner: Bytes<32>; // private witness — never revealed on-chainwitness secretKey(): Bytes<32>; constructor() { status = Status.OPEN; owner = disclose(persistentHash<Bytes<32>>(secretKey()));} export circuit increment(): [] { assert(status == Status.OPEN, "Counter is paused"); count.increment(1);} export circuit pause(): [] { assert(owner == persistentHash<Bytes<32>>(secretKey()), "Only the owner can pause"); status = Status.PAUSED;}Features
Everything you need
to build with Compact.
Smart Code Editor
Browser IDE with syntax highlighting, auto-completion, and real-time error reporting — purpose-built for the Compact language.
Live Simulation
Execute contract circuits instantly. See inputs, outputs, and witness generation without spinning up a local node.
Privacy Visualization
Visually distinguish public and private data flows in your contracts. Understand exactly what is revealed on-chain.
One-click Deploy
Deploy to the Midnight testnet or mainnet with a single click. Connect your wallet and ship without any CLI setup.
Built-in Templates
Start from battle-tested templates — tokens, voting systems, access control, and more. Go from zero to deployed in minutes.
How It Works
From idea to deployed
contract in three steps.
Start with a template
Pick from a library of production-ready Compact templates — tokens, governance, access control, private voting. Or start from scratch.
Edit and simulate
Write your logic in the browser editor and run live simulations. Inspect public vs. private data, test edge cases, and iterate instantly — ZK proofs included.
Deploy and interact
Connect your Midnight wallet, choose a network, and deploy with one click. Call your contract methods directly from the playground interface.
Developer Experience
Built for developers
who value their time.
No Docker. No config files. No dependency hell. Open your browser, write your contract, and you're building on Midnight.
pragma language_version >= 0.20;import CompactStandardLibrary;export enum State { VACANT, OCCUPIED }export ledger state: State;export ledger owner: Bytes<32>;export ledger sequence: Counter;// private — never revealed on-chainwitness localKey(): Bytes<32>;constructor() { state = State.VACANT; sequence.increment(1);}export circuit post(): [] { assert(state == State.VACANT, "Board is occupied"); owner = disclose(persistentHash<Bytes<32>>(localKey())); state = State.OCCUPIED; sequence.increment(1);}export circuit takeDown(): [] { assert(state == State.OCCUPIED, "Board is empty"); assert( owner == persistentHash<Bytes<32>>(localKey()), "Not the board owner" ); state = State.VACANT;}Get Started
Start building on
Midnight today.
Join developers already building privacy-preserving smart contracts on the Midnight blockchain. Free during early access.