# Getting started building on Midnight

The resources I actually use, in the order I'd learn them. Every link below was
checked live when this guide was written.

## 1. Learn the model first

Midnight is not "a normal chain with a privacy setting". It splits state in
two: a **public state** anyone can verify, and a **private state** that lives
with the user. Zero-knowledge proofs connect them — you prove a statement
about private data without revealing the data. That one idea — selective
disclosure — explains almost every Midnight design choice.

- Official site: https://midnight.network/
- Developer docs: https://docs.midnight.network/

## 2. Get a wallet and testnet tokens

- **Lace** is the Midnight-aware wallet: https://www.lace.io/
- Build on testnet first. Testnet tokens have no value — never pay for them,
  and never point testnet software at real funds.

## 3. Write a contract in Compact

- **Compact** is Midnight's smart-contract language — TypeScript-flavoured,
  designed so the public/private split of every value is explicit in the code.
  Start from the examples in the docs and in the Midnight example repos
  catalogued on the [Privacy4All hub](https://kshot3000.github.io/Privacy4All/).

## 4. Understand NIGHT and DUST before you price anything

- **NIGHT** is the network token, held on Cardano.
- **DUST** is generated by holding NIGHT and pays for shielded transactions.
  Each NIGHT can sustain up to 5 DUST capacity (the model the estimator on
  the Privacy4All hub uses) — treat that as a ceiling, not a promise;
  generation depends on holdings and network parameters.

## 5. Steal good patterns from working apps

- **Night Messenger** — private DMs with selective disclosure:
  https://kshot3000.github.io/Night-Messenger-/
- **PlutusShield** — a Compact policy registry in a real insurance design:
  https://kshot3000.github.io/PlutusShield/

## Ground rules I build by

- Private by default, disclosure by choice — and say exactly which is which
  in the UI and the README.
- Local first: if a check can run in the user's browser (like the redactor
  and planner on the hub), it should never round-trip a server.
- Testnet first, always, and label testnet software as testnet software.
- Do money maths in integers (BigInt), never floats.

---

By Kyle Cox (@kshot9000) · Privacy4All: https://github.com/Kshot3000/Privacy4All
Tagging the Midnight team: @midnightntwrk (GitHub) · @MidnightNtwrk (X)
ADA donations: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
