What problem does it solve?
This Skill helps developers design and reason about privacy-preserving patterns for Compact smart contracts so on-chain protocols can hide sensitive values, prove membership anonymously, and prevent linkability or double-actions without leaking secret data. It synthesizes commitments, nullifiers, Merkle membership proofs, commit-reveal flows, selective disclosure, and round-based unlinkability into actionable guidance and threat mitigations.
Core Features & Use Cases
- Commitment vs Hash Guidance: When to use persistentCommit (hiding with randomness) versus persistentHash or transient variants, and how witness taint is affected.
- Nullifier Construction & Domain Separation: Patterns to derive round-specific or purpose-specific nullifiers and store them safely in Sets to prevent double-actions.
- MerkleTree & HistoricMerkleTree Usage: End-to-end anonymous membership proofs, computing merkleTreePathRoot from full path structs, and TypeScript witness integration for path construction.
- Selective Disclosure & Threat Model: Techniques to disclose boolean checks only, mitigate leaf-guessing, and plan capacity and timing to reduce deanonymization risks.
- Use Case Example: Build an anonymous voting system where members register commitments, prove membership with Merkle paths, and cast one vote per round via nullifiers.
Quick Start
Ask the assistant to design a Compact circuit that registers members with HistoricMerkleTree, derives round-specific nullifiers via domain-separated persistentHash, and enforces a commit-reveal or single-action-per-round flow while preserving selective disclosure.