34 static constexpr size_t comm_frs = FrCodec::calc_num_fields<Commitment>();
35 static constexpr size_t eval_frs = FrCodec::calc_num_fields<FF>();
59 const size_t idx = translator_proof.size() - tail_size;
62 translator_proof[idx] = translator_proof[idx] + translator_proof[idx];
72 static constexpr size_t evals_after_op = 3;
73 const size_t op_eval_idx = eccvm_proof.size() - evals_after_op;
76 eccvm_proof[op_eval_idx] +=
FF(1);
91 auto goblin_proof = goblin.
prove();
94 auto t_current = goblin.
op_queue->construct_current_ultra_ops_subtable_columns();
95 auto T_prev = goblin.
op_queue->construct_previous_ultra_ops_table_columns();
103 if (outer_builder !=
nullptr) {
105 recursive_merge_commitments.t_commitments[idx] =
106 RecursiveCommitment::from_witness(outer_builder, merge_commitments.
t_commitments[idx]);
107 recursive_merge_commitments.T_prev_commitments[idx] =
108 RecursiveCommitment::from_witness(outer_builder, merge_commitments.
T_prev_commitments[idx]);
111 recursive_merge_commitments.t_commitments[idx].unset_free_witness_tag();
112 recursive_merge_commitments.T_prev_commitments[idx].unset_free_witness_tag();
117 return { goblin_proof, merge_commitments, recursive_merge_commitments };
127 auto [proof, merge_commitments, _] = create_goblin_prover_output();
135 bool pairing_verified = result.translator_pairing_points.check();
142 EXPECT_TRUE(pairing_verified && ipa_verified);
153 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
160 auto output = verifier.reduce_to_pairing_check_and_ipa_opening();
163 output.translator_pairing_points.aggregate(output.merge_pairing_points);
166 inputs.pairing_inputs = output.translator_pairing_points;
167 inputs.ipa_claim = output.ipa_claim;
170 builder.ipa_proof = output.ipa_proof.get_value();
172 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
181 auto verification_key =
184 OuterProver prover(prover_instance, verification_key);
185 OuterVerifier verifier(vk_and_hash);
186 auto proof = prover.construct_proof();
187 bool verified = verifier.verify_proof(proof).result;
189 ASSERT_TRUE(verified);
197 auto get_blocks = [](
size_t inner_size)
201 auto [proof, merge_commitments, recursive_merge_commitments] =
202 create_goblin_prover_output(&
builder, inner_size);
209 auto output = verifier.reduce_to_pairing_check_and_ipa_opening();
212 output.translator_pairing_points.aggregate(output.merge_pairing_points);
215 inputs.pairing_inputs = output.translator_pairing_points;
216 inputs.ipa_claim = output.ipa_claim;
219 builder.ipa_proof = output.ipa_proof.get_value();
221 info(
"Recursive Verifier: num gates = ",
builder.num_gates());
225 auto outer_verification_key =
228 OuterProver prover(prover_instance, outer_verification_key);
229 OuterVerifier outer_verifier(vk_and_hash);
230 return {
builder.blocks, outer_verification_key };
233 auto [blocks_5, verification_key_5] = get_blocks(5);
234 auto [blocks_6, verification_key_6] = get_blocks(6);
236 compare_ultra_blocks_and_verification_keys<OuterFlavor>({ blocks_5, blocks_6 },
237 { verification_key_5, verification_key_6 });
249 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
252 for (
auto& val : proof.eccvm_proof) {
264 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
275 EXPECT_FALSE(native_result);
284 auto [proof, merge_commitments, _] = create_goblin_prover_output();
288 MergeCommitments tampered_merge_commitments = merge_commitments;
289 tamper_with_op_commitment(tampered_merge_commitments);
292 RecursiveMergeCommitments recursive_merge_commitments;
294 recursive_merge_commitments.t_commitments[idx] =
295 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
296 recursive_merge_commitments.T_prev_commitments[idx] =
297 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
298 recursive_merge_commitments.t_commitments[idx].fix_witness();
299 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
307 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
310 goblin_rec_verifier_output.translator_pairing_points.aggregate(goblin_rec_verifier_output.merge_pairing_points);
317 goblin_rec_verifier_output.translator_pairing_points.P0.get_value(),
318 goblin_rec_verifier_output.translator_pairing_points.P1.get_value());
319 bool pairing_result = native_pairing_points.
check();
320 EXPECT_FALSE(pairing_result);
324 auto tampered_proof = proof;
325 tamper_with_libra_eval(tampered_proof.translator_proof);
329 RecursiveMergeCommitments recursive_merge_commitments;
331 recursive_merge_commitments.t_commitments[idx] =
332 RecursiveCommitment::from_witness(&
builder, merge_commitments.t_commitments[idx]);
333 recursive_merge_commitments.T_prev_commitments[idx] =
334 RecursiveCommitment::from_witness(&
builder, merge_commitments.T_prev_commitments[idx]);
335 recursive_merge_commitments.t_commitments[idx].fix_witness();
336 recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
344 [[maybe_unused]]
auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
357 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
360 tamper_with_eccvm_op_eval(proof.eccvm_proof);
367 [[maybe_unused]]
auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
383 auto [proof, merge_commitments, recursive_merge_commitments] = create_goblin_prover_output(&
builder);
391 bool pairing_verified = native_result.translator_pairing_points.check();
395 EXPECT_TRUE(pairing_verified && ipa_verified);
398 MergeCommitments tampered_merge_commitments = merge_commitments;
399 tamper_with_op_commitment(tampered_merge_commitments);
403 RecursiveMergeCommitments tampered_recursive_merge_commitments;
405 tampered_recursive_merge_commitments.t_commitments[idx] =
406 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.t_commitments[idx]);
407 tampered_recursive_merge_commitments.T_prev_commitments[idx] =
408 RecursiveCommitment::from_witness(&
builder, tampered_merge_commitments.T_prev_commitments[idx]);
409 tampered_recursive_merge_commitments.t_commitments[idx].fix_witness();
410 tampered_recursive_merge_commitments.T_prev_commitments[idx].fix_witness();
418 auto goblin_rec_verifier_output = verifier.reduce_to_pairing_check_and_ipa_opening();
421 goblin_rec_verifier_output.translator_pairing_points.aggregate(goblin_rec_verifier_output.merge_pairing_points);
428 goblin_rec_verifier_output.translator_pairing_points.P0.get_value(),
429 goblin_rec_verifier_output.translator_pairing_points.P1.get_value());
430 bool pairing_result = native_pairing_points.
check();
431 EXPECT_FALSE(pairing_result);
#define BB_DISABLE_ASSERTS()
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
Commitment commit(PolynomialSpan< const Fr > polynomial) const
Uses the ProverSRS to create a commitment to p(X)
static constexpr size_t ECCVM_FIXED_SIZE
Simple verification key class for fixed-size circuits (ECCVM, Translator).
TranslatorFlavor::VerificationKey TranslatorVerificationKey
GoblinProof prove()
Constuct a full Goblin proof (ECCVM, Translator, merge)
std::shared_ptr< OpQueue > op_queue
ECCVMFlavor::VerificationKey ECCVMVerificationKey
static void construct_and_merge_mock_circuits(Goblin &goblin, const size_t num_circuits=3)
Unified Goblin verifier for both native and recursive verification.
ReductionResult reduce_to_pairing_check_and_ipa_opening()
Reduce Goblin proof to pairing check and IPA opening claim.
IPA (inner product argument) commitment scheme class.
static constexpr size_t NUM_WIRES
typename Curve::AffineElement Commitment
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
auto get_native_opening_claim() const
An object storing two EC points that represent the inputs to a pairing check.
bool check() const
Perform the pairing check.
A ProverInstance is normally constructed from a finalized circuit and it contains all the information...
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
UltraRollupFlavor extends UltraFlavor with IPA proof support.
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
static ProverOutput create_goblin_prover_output(Builder *outer_builder=nullptr, const size_t num_circuits=5)
Create a goblin proof and the VM verification keys needed by the goblin recursive verifier.
bb::GoblinRecursiveVerifier::MergeVerifier::InputCommitments RecursiveMergeCommitments
static constexpr size_t eval_frs
MergeVerifier::Commitment Commitment
bb::GoblinRecursiveVerifier::MergeVerifier::Commitment RecursiveCommitment
static void SetUpTestSuite()
static constexpr size_t comm_frs
static void tamper_with_op_commitment(MergeCommitments &merge_commitments)
static void tamper_with_eccvm_op_eval(HonkProof &eccvm_proof)
static void tamper_with_libra_eval(HonkProof &translator_proof)
The data that is propagated on the public inputs of a rollup circuit.
std::filesystem::path bb_crs_path()
void init_file_crs_factory(const std::filesystem::path &path)
std::shared_ptr< factories::CrsFactory< curve::Grumpkin > > get_grumpkin_crs_factory()
TEST_F(BoomerangGoblinRecursiveVerifierTests, graph_description_basic)
Construct and check a goblin recursive verification circuit.
std::vector< fr > HonkProof
BaseTranscript< stdlib::StdlibCodec< stdlib::field_t< UltraCircuitBuilder > >, stdlib::poseidon2< UltraCircuitBuilder > > UltraStdlibTranscript
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
PairingPoints translator_pairing_points
MergeCommitments merge_commitments
RecursiveMergeCommitments recursive_merge_commitments