Skip to content
Early Access

Build Midnight
Smart Contracts
in Minutes.

A browser-based playground for learning and building with Compact. Write, simulate, and deploy — no setup required.

100%Browser-based
0sSetup time
ZKPrivacy built-in
PrivateCounter.compact
Simulating
1pragma language_version >= 0.20;
2 
3import CompactStandardLibrary;
4 
5export enum Status { OPEN, PAUSED }
6 
7// public on-chain state
8export ledger count: Counter;
9export ledger status: Status;
10export ledger owner: Bytes<32>;
11 
12// private witness — never revealed on-chain
13witness secretKey(): Bytes<32>;
14 
15constructor() {
16 status = Status.OPEN;
17 owner = disclose(persistentHash<Bytes<32>>(secretKey()));
18}
19 
20export circuit increment(): [] {
21 assert(status == Status.OPEN, "Counter is paused");
22 count.increment(1);
23}
24 
25export circuit pause(): [] {
26 assert(owner == persistentHash<Bytes<32>>(secretKey()),
27 "Only the owner can pause");
28 status = Status.PAUSED;
29}
Output
Compiled (2 circuits)
circuit increment (k=10, rows=29)
circuit pause (k=12, rows=41)
witness secretKey: shielded ✓
Ready to deploy · Midnight Preprod

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.

Unique

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.

01

Start with a template

Pick from a library of production-ready Compact templates — tokens, governance, access control, private voting. Or start from scratch.

02

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.

03

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.

No local setup
Runs entirely in your browser
Instant feedback
Simulate circuits in milliseconds
Zero boilerplate
Write contracts, not config files
Read the Compact docs
BulletinBoard.compact● Compact
1pragma language_version >= 0.20;
2
3import CompactStandardLibrary;
4
5export enum State { VACANT, OCCUPIED }
6
7export ledger state: State;
8export ledger owner: Bytes<32>;
9export ledger sequence: Counter;
10
11// private — never revealed on-chain
12witness localKey(): Bytes<32>;
13
14constructor() {
15 state = State.VACANT;
16 sequence.increment(1);
17}
18
19export circuit post(): [] {
20 assert(state == State.VACANT, "Board is occupied");
21 owner = disclose(persistentHash<Bytes<32>>(localKey()));
22 state = State.OCCUPIED;
23 sequence.increment(1);
24}
25
26export circuit takeDown(): [] {
27 assert(state == State.OCCUPIED, "Board is empty");
28 assert(
29 owner == persistentHash<Bytes<32>>(localKey()),
30 "Not the board owner"
31 );
32 state = State.VACANT;
33}
Compiled
circuits: post, takeDown
ZK proofs ready

Get Started

Start building on
Midnight today.

Join developers already building privacy-preserving smart contracts on the Midnight blockchain. Free during early access.

Read the docs →