Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
chonk_transcript_invariants.test.cpp File Reference

Transcript isolation and counting invariants for Chonk IVC. More...

Go to the source code of this file.

Classes

class  ChonkTranscriptInvariantTests
 Test fixture for Chonk transcript invariant tests. More...
 

Functions

 TEST_F (ChonkTranscriptInvariantTests, AccumulationTranscriptCount)
 Pin the exact number of transcripts created during IVC accumulation.
 
 TEST_F (ChonkTranscriptInvariantTests, RecursiveVerificationTranscriptCount)
 Pin the exact number of transcripts created during recursive Chonk verification.
 

Detailed Description

Transcript isolation and counting invariants for Chonk IVC.

These tests verify critical transcript invariants that ensure security:

  1. Transcript Counting Invariants - Pins the exact number of transcripts created during IVC accumulation and recursive verification. This detects structural changes in transcript management that could affect:
    • Transcript isolation between components
    • Fiat-Shamir challenge derivation
    • Public input propagation between kernels
  2. Atomic Index Progression - Verifies that unique_transcript_index increments correctly through the IVC flow, ensuring:
    • Each transcript gets a unique identifier
    • Values from different transcripts cannot be mixed (OriginTag enforcement)
    • Parallel IVC instances have non-overlapping index ranges

Why these invariants matter:

  • Transcript isolation prevents cross-contamination of Fiat-Shamir challenges
  • Counting stability catches unintended structural changes in recursive verification
  • Index progression ensures OriginTag security guarantees hold

Definition in file chonk_transcript_invariants.test.cpp.

Function Documentation

◆ TEST_F() [1/2]

TEST_F ( ChonkTranscriptInvariantTests  ,
AccumulationTranscriptCount   
)

Pin the exact number of transcripts created during IVC accumulation.

This test ensures the transcript creation count during accumulation is a fixed constant. Any change to this count indicates a structural change in how transcripts are managed, which could have security implications (e.g., unexpected transcript isolation or sharing).

The 2-app IVC flow creates 7 circuits: app0 -> kernel0 -> app1 -> kernel1 -> reset -> tail -> hiding

Per-circuit transcript breakdown (from complete_kernel_circuit_logic):

  • App circuits (0, 2): 0 transcripts - use native HN folding prover
  • Non-hiding kernels (1, 3, 4, 5): 3 transcripts each:
    1. accumulation_recursive_transcript - shared across HN/Merge recursive verification
    2. PairingPoints::aggregate_multiple - for batching pairing points with Fiat-Shamir separator
    3. hash_transcript - for computing accumulator hash to propagate in public inputs
  • Hiding kernel (6): 2 transcripts (no hash_transcript since it doesn't propagate an accumulator):
    1. accumulation_recursive_transcript
    2. PairingPoints::aggregate_multiple

Total: 0 + 3 + 0 + 3 + 3 + 3 + 2 = 14 transcripts

Definition at line 75 of file chonk_transcript_invariants.test.cpp.

◆ TEST_F() [2/2]

TEST_F ( ChonkTranscriptInvariantTests  ,
RecursiveVerificationTranscriptCount   
)

Pin the exact number of transcripts created during recursive Chonk verification.

The recursive Chonk verifier creates transcripts that are tracked via unique_transcript_index (which is incremented for each in-circuit transcript creation). This test pins the exact count to detect any changes in transcript management that could affect security.

Expected breakdown (4 transcripts total):

  • 1 transcript: chonk_rec_verifier_transcript (shared across MegaVerifier and GoblinVerifier)
  • 3 additional transcripts: created by PairingPoints::aggregate() for Fiat-Shamir recursion separators (one for MegaVerifier result aggregation, two for Goblin sub-verifier result aggregations)

Definition at line 138 of file chonk_transcript_invariants.test.cpp.