Proof Submission Flow
The flow will be the following:
-
A proof submitter (rollup / zkApp) submits the proof via the
submitProofextrinsic of the appropriate verification pallet. The proof leafvaluewill be:leaf_digest = keccak256(keccak256(verifier_ctx), hash(vk), version_hash(proof), keccak256(public_inputs_bytes))In order to compute the
leaf_digest, the statement, with the previous formula, every verifier should define:verifier_ctx(a unique byte sequence)- how to hash the verification key
- how to get the hash version of the verifier to use if any
- how to extract a byte sequence from public inputs
Delivery owners must ensure that the delivery price is updated correctly over time.
-
If the proof is valid a
<VerifierPallet>::ProofVerifiedevent that contains the statement value is emitted; otherwise the transaction emits an error. -
The failing transaction will be included in the block anyway, and the user will pay fees for it. This is to prevent DoS attacks.
Domain Separated Aggregation
First perform the following checks:
- If no domain's identifier is provided, do nothing
- If the pointed domain exists but cannot accept a new proof emits a
CannotAggregateevent - If the submitter user has not enough funds to pay for his own aggregation cost share, emits again
CannotAggregateevent
If all these checks pass then:
- Hold from submitter's wallet his aggregation cost share
- Emit
Aggregate::NewProofevent, containing the digest of the proofstatement, the domain's identifierdomainIdand the aggregation's identifier in which the proof will be includedaggregationId. - If the current aggregation is complete emits
Aggregate::AggregationCompleteevent - The Proof Submitter should wait for the
Aggregate::NewAggregationReceiptwith thedomainId,aggregationId: is important to know the blockBwhere this event is emitted. - The Proof Submitter can retrieve the Merkle Path of the submitted proof via the
aggregate_statementPathRPC call supplying theat: the blockBwhere theAggregate::NewAggregationReceiptis emitteddomain_idaggregation_idstatement
Pallets
Some pallets have been developed to accommodate the requirements: