Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ee92e4d
refactor(circuits)!: aggregate C6 proofs over Chonk
zahrajavar Nov 19, 2026
b80d00c
docs(blueprint): follow the C6 Chonk circuits
ctrlc03 Nov 19, 2026
7652065
refactor(zk): remove the sequential fold helpers C6 no longer uses
ctrlc03 Nov 19, 2026
39e5a40
fix(zk-build): count the C6 Chonk anchor keys in the manifest test
ctrlc03 Nov 19, 2026
a04728c
fix(zk-build): derive the C6 Chonk tube key as a rollup key
ctrlc03 Nov 19, 2026
fff20ca
fix(contracts): read the C6 Chonk root key in the VK binding test
ctrlc03 Nov 19, 2026
acb97f3
refactor(zk-prover): load the C6 tube and root circuits once per aggr…
ctrlc03 Nov 19, 2026
66b8bb9
docs(circuits): drop the retired C6 fold from comments
ctrlc03 Nov 19, 2026
dab6c1c
docs(blueprint): follow the moved C6 Chonk prover reference
ctrlc03 Nov 19, 2026
050993f
docs(blueprint): follow the decryption verifier call the NatSpec edit…
ctrlc03 Nov 19, 2026
8c48625
fix(zk-build): hydrate and stage the C6 tree anchor at its retired path
ctrlc03 Nov 19, 2026
ae2785c
docs: describe the C6 key list in the VK tree paragraph
ctrlc03 Nov 19, 2026
506d9c2
docs: rewrap the VK tree paragraph
ctrlc03 Nov 19, 2026
c9291e2
docs(contracts): name the C6 Chonk root in the decryption verifier Na…
ctrlc03 Nov 19, 2026
51f5327
docs(blueprint): follow predecessor_key_hash after the C6 fold hash r…
ctrlc03 Nov 19, 2026
97513fd
test(zk-prover): accept both nargo forms of an unsatisfied constraint
ctrlc03 Nov 20, 2026
05bf0bf
docs(blueprint): follow the C6 refs moved by the rebase onto main
Nov 21, 2026
1c0cc83
test(zk-build): probe an SS-only circuit in the synchronized selectio…
Nov 21, 2026
ce89d83
docs: record C6 over Chonk in the cutover and place its circuits in t…
Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions circuits/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ C2a and C2b proofs and hashes each one's chunk key tree into its key hash.
| `node_fold` | `NodeFold` | Folds C0, C1, `c2ab_fold`, `c3ab_fold`, and `c4ab_fold` for one node. |
| `nodes_fold`, `nodes_fold_kernel` | `NodesFold`, `NodesFoldKernel` | Folds the H `node_fold` proofs in sequence. |
| `dkg_aggregator` | `DkgAggregator` | Verifies `nodes_fold` and C5. Its EVM proof goes to `publishCommittee`. |
| `c6_fold`, `c6_fold_kernel` | `C6Fold`, `C6FoldKernel` | Folds the T + 1 C6 proofs of one ciphertext. |
| `decryption_aggregator` | `DecryptionAggregator` | Verifies `c6_fold` and C7. Its EVM proof goes to `publishPlaintextOutput`. |
| `c6_chonk_tube`, `c6_chonk_root` | `C6ChonkTube`, `C6ChonkRoot` | Close one ciphertext's C6 Chonk stack; its app and kernels are in `bin/chonk/`. |
| `decryption_aggregator` | `DecryptionAggregator` | Verifies `c6_chonk_root` and C7. Its EVM proof goes to `publishPlaintextOutput`. |

