core-concepts:zero-knowledge

Explain zero-knowledge proofs and Midnight's PLONK-based transaction validation.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill core-concepts-zero-knowledge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-concepts:zero-knowledge
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/core-concepts/skills/zero-knowledge
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill core-concepts-zero-knowledge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides clear, developer-focused explanations of zero-knowledge proofs and how Midnight uses them to validate transactions without exposing private data or user secrets.

Core Features & Use Cases

  • Conceptual overview: Explains ZK SNARK properties, the prover/verifier model, and zero-knowledge guarantees.
  • Technical mapping: Describes how Compact code compiles to arithmetic circuits, witness vs public inputs, gate constraints, and PLONK-based proving.
  • Developer guidance: Covers proof lifecycle, disclose semantics, performance tradeoffs, debugging tips, and references for deeper study.

Quick Start

Ask Claude to explain how a Compact contract's witnesses, public inputs, disclose() boundaries, and circuit constraints produce a PLONK-compatible proof for a private transaction.

Frequently Asked Questions about core-concepts:zero-knowledge

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do zero-knowledge proofs validate transactions without revealing private state?

Zero-knowledge proofs validate transactions by proving computational integrity through arithmetic circuits and witness inputs without exposing the underlying private state. Midnight uses this mechanism to verify transaction validity while keeping user data confidential.

How does Compact code compile to arithmetic circuits for PLONK-based proving?

Compact code compiles to arithmetic circuits by translating program logic into gate-level constraints, separating witness inputs from public inputs, and preparing the structure for PLONK-based proving. This process enables Zero-Knowledge SNARKs to generate verifiable proofs of private transactions.

What is the difference between witness inputs and public inputs in a ZK SNARK circuit?

Witness inputs are private values hidden during proof generation, while public inputs are visible data shared between the prover and verifier. In Midnight's Compact contracts, this distinction ensures that private state remains concealed while allowing necessary public validation.

Can I use PLONK universal SRS with per-circuit keys for private transactions?

Yes, PLONK uses a universal Structured Reference String (SRS) alongside per-circuit proving and verifying keys to secure private transactions. This setup allows multiple circuits to share the same trusted setup, reducing ceremony overhead while maintaining Zero-Knowledge proof integrity.

What are the performance tradeoffs when generating ZK proofs with disclose semantics?

Performance tradeoffs in ZK proof generation involve balancing circuit size, gate-level constraint complexity, and disclose() boundaries with proof generation time. Larger circuits with more constraints increase proving time but enable richer private transaction validation logic within Midnight.

Why does my Compact contract fail to produce a valid PLONK-compatible proof?

A Compact contract may fail to produce a valid PLONK-compatible proof due to incorrect witness and public input handling, malformed gate constraints, or improper disclose() boundary definitions. Debugging requires verifying circuit construction and ensuring constraint satisfaction across all witness values.