1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! Multi-circuit proof aggregation via IVC.
//!
//! This module provides an IVC-based proof aggregator that can aggregate proofs
//! from different inner circuits (i.e. circuits with different verifying keys)
//! into a single succinct proof.
//!
//! All inner circuits must share the same constraint system and evaluation
//! domain. They differ only in their verifying keys (fixed commitments).
//! Furthermore, all inner proofs must have been generated with the same SRS.
//!
//! The IVC state tracks:
//! - A list of claims off-circuit `(vk, statement)`.
//! - A succinct representation of such claims, in the form of the digest of a
//! hash chain (with Poseidon) over the `(hash(vk), statement)` pairs.
//! - An accumulator for deferred inner-proof verification (decider check).
//!
//! At each IVC step the transition function verifies one inner proof
//! in-circuit w.r.t. some witnessed `vk_hash` and some witnessed `statement`
//! folds the result into the running accumulator and hashes the
//! `(hash(vk), statement)` pair into the Poseidon chain.
//!
//! A verifier receives the final IVC proof together with the list of claims.
//! The public instance of the IVC proof is composed of the claims digest
//! (the tip of a Poseidon hash chain) and the inner-proof accumulator. Both are
//! constant-size regardless of how many proofs were aggregated.
//!
//! Verification consists of:
//!
//! 1. Verify the IVC proof against the public instance. This checks:
//!
//! a. The proof itself is valid w.r.t. the IVC verifying key.
//! b. The claims digest in the instance matches the Poseidon hash chain
//! recomputed from the provided list of claims (decider check).
//! c. The accumulated inner-proof verification passes the pairing check
//! (decider check).
//!
//! 2. Check that the aggregated claims are acceptable. Step 1 guarantees that
//! every claim has a valid inner proof, but says nothing about *what* was
//! proved. It is up to the verifier to decide whether the claims are
//! meaningful by checking that each VK belongs to a trusted circuit, whose
//! setup was run by the verifier and whose architecture is the expected one.
use Relation;
use crateF;
pub use ;
pub use ;
pub use ;
/// Extension of [`Relation`] for circuits whose proofs can be aggregated
/// w.r.t. a given IVC setup.
///
/// A relation is aggregable if it uses the
/// [`ZkStdLibArch`](midnight_zk_stdlib::ZkStdLibArch) chosen at IVC setup time,
/// is padded to the common circuit size `K`, and formats its instance into a
/// single public input.