Dev.to
6/17/2026

What actually stays private on Midnight! (A builder's mental model)
Short summary
Midnight enforces privacy through three concepts: witness data (private), ledger state (public), and explicit disclose() declarations. The compiler prevents accidental data leaks but developers must manually disclose sensitive values and use fresh salts with commitments to prevent brute-force attacks on low-entropy hashes.
- •Privacy is opt-out by default; everything stays private unless explicitly disclosed via disclose()
- •Compiler tracks data provenance through witness derivations to catch hidden information leaks
- •Low-entropy values (votes, booleans) require fresh randomness in commitments to prevent brute-force enumeration
Generated with AI, which can make mistakes.
Is this a good recommendation for you?


