Hi, I'm trying to verify a proof from a circuit within another circuit. If I understand correctly, then DynamicProofs allow exactly that. However, when I try to compile the circuit, I receive an error that I am now allowed to use DynamicProofs directly despite having already created a class which extends Dynamic Proof.
Relevant code:
// Compile the verification key for AES128CTR
const { verificationKey: vk_data } = await AES128Ctr.compile();
const vk = new VerificationKey(vk_data);
class SideLoadedAESProof extends DynamicProof<
AES128CTRPublicInput,
AES128CtrPublicOutput
> {
publicInput: AES128CTRPublicInput;
publicOutput: AES128CtrPublicOutput;
maxProofsVerified: 1;
}
const AES128CTR256 = ZkProgram({
name: "aes-verify-ctr-256",
publicInput: SideLoadedAESProof,
methods: {
verifyAESCTR256: {
privateInputs: [],
async method(proof: SideLoadedAESProof) {
proof.verify(vk);
proof.publicInput.ctr.assertEquals(NUM_BLOCKS - 1);
// // Verify the ciphers
// const cipher_internal_hash = Poseidon.hashPacked(
// Provable.Array(Field, NUM_BLOCKS),
// [
// Poseidon.hashPacked(Byte16, input.ciphers[0]),
// Poseidon.hashPacked(Byte16, input.ciphers[1]),
// ],
// );
// cipher_internal_hash.assertEquals(proof.publicOutput.cipher_hash);
},
},
},
});
Error:
You cannot use the `Proof` class directly. Instead, define a subclass:
class MyProof extends Proof<PublicInput, PublicOutput> { ... }
I am currently using version 2.20 of o1js