If you're coming from the world of EVM and Solidity, you know the golden rule: everything on the blockchain is public. If you need to verify a user's identity, you typically have to store their public address or identity hash directly on-chain, creating a permanent, public trail of their activities.
Midnight Network flips this paradigm on its head. As a data-protection blockchain, it allows developers to build applications that protect sensitive data while still guaranteeing execution correctness through Zero-Knowledge (ZK) proofs.
In this guide, we're going to dive into Compact (Midnight’s TypeScript-inspired smart contract language) and explore a fundamental privacy pattern: Zero-Knowledge Identity Verification.
The Concept: Commit-Reveal Identity
To verify a user without exposing who they are, we use a pattern where:






