Dynamic Layout on L2
Proof verification with Integrity using dynamic
or all_cairo
layouts.
When we want to verify our proof with Integrity there are no issues if the proof was generated with the following layouts:
recursive
recusive_with_poseidon
dex
small
starknet
starknet_with_keccak
.
But if we wanted to verify proof that was generated with layouts dynamic
or all_cairo
we are going to run into issues. Those layouts are not supported by Integrity, because of complexity of their verification.
Double Verification for Integrity Compatibility
As a workaround we came up with sort of “double verification”
- Firstly, generate proof for initial program using desired layout like
dynamic
. This will allow proof to capture full execution of the program. - Then generate trace, proof and verify it, but instead of providing your program as
programFile
, use StarkWare’s verifier written in Cairo0 and provide proof from step 1 as an input.
You need to modify proof.json
you got from proof verification to have object with proof
key instead of direct object proof, so for example if you have proof.json
like this:
you need to modify it to look like this:
As a program you need to use Cairo0 verifier or simply use 0x193641eb151b0f41674641089952e60bc3aded26e3cf42793655c562b8c3aa0
program hash.
In the flow described above we are not directly verifying your program. Instead we proof that StarkWare’s verifier when executed on your proof passed verification. This indirect verification through double proving ensures compatibility with Integrity’s layout limitations.
Note: This is only necessary when verifying with Integrity. If its not required in your case you can skip this and proceed with standard verification.