This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
zkvm: capping blockchain validation cost #402
Labels
consensus
Issues affecting consensus-level compatibility
The cost of validating a ZkVM blockchain consists of relaying and validating transactions. Relay cost is proportional to the size of the transaction, while validation cost is proportional to the number of multipliers used by the R1CS proof.
While R1CS proof size is logarithmic in number of multipliers, the validation cost is still reflected in the size of the program. This is because multipliers count is mostly affected by the outputs, and every output requires at least 96 bytes of data.
However, each transaction needs Bulletproofs generators prepared before the proof is verified. With the current Bulletproofs API we can begin constructing a verification CS, call
Verifier::multipliers_len
and doBulletproofGens::increase_capacity
accordingly and then finish withVerifier::verify
.Given the above, we can simply cap transactions by their encoded size, which is a good proxy for the total validation cost.
The text was updated successfully, but these errors were encountered: