feat(fnd): real-kernel Chonk flow with an in-app UltraHonk verifier - #25420
Open
iAmMichaelConnor wants to merge 1 commit into
Open
feat(fnd): real-kernel Chonk flow with an in-app UltraHonk verifier#25420iAmMichaelConnor wants to merge 1 commit into
iAmMichaelConnor wants to merge 1 commit into
Conversation
Adds noir-protocol-circuits/integration-tests, the home for tests that prove the real protocol circuits end to end with bb, with its first test, verify-uh-proof-within-smart-contract: an app circuit that recursively verifies an UltraHonk ZK proof through bb_proof_verification (no aztec-nr), folded by private_kernel_init, private_kernel_reset_tail and hiding_kernel_to_rollup. An unconstrained Noir builder derives every kernel input from the circuits' real VKs: the VK tree, the app's function tree and contract address, the public data tree non-membership proof and the no-op reset hints. A Python driver chains each circuit's return data into the next one's call data with noir-execute, assembles ivc-inputs.msgpack and runs bb prove/verify --scheme chonk. A second test command corrupts the inner proof and requires the flow to be rejected. The test's crates are members of the protocol-circuits workspace, since nargo always resolves the topmost Nargo.toml; build_integration_tests compiles them and moves the artifacts into the test's own target/ so they never reach the protocol artifacts, and integration_test_cmds emits the commands under the existing noir-protocol-circuits-tests target. The kernel library itself is untouched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dct8Fqzq1WFqckm9vCEbMS
iAmMichaelConnor
force-pushed
the
mc/chonk-flows-real-kernel-uh-verifier
branch
from
September 7, 2026 16:32
fa73b7c to
7b81ec8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
noir-projects/fnd/noir-protocol-circuits/integration-tests/verify-uh-proof-within-smart-contract: a Chonk (ClientIVC) flow over the real private kernels whose app verifies an UltraHonk proof, the way a smart contract does when it verifies a Noir proof in a private function. It is generated entirely from code in this repository (no captured fixtures, no aztec-nr, no PXE), so proving-system regressions in a real kernel stack are caught here without a round trip through the labs repository.The flow is
app_uh_verifier->private_kernel_init->private_kernel_reset_tail->hiding_kernel_to_rollup. The app is a private function as the kernels see one: it emitsPrivateCircuitPublicInputson the return data bus and, on the way, recursively verifies an UltraHonk ZK proof throughbb_proof_verification::verify_honk_proof. Until now this path had no proving coverage anywhere: bb's DSL test only checks the circuit and its VK, the stdlib test proves a standalone Mega circuit, acir_tests proves the verifier programs under UltraHonk, and none of the pinned Chonk flows contains an app that verifies a proof.This also introduces
noir-protocol-circuits/integration-tests/as the home for tests that prove the real protocol circuits end to end with bb, alongside the existingnargo testunit tests andnargo executefixture runs. See its README.How it works
flow-inputs-builderis an unconstrained Noir program that derives every kernel input from the circuits' real verification keys: the VK tree with the kernels at their protocol indices, the app's function tree and contract address, the public data tree non-membership proof for class updates, and the no-op reset hints. It reusesprotocol_test_utils::FixtureBuilderand is never proven. The kernel library itself is untouched; the reset hints are built fromstd::mem::zeroed()plus the documented inactive sentinels, set through the hint structs' public fields.prove_uh_verifier_app_with_real_kernels.py(stdlib Python) provesinner_circuitwith bb, runs the builder, chains each circuit's return data into the next one's call data withnoir-execute, assemblesivc-inputs.msgpack, and runsbb proveandbb verify --scheme chonk.--flow-diralso writes the stack in thechonk-pinned-flowslayout, which the existing C++ and bb.js pinned-flow tests accept as-is.Nargo.template.toml) because nargo always resolves the topmostNargo.toml.build_integration_testsin the protocol-circuitsbootstrap.shcompiles them and moves their artifacts into the test's owntarget/, so they never reach the protocol artifacts, benches, or pins. The build loop's member grep is tightened to top-levelcrates/so it ignores them.integration_test_cmdsemits two test commands under the existingnoir-protocol-circuits-teststarget, hashed over the circuits, bb, and the Noir verifier library: the flow must prove and verify, and with--corrupt-inner-proof(one element of the inner proof flipped; ACVM does not check proofs during witness generation) bb must reject it.Test plan
noir-projects/fnd/noir-protocol-circuits/bootstrap.sh build_integration_tests, thenintegration-tests/verify-uh-proof-within-smart-contract/prove_uh_verifier_app_with_real_kernels.py --skip-compile: bb accumulates the four real circuits and the Chonk proof verifies.--corrupt-inner-proof: bb fails while building the app circuit, reported as a pass.bootstrap.sh test_cmdslists both commands;nargo fmt --checkandnargo checkare clean; the protocoltarget/holds no test circuits after the build.Not covered yet, as sibling tests to add: multi-call transactions (
private_kernel_inner), intermediate resets, and the to-public tail.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dct8Fqzq1WFqckm9vCEbMS