zk-proof-engineering
БесплатноБез исполняемых скриптовНе проверенDesign, build and audit zero-knowledge proof systems: choosing SNARK/STARK and zkVMs, writing circuits in Circom, Noir or Halo2, avoiding under-constrained…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
Zero-Knowledge Proof Engineering
Reply in the user's language. ZK is easy to get subtly wrong: the most common real-world bug is a circuit that proves less than intended. Treat every circuit as security-critical code. Prototype on testnets only; mainnet deployment and keys stay with the user.
1. Do you need ZK at all?
ZK proves a statement is true without revealing the witness (privacy) and/or proves a computation was done correctly cheaply to verify (succinctness). If neither privacy nor succinct verification is required, a signature, a hash commitment or a trusted server is simpler. Say so.
2. Choose the stack
| Need | Option |
|---|---|
| Prove general Rust/C programs, fastest to build | zkVMs: SP1, RISC Zero (write normal code, prove execution) |
| Small custom circuit, cheapest Ethereum verification | Circom + Groth16 (needs a per-circuit trusted setup) |
| Developer-friendly language, universal setup | Noir (PLONK-family backends) |
| Maximum control and performance | Halo2 (Rust), arkworks, gnark (Go) |
| Transparent setup, post-quantum-leaning, large computations | STARKs (Cairo/Starknet, Winterfell, Plonky3) |
| Trade-offs to state: proof size, verifier cost (gas), prover time and memory, setup trust, audit maturity. |
3. Circuit design rules
- Write the statement in plain math first: public inputs, private witness, and every constraint that must hold.
- Field arithmetic is modulo a large prime: there is no native overflow, so range-check every value that represents an integer, byte, boolean or array index (
x * (x - 1) = 0for booleans; bit decomposition for ranges). - Under-constrained bugs: in Circom,
<--assigns a value without constraining it; every<--needs matching===constraints. Prefer<==. Witness-generation code is not checked by the verifier. - Division and inverses: constrain
a * inv = 1and handle zero explicitly. - Comparisons, hashes and signatures: use audited library components (circomlib, Noir stdlib) and ZK-friendly hashes (Poseidon) inside circuits.
- Nullifiers for anonymous actions (voting, airdrops, mixers-for-legitimate-privacy): derive from secret and context, check uniqueness on-chain, and bind public inputs to the context to stop replay.
4. Test and audit
- Unit tests with valid witnesses AND adversarial ones: for each constraint, try to make a wrong witness pass. If it passes, the circuit is under-constrained.
- Static analysis: circomspect for Circom; dedicated under-constraint checkers where available (for example Veridise Picus); differential tests against a plain implementation.
- Independent audit before any real value depends on it.
5. Setup and deployment
- Groth16: run or join a multi-party trusted-setup ceremony; the setup is only safe if at least one participant destroyed their toxic waste. PLONK-style systems use a universal setup (e.g. Powers of Tau); STARKs need none.
- Generate the verifier contract with the toolchain, test it on a testnet, check public-input ordering and field bounds in the verifier.
- Never put secrets in public inputs or logs; the witness stays on the prover's machine.
6. Performance
Constraint count drives prover time: minimise non-native arithmetic and hashing, use lookups where the system supports them, batch or recursively aggregate proofs, and benchmark prover memory early.
7. Legal and ethical
Privacy tools can be regulated (sanctions, AML). Help with legitimate privacy, identity, voting, scaling and verifiable computation; refuse designs whose purpose is laundering funds or evading sanctions.
Verified tooling
Runnable: python3 tools/zkdemo.py implements non-interactive Schnorr by Fiat-Shamir, Pedersen commitments and Merkle inclusion proofs. 12/12 properties verified: proofs verify, are bound to their message, fail under another key, fail when tampered with, cannot be forged without the secret, and differ between runs of the same secret; commitments are additively homomorphic and hiding; Merkle proofs verify and reject forged leaves. Educational only — no constant-time guarantees. Never use it to protect real value.
Установить zk-proof-engineering в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл zk-proof-engineering?
Design, build and audit zero-knowledge proof systems: choosing SNARK/STARK and zkVMs, writing circuits in Circom, Noir or Halo2, avoiding under-constrained bugs, trusted setups, on-chain verifiers and performance. Use for zero-knowledge, zk-SNARK, ZK circuit, zkVM, privacy proof.
Как установить скилл zk-proof-engineering?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл zk-proof-engineering запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic