Normalizes chained resolution proofs to a fixed public chain length k, for zero-knowledge UNSAT verification with ZkUnsat. This is the implementation accompanying the paper Scaling Zero Knowledge UNSAT Verification via Normalized Chaining (A. Karthikeyan, E. Kharitonov, K.S. Meel, A. Hithnawi).
ZkUnsat proves unsatisfiability of a CNF formula in zero knowledge, without revealing the underlying proof. It operates on fully unfolded resolution proofs, where every derived clause comes from exactly two parents. Fully unfolding chained resolution steps (of length m) introduces m-1 intermediate clauses, each requiring to be committed with the ZkRam, causing prover memory to scale with proof size rather than formula size.
This repository implements a preprocessing pipeline that normalizes chained resolution proofs so that every chain has exactly k weakened resolution steps. Short chains are padded (exploiting the fact that a clause weakly resolves with itself); long chains are split into a sequence of k-step chunks. The resulting k-Chain-ZkUnsat protocol reveals only the number of proof lines and the public parameter k while capturing the memory benefits of chaining without introducing leakage.
With k=16, the approach certifies roughly 62% more instances than baseline ZkUnsat on the SAT 2002 competition benchmarks, and for an equivalent number of certified instances, keeps peak prover memory below 25% of what the baseline requires.
formula.cnf + proof.prf (DIMACS CNF + LRUP proof)
|
v
src/lrup-to-res.py parse, regularize, compute pivot literals
|
v
intermediate.res resolution proof with explicit per-step pivots
|
v
src/normalize-proof.py split/pad chains to exactly k steps (Algorithm 1)
|
v
proof.prf.unfold_k k-chain weakened resolution proof for ZkUnsat
Both scripts are located in the src/ directory.
A modified version of the open source ExtendProof.py, one of ZkUnsat's preprocessing tools.
Reads a DIMACS CNF file and an LRUP proof, merges them into a single sequentially indexed proof, and reconstructs explicit pivot literals by replaying each resolution chain.
python src/lrup-to-res.py <formula.cnf> <proof.prf>
Output is written to stdout. Each line has the form:
index: <n> clause: <lits...> support: <indices...> pivot: <lits...> end: 0
A DEGREE: <n> line at the end reports the maximum clause width encountered, which determines the polynomial degree d used by the ZkUnsat PCS.
Deletion lines (d ...) in the LRUP proof are ignored.
An iterative implementation of the Normalize algorithm (Algorithm 1 in the paper; the paper presents it recursively). Takes the output of lrup-to-res.py and rewrites every resolution chain to have exactly k steps. Chains shorter than k steps are padded by prepending weak self-resolution steps on the first antecedent (pivot 0). Chains longer than k steps are split into sequential k-step chunks; the derived clause from each chunk becomes the first support of the next.
python src/normalize-proof.py <prooffile> <k> [output_file]
Output defaults to <prooffile>.unfold_<k>.
Usage note: k must be chosen a priori, independently of the proof structure. Running the protocol for multiple values of k on the same parent proof can leak chain-length information (see Section 5.1 of the paper).
python src/lrup-to-res.py test-benchmarks/dimacs/23.shuffled.cnf test-benchmarks/trimmed-proofs/23.shuffled.prf > example.res
python src/normalize-proof.py example.res 16 example.unfold_16
zkunsat 1 8000 127.0.0.1 example.unfold_1623.shuffled.cnf is a permuted SAT Competition 2002 instance (198 variables, 474 clauses). 23.shuffled.prf is a corresponding LRUP refutation with deletion hints derived using CaDiCaL and lrat-trim as mentioned in Section 6.1.
test-benchmarks/ contains a selection of benchmarks from the SAT 2002 competition, with CNF formulas in dimacs/ and their corresponding trimmed LRUP proofs in trimmed-proofs/.
zkunsat here is a placeholder for the ZkUnsat binary. The first argument determines the role of the party (1 -- prover, 2 -- verifier). The second and third arguments are the port and IP address for prover-verifier communication. If both parties are on the same machine, 8000 and 127.0.0.1 are sufficient. The final argument is the proof file output by normalize-proof.py (only used by the prover).
experimental-results/ contains CSVs from running the full pipeline over SAT 2002 competition benchmarks for k in {1, 3, 5, 16, 32}.
all_runtime_csvs_25000s/<k>-chain-zkunsat-final-runtimes.csv- per-instance runtime dataall_mem_csvs_25000s/<k>-chain-zkunsat-final-peak-mem.csv- per-instance peak memory
CSV columns: test_file, zkunsat_success, nres (number of resolution chains), ncls (number of clauses committed with ZkRam), DEGREE (max clause width), a (ZkRam access time), r (resolution time), i (input time), t (total time), communication (bytes).
The suffix _25000s refers to the 25,000-second wall-clock budget used for these runs.
The 1 instance reported as warning in the 1-Chain-ZkUnsat results is explained in the footnote in Section 6 of the paper.
experiment-logs/ contains the raw ZkUnsat output and peak memory logs from the experimental runs. The logs are split into two phases:
- Phase 1 (
phase-1/): Initial runs of k-Chain-ZkUnsat with ZkUnsat's timeout set to 5,000 seconds. - Phase 2 (
phase-2/): Re-runs of the timed-out instances from Phase 1 with an extended 25,000-second timeout.
Each phase directory contains zkunsat-out-runtime-logs/ (ZkUnsat stdout) and peak-memory-logs/.
The 1 instance reported as warning in the 1-Chain-ZkUnsat logs is explained in the footnote in Section 6 of the paper.
CNF (23.shuffled.cnf): standard DIMACS format; c and p lines are skipped.
LRUP proof (23.shuffled.prf): each non-deletion line is <id> <lits...> 0 <hint indices...> 0. Lines containing d are deletion hints and are ignored.
Intermediate resolution format: space-separated fields with keyword markers index:, clause:, support:, pivot:, end:. The empty clause is represented internally as {0}.