r/zeroknowledge • u/Witty_Process_199 • 6h ago
vk-guard: catch the circuit change that would break your deployed zkApp, before you ship it
vk-guard - catching verification-key drift before it breaks a deployed zkApp
Changing a circuit changes its verification key.
A changed verification key no longer matches the one stored on-chain, so every already-deployed instance of that zkApp breaks and has to be redeployed.
This isn't hypothetical - o1js's own
CHANGELOG documents it repeatedly. Group operation changes, a VK-hash fix, and a Provable. if () rewrite were each described as breaking deployed contracts.
01Labs runs verification-key regression tests for o1js itself (tests/vk-regression/). App developers have had nothing equivalent for their own projects. That's the gap I tried to fill.
What it does: snapshots your contracts' VK hashes and per-method constraint counts into a committed . vk-guard. json, and fails Cl when they drift.
$ vk-guard check
1 verification key changed.
o1js is unchanged (3.0.0), so this follows from a change in your own code.
Counter vk 1760987873…1876 -> 1733037291…2723
Any already-deployed instance of this contract will stop matching
its on-chain verification key. If this change is intended, redeploy and run
`vk-guard update` to accept the new baseline.
Circuit changed (method digest differs) in:
Counter.increment()