Midnight Blockchain Development - Beginner › 1. Midnight, privacy-preserving DApps, and zero-knowledge proofs › Midnight, privacy-preserving DApps, and zero-knowledge proofs
Learning viewShow only the learning panels you need.
No video assigned to this section
The lesson can still contain reading, examples, practical work and a quiz.
Midnight, privacy-preserving DApps, and zero-knowledge proofs
1. Midnight, privacy-preserving DApps, and zero-knowledge proofs · 0 min · Midnight / Compact
Course path: Midnight Blockchain Development - Beginner. This chapter is part of a progressive Beginner to Intermediate to Advanced Midnight developer pathway.
Midnight, privacy-preserving DApps, and zero-knowledge proofs
Midnight is designed for decentralized applications that need to prove facts about data without publishing all of that data on-chain.
Learning objectives
Explain the difference between public ledger data and private input data.
Describe why zero-knowledge proofs are useful in a DApp.
Identify the roles of a contract, wallet, proof service, node, and indexer.
Choose data that should remain private in a simple application.
Core lesson
A conventional blockchain is excellent at making shared state verifiable, but public state can be a poor place for personal, commercial, or regulated information. Midnight adds a privacy-oriented execution model in which applications can keep inputs private while proving that rules were followed.
Compact is the smart-contract language used in the Midnight ecosystem. A Compact circuit expresses verifiable rules. The compiler turns that logic into artifacts that support zero-knowledge proof generation and application integration.
A useful mental model is to separate the system into public facts, private facts, and proofs. Public facts can be read from the ledger. Private facts stay with the user or application. Proofs let the network accept a valid transition without learning every private input.
This course does not begin with cryptographic mathematics. It begins with application design: decide what must be public, what must be private, and what claim the contract should verify.
Recommended workflow
Write a one-sentence application goal.
List every input the application needs.
Mark each input PUBLIC or PRIVATE.
Write one statement that the contract should be able to prove without exposing the private inputs.
Engineering and security note
Never assume that using zero-knowledge automatically makes an application private. Privacy starts with a deliberate data-flow design.
Hands-on goal
Design a privacy map for a training-certificate verifier that proves a learner met a pass requirement without publishing the raw assessment answers.
Compatibility note: The version numbers in this package are a research snapshot from 2026-09-09. Before running commands, compare them with the current Midnight compatibility matrix and release notes.
Practical tasksLocal progress: 0%
MBB1T1 - Practical Task 1
Create a table with public, private, and derived data for your chosen DApp.
MBB1T2 - Practical Task 2
Explain in your own words what a zero-knowledge proof accomplishes.
MBB1T3 - Practical Task 3
Draw the high-level path: user -> DApp -> proof -> transaction -> node -> ledger.
MBB1T4 - Practical Task 4
Find one example in the Midnight examples or awesome-dApps list that uses privacy as a core feature.
Lab note: This is a design lab. Store the text in your project notes; no code runner is required.
Practice Lab - Midnight, privacy-preserving DApps, and zero-knowledge proofs: Use this editable lab to practise the configuration or code from the lesson. This is a design lab. Store the text in your project notes; no code runner is required.