For recursive trust and public-input bindings, see
[proof statements](../docs/architecture/proof-statements.md#recursive-trust-and-exported-values).
Expand Down
4 changes: 4 additions & 0 deletions circuits/bin/chonk/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ members = [
"c3_chonk_init_kernel",
"c3_chonk_tail_kernel",
"c3_chonk_hiding_kernel",
"c6_chonk_app",
"c6_chonk_init_kernel",
"c6_chonk_tail_kernel",
"c6_chonk_hiding_kernel",
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "c6_fold"
name = "c6_chonk_app"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

Expand Down
55 changes: 55 additions & 0 deletions circuits/bin/chonk/c6_chonk_app/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Chonk app for C6: verifies a decryption's `T + 1` C6 proofs, checks they share one domain and
//! writes their sk, esm, ct and d commitments by slot, then the C6 leaf key hash
//! (`lib::math::chonk`). Every slot is filled: the stack holds the whole column.

use bb_proof_verification::{UltraHonkVerificationKey, UltraHonkZKProof, verify_honk_proof};
use lib::configs::default::T;
use lib::math::c6_chonk_rows::{assert_c6_domain, C6_PUBLIC_LEN, place_c6_leaves};
use lib::math::chonk::{C3_CHONK_LEAVES, C6_CHONK_DATA_LEN, C6_CHONK_LEAVES};

fn main(
leaf_vk: UltraHonkVerificationKey,
leaf_key_hash: Field,
proofs: [UltraHonkZKProof; C6_CHONK_LEAVES],
c6_public_inputs: [[Field; C6_PUBLIC_LEN]; C6_CHONK_LEAVES],
slot_indices: [u32; C6_CHONK_LEAVES],
) -> return_data [Field; C6_CHONK_DATA_LEN + 1] {
// One stack holds the whole column; bb's ECCVM bound was measured at 24 UltraHonk proofs per
// stack (`C3_CHONK_LEAVES`), so a larger committee needs a second stack.
std::static_assert(
C6_CHONK_LEAVES <= C3_CHONK_LEAVES,
"T + 1 C6 proofs must fit one Chonk stack",
);
for k in 0..C6_CHONK_LEAVES {
verify_honk_proof(leaf_vk, proofs[k], c6_public_inputs[k], leaf_key_hash);
}
let domain_hi = c6_public_inputs[0][3];
let domain_lo = c6_public_inputs[0][4];
assert_c6_domain(c6_public_inputs, domain_hi, domain_lo);
// `T + 1` leaves in distinct slots fill every slot.
let (sk, esm, ct, d) = place_c6_leaves(
[0; T + 1],
[0; T + 1],
[0; T + 1],
[0; T + 1],
c6_public_inputs,
slot_indices,
);
let mut out = [0; C6_CHONK_DATA_LEN + 1];
out[0] = domain_hi;
out[1] = domain_lo;
for i in 0..(T + 1) {
out[2 + i] = sk[i];
out[2 + (T + 1) + i] = esm[i];
out[2 + 2 * (T + 1) + i] = ct[i];
out[2 + 3 * (T + 1) + i] = d[i];
}
out[C6_CHONK_DATA_LEN] = leaf_key_hash;
out
}
8 changes: 8 additions & 0 deletions circuits/bin/chonk/c6_chonk_hiding_kernel/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "c6_chonk_hiding_kernel"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

[dependencies]
lib = { path = "../../../lib" }
bb_proof_verification = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v6.0.0", directory = "barretenberg/noir/bb_proof_verification" }
23 changes: 23 additions & 0 deletions circuits/bin/chonk/c6_chonk_hiding_kernel/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Chonk hiding kernel for C6: verifies the tail kernel, appends its key hash and makes the data
//! and the four key hashes the stack's public outputs.

use lib::math::chonk::{C6_CHONK_DATA_LEN, KernelVerificationKey, PROOF_TYPE_HN_FINAL};

fn main(
prev_outputs: call_data(0) [Field; C6_CHONK_DATA_LEN + 3],
kernel_vk: KernelVerificationKey,
) -> pub [Field; C6_CHONK_DATA_LEN + 4] {
std::verify_proof_with_type(kernel_vk.key, [], [], kernel_vk.hash, PROOF_TYPE_HN_FINAL);
let mut out = [0; C6_CHONK_DATA_LEN + 4];
for i in 0..C6_CHONK_DATA_LEN + 3 {
out[i] = prev_outputs[i];
}
out[C6_CHONK_DATA_LEN + 3] = kernel_vk.hash;
out
}
8 changes: 8 additions & 0 deletions circuits/bin/chonk/c6_chonk_init_kernel/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "c6_chonk_init_kernel"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

[dependencies]
lib = { path = "../../../lib" }
bb_proof_verification = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v6.0.0", directory = "barretenberg/noir/bb_proof_verification" }
22 changes: 22 additions & 0 deletions circuits/bin/chonk/c6_chonk_init_kernel/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Chonk init kernel for C6: verifies the app and appends the app key hash.

use lib::math::chonk::{AppVerificationKey, C6_CHONK_DATA_LEN, PROOF_TYPE_OINK};

fn main(
app_outputs: call_data(1) [Field; C6_CHONK_DATA_LEN + 1],
app_vk: AppVerificationKey,
) -> return_data [Field; C6_CHONK_DATA_LEN + 2] {
std::verify_proof_with_type(app_vk.key, [], [], app_vk.hash, PROOF_TYPE_OINK);
let mut out = [0; C6_CHONK_DATA_LEN + 2];
for i in 0..C6_CHONK_DATA_LEN + 1 {
out[i] = app_outputs[i];
}
out[C6_CHONK_DATA_LEN + 1] = app_vk.hash;
out
}
8 changes: 8 additions & 0 deletions circuits/bin/chonk/c6_chonk_tail_kernel/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "c6_chonk_tail_kernel"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

[dependencies]
lib = { path = "../../../lib" }
bb_proof_verification = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v6.0.0", directory = "barretenberg/noir/bb_proof_verification" }
22 changes: 22 additions & 0 deletions circuits/bin/chonk/c6_chonk_tail_kernel/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Chonk tail kernel for C6: verifies the init kernel and appends its key hash.

use lib::math::chonk::{C6_CHONK_DATA_LEN, KernelVerificationKey, PROOF_TYPE_HN};

fn main(
prev_outputs: call_data(0) [Field; C6_CHONK_DATA_LEN + 2],
kernel_vk: KernelVerificationKey,
) -> return_data [Field; C6_CHONK_DATA_LEN + 3] {
std::verify_proof_with_type(kernel_vk.key, [], [], kernel_vk.hash, PROOF_TYPE_HN);
let mut out = [0; C6_CHONK_DATA_LEN + 3];
for i in 0..C6_CHONK_DATA_LEN + 2 {
out[i] = prev_outputs[i];
}
out[C6_CHONK_DATA_LEN + 2] = kernel_vk.hash;
out
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "c6_fold_kernel"
name = "c6_chonk_root"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

Expand Down
42 changes: 42 additions & 0 deletions circuits/bin/recursive_aggregation/c6_chonk_root/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Closes the C6 Chonk tube's IPA claim as a root rollup and re-exposes its data behind one hash of
//! its seven key hashes (tube, tube, Chonk, C6 leaf, app, init, tail). The decryption aggregator
//! verifies this proof and binds that hash, with this circuit's key, to the anchored C6 tree.

use bb_proof_verification::{
RollupHonkProof, RollupHonkVerificationKey, verify_root_rolluphonk_proof,
};
use lib::math::chonk::{C3_CHONK_KEYS, C3_CHONK_OWN_KEY, C6_CHONK_DATA_LEN};
use lib::math::commitments::compute_vk_hash;

pub global C6_TUBE_PUBLIC_LEN: u32 = C3_CHONK_KEYS + C6_CHONK_DATA_LEN;

/// A root rollup closes exactly two IPA claims and a C6 column has one tube, so the prover passes
/// the tube twice. Both inputs verify under the tube's own key; only the first gives the statement,
/// and the root's final IPA check fails unless both accumulated claims are valid.
fn main(
tube_vk: RollupHonkVerificationKey,
tube_proofs: [RollupHonkProof; 2],
tube_publics: [[Field; C6_TUBE_PUBLIC_LEN]; 2],
) -> pub (Field, [Field; C6_CHONK_DATA_LEN]) {
let tube_key = tube_publics[0][C3_CHONK_OWN_KEY];
assert(tube_publics[1][C3_CHONK_OWN_KEY] == tube_key, "both inputs must be tube proofs");
for k in 0..2 {
verify_root_rolluphonk_proof(tube_vk, tube_proofs[k], tube_publics[k], tube_key);
}
// The tube's own key opens its public inputs, so the key list hash covers it.
let mut keys = [0; C3_CHONK_KEYS];
for k in 0..C3_CHONK_KEYS {
keys[k] = tube_publics[0][k];
}
let mut data = [0; C6_CHONK_DATA_LEN];
for i in 0..C6_CHONK_DATA_LEN {
data[i] = tube_publics[0][C3_CHONK_KEYS + i];
}
(compute_vk_hash(keys.as_vector()), data)
}
8 changes: 8 additions & 0 deletions circuits/bin/recursive_aggregation/c6_chonk_tube/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "c6_chonk_tube"
type = "bin"
authors = ["Gnosis Guild / Interfold"]

[dependencies]
lib = { path = "../../../lib" }
bb_proof_verification = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "v6.0.0", directory = "barretenberg/noir/bb_proof_verification" }
42 changes: 42 additions & 0 deletions circuits/bin/recursive_aggregation/c6_chonk_tube/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

//! Verifies the C6 Chonk stack's proof and exposes its data behind the Chonk key list
//! (`lib::math::chonk`): own key, tube key (the same), Chonk key, then the C6 leaf, app, init and
//! tail key hashes the stack's kernels appended. Proven as a rollup proof carrying an IPA claim.

use lib::math::chonk::{
C3_CHONK_KEYS, C6_CHONK_DATA_LEN, CHONK_PROOF_LENGTH, CHONK_VK_LENGTH, PROOF_TYPE_CHONK,
};

fn main(
chonk_vk: [Field; CHONK_VK_LENGTH],
chonk_key_hash: Field,
proof: [Field; CHONK_PROOF_LENGTH],
stack_outputs: [Field; C6_CHONK_DATA_LEN + 4],
own_key_hash: pub Field,
) -> pub ([Field; C3_CHONK_KEYS - 1], [Field; C6_CHONK_DATA_LEN]) {
std::verify_proof_with_type(
chonk_vk,
proof,
stack_outputs,
chonk_key_hash,
PROOF_TYPE_CHONK,
);

// The stack appended the leaf, app, init and tail key hashes after its data.
let mut keys = [0; C3_CHONK_KEYS - 1];
keys[0] = own_key_hash;
keys[1] = chonk_key_hash;
for k in 0..4 {
keys[2 + k] = stack_outputs[C6_CHONK_DATA_LEN + k];
}
let mut data = [0; C6_CHONK_DATA_LEN];
for i in 0..C6_CHONK_DATA_LEN {
data[i] = stack_outputs[i];
}
(keys, data)
}
98 changes: 0 additions & 98 deletions circuits/bin/recursive_aggregation/c6_fold/src/main.nr

This file was deleted.

Loading
Loading