Why
StmCertificateCircuit implements the Relation trait of the Midnight standard library, while IvcCircuitData implements the lower level Circuit trait with a hand written configuration. The two circuits therefore produce verifying keys in different formats and the IVC configuration duplicates what ZkStdLibArch already provides.
What
Move the IVC circuit onto Relation, so that both circuits share the same configuration mechanism and the same verifying key format.
How
Jia's explanation
Simplify configuration of the IVC circuit for Midnight-SK setup:
fn used_chips(&self) -> ZkStdLibArch {
ZkStdLibArch {
jubjub: true,
poseidon: true,
sha2_256: true,
sha2_512: false,
keccak_256: false,
sha3_256: false,
secp256k1: false,
bls12_381: true,
base64: false,
nr_pow2range_cols: 4,
automaton: false,
blake2b: false,
}
}
Then move the ivc circuit code in fn synthesize to fn circuit from Relation .
If we do this, both ivc_vk and cert_vk will have the same format MidnightVK
VerifierGadget is available here https://github.com/midnightntwrk/midnight-zk/blob/main/zk_stdlib/src/lib.rs#L847
it is also available in midnight-zk-stdlib = { version = "2.3.0" }
Then move the ivc circuit code in fn synthesize to fn circuit from Relation .
If we do this, both ivc_vk and cert_vk will have the same format MidnightVK
VerifierGadget is available here https://github.com/midnightntwrk/midnight-zk/blob/main/zk_stdlib/src/lib.rs#L847
it is also available in midnight-zk-stdlib = { version = "2.3.0" }
Why
StmCertificateCircuitimplements theRelationtrait of the Midnight standard library, whileIvcCircuitDataimplements the lower levelCircuittrait with a hand written configuration. The two circuits therefore produce verifying keys in different formats and the IVC configuration duplicates whatZkStdLibArchalready provides.What
Move the IVC circuit onto
Relation, so that both circuits share the same configuration mechanism and the same verifying key format.How
synthesizeto thecircuitmethod ofRelation(circuits/halo2_ivc/circuit.rs)ZkStdLibArchand drop the hand written column pool computation (circuits/halo2_ivc/config.rs)VerifierGadgetfrommidnight-zk-stdlibfor the in-circuit certificate proof verificationJia's explanation