Hello, I was wondering about the process of proof generation and verification in the Midnight system. In my previous experience with using zkdsl (Circom, Noir), I write a circuit, compile it, and create a pk and vk from the compiled(json) version of the contract. Then, I create a proof file using the pk and verify the proof either on-chain with Solidity smart contracts or on a ZK backend using the vk.
I am curious about how the proof verification process works in Midnight or if there’s a similar flow for my Compact contract. I am curious how the proof will be handled after the proof server generates a proof. would appreciate it if someone with a detailed understanding of the topic could clarify my question.
Great question. Your zkDSL background with Circom/Noir gives you a solid foundation for understanding Midnight’s proof system, though our approach abstracts away some of the manual steps you’re familiar with.
Unlike Circom/Noir where you manually manage proving/verification keys, Midnight handles this infrastructure for you:
Circuit Generation: When you write a Compact contract, the Midnight compiler automatically generates the necessary circuits under the hood.
Key Management: The proving and verification keys are managed by the network infrastructure, you don’t need to generate or distribute them manually.
Proof Generation: The proof server (running locally in Docker) handles proof generation when requested by your wallet/DApp.
For example:
Your DApp/wallet constructs a transaction then it sends the transaction data to your local proof server.
The proof server generates a zkSNARK proof then wallet receives the proof and bundles it with the transaction. Afterwards the transaction + proof is submitted to the Midnight network where the network validators verify the proof on-chain.
What Happens Behind the Scenes
The proof server has access to the proving keys for all deployed Compact contracts
When you deploy a Compact contract, its verification key is registered on-chain
The network nodes use these verification keys to validate proofs during transaction processing
The beauty of this approach is that you can focus on writing your Compact contract logic without worrying about circuit compilation, trusted setup ceremonies, or key distribution.
Midnight handles that complexity for you while still giving you the privacy guarantees of zero-knowledge proofs.
Let me know if that helps or you have more questions.