As done by Polygon with Fri/Starks and Groth-16, would be nice to know how worth would it be to use IPA for complex and ammortization friendly situations, projects or schemes, and verify the final proof (Decider) with a KZG-based proving system such as TurboPlonk or similar.
Enabling then succint constant and sub-linear verification times. This is particularly useful for projects like the ZKEVMs, rollups, Proof of Validity of a chain etc..
Where we might have no constraints or limitations for the prover but we have a restricted envoiroment where we must verify the proofs (like the EVM).
Well, the first impression that we had was that why not using Pluto-Eris curves which have a cycle (so we can recurse with them) and where Pluto
in particular has a Pairing too?
So, at least for now Pasta curves seems a much better option. Even it lacks the pairing and that is really painful, it has other attractive properties such as the ones noted in the Pasta curves blogpost[1]
Aside from these, there are other factors that influence this line of thought:
We have a Virtual Machine(VM) which serves as a way to execute all the state changes performed on a blockchain to which we want to add support for KZG-based proof verification (pariring checks).
We also have an application like a Rollup or similar which consistently aggregates proofs for Txs, Blocks or whatever. And from time to time, wants to commit this to a big chain like Ethereum, Cardano, Zcash etc..
The application uses Halo2 with IPA and the modified accumulation scheme. On that way, it is capable of aggregating proofs until the decider needs to be validated.
Decider
corresponds to the latest verification performed which indeed verifies all the other ones.So what that means is that in the Plonk/Groth-16 proof, we will need to verify the IPA Decider (linear part of the accomulation scheme argument).
This implies that we need to construct a circuit for Halo2 that verifies a Multiscalar Multiplication/Multiexp of N items where
By simply computing using the halo2_cost_estimation tool it's easy to see that until we don't surpass the 2^24 constraints aprox, the speed verification isn't critical.
We've checked this by estimating 2^16 and 2^20 Degree circuits with maximum gate degree of 4 (which is decent enough) and 3 advice columns.
2^16 constraints
cargo run --release --example cost-model -- -a 0,1 -a 0 -a-0,-1,1 -f 0 -g 4 16
Finished release [optimized] target(s) in 0.05s
Running `target/release/examples/cost-model -a 0,1 -a 0 -a-0,-1,1 -f 0 -g 4 16`
Circuit {
k: 16,
max_deg: 4,
advice_columns: 3,
lookups: 0,
permutations: [],
column_queries: 7,
point_sets: 3,
estimator: Estimator,
}
Proof size: 1760 bytes
Verification: at least 91.174ms
2^20 constraints
cargo run --release --example cost-model -- -a 0,1 -a 0 -a-0,-1,1 -f 0 -g 4 20
Compiling ff v0.13.0
Compiling group v0.13.0
Compiling pasta_curves v0.5.0
Compiling halo2_proofs v0.2.0 (/home/kr0/Desktop/HDD/dev/halo/halo2_proofs)
Finished release [optimized] target(s) in 5.60s
Running `target/release/examples/cost-model -a 0,1 -a 0 -a-0,-1,1 -f 0 -g 4 20`
Circuit {
k: 20,
max_deg: 4,
advice_columns: 3,
lookups: 0,
permutations: [],
column_queries: 7,
point_sets: 3,
estimator: Estimator,
}
Proof size: 2016 bytes
Verification: at least 1176.901ms
That, is only possible if the VM works directly in the field of these curves of course. Otherwise, bignum arithmetic or field simulation is required which may blowup the gas costs. (There's alternatives to that such as precompiles or host functions. But this is another discussion).
Based on the results obtained in ZKEVM Community Edition the pippenger implementation of multiscalar multiplication necessary to execute the decider takes 19k constraints per term in the MSM.
This result is obtained using wrong field arithmetic to emulate non-native curves. We could expect a better ratio of constraint/MSM term when using a bigger wrapper curves such as Bls12-381.
In any case, 19k
Further reasoning and exploration has to be done here but requires us to take a deeper look to https://github.com/zcash/halo2/issues/249 & Aggregation strategies.
For example, there might be a smart way on which we can accumulate differently so that we take a bit more penalty during recursion but at the same time, we get benefits when we need to prove the Decider
.
Some helpful threads to pull from and adquire knowledge are: