compact-core:compact-privacy-disclosure

Identify undisclosed witness data in Compact contracts and apply disclose() at public boundaries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing privacy in Compact contracts is challenging due to witness taint tracking. This skill teaches how to correctly apply the disclose() annotation to reveal only what must be public, preventing unintended data leakage across ledger writes, circuit returns, and conditionals.

Core Features & Use Cases

  • Clarifies the Witness Protection Program model and how to place disclose() accurately at public boundaries.
  • Covers common privacy patterns (commitments, nullifiers, MerkleTree proofs, unlinkable auth, selective disclosure) with practical guidance for real-world contracts.
  • Provides debugging workflows for fixing "potential witness-value disclosure must be declared" errors and implementing safe, auditable privacy designs.

Quick Start

Place a disclose() around the witness-derived values at the first public boundary to resolve compiler errors.

Frequently Asked Questions about compact-core:compact-privacy-disclosure

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

FAQPage Schema
Why does my Compact smart contract fail with a witness-value disclosure error?

A witness-value disclosure error occurs when private witness data reaches a public boundary without explicit permission. You must wrap witness-derived values in a disclose() annotation at the first public boundary to safely reveal them.

How do I apply disclose() correctly in Compact contracts?

To apply disclose() correctly in Compact contracts, wrap witness-derived values at the exact public boundary where data exits private scope, such as ledger writes, exported circuit returns, or conditional branches, to prevent unintended leakage.

What is the Witness Protection Program tracking model for Compact privacy?

The Witness Protection Program tracking model monitors how private witness data flows through Compact contracts. It enforces domain separation, commitments, nullifiers, and selective disclosure to ensure only explicitly disclosed data becomes public.

When do I need to use disclose() for ledger writes and circuit returns?

You need to use disclose() for ledger writes and exported circuit returns whenever witness-tainted data crosses into a public scope. Applying it at these boundaries ensures the compiler recognizes intentional selective disclosure and passes privacy checks.

Can I implement commitments and nullifiers without triggering witness taint errors?

Yes, you can implement commitments, nullifiers, and MerkleTree proofs without triggering witness taint errors by ensuring all derived values crossing public boundaries are wrapped in disclose() to declare the exact scope of selective disclosure.

What are the limitations of using disclose() for privacy patterns in Compact?

The limitation of disclose() is that it must be placed precisely at the first public boundary; incorrect placement can still leak witness data across conditionals or fail to resolve compiler errors regarding undisclosed witness values in privacy patterns.