ZK circuit
A ZK circuit is the precise, machine-checkable encoding of the statement a zero-knowledge proof is about. Before you can prove "this is true without revealing why," you must pin down exactly what "this" is as a system of arithmetic constraints over a finite field — the set of equations that the secret inputs (the witness) and the public inputs must jointly satisfy. The circuit is that constraint system; a valid proof certifies that the prover knows an assignment making every constraint hold.
Designing the circuit is where most of the engineering and most of the bugs live. A constraint that is too loose is the cardinal ZK sin: an under-constrained circuit accepts witnesses it should reject, letting a malicious prover produce a perfectly valid proof of something false — and because the proof verifies, no one downstream notices. Conversely, every extra constraint costs proving time, so designers fight to express logic in as few multiplication gates as possible, favoring SNARK-friendly primitives (Poseidon hashing, range checks via lookups) over EVM-native ones like Keccak.
Developers rarely hand-write constraints. Higher-level languages and frameworks — Circom, Halo2, Noir, Cairo, gnark — let you describe the statement in something closer to ordinary code and compile down to the circuit, emitting both a prover and a verifier. The same circuit is reused for every proof of that statement: a privacy-pool withdrawal circuit, a zk-rollup's state-transition circuit, or an identity proof is written once, audited hard, then instantiated with many different private witnesses.
The scariest ZK bugs are not in the cryptography but in the circuit. A sound proof system faithfully proving an under-constrained circuit will faithfully prove false statements — the math is correct, but the specification is wrong.