Skip to content

feat!: VK hash consistency check#15591

Merged
lucasxia01 merged 9 commits into
merge-train/barretenbergfrom
lx/check-vk-hash-in-oink-rv
Jul 9, 2025
Merged

feat!: VK hash consistency check#15591
lucasxia01 merged 9 commits into
merge-train/barretenbergfrom
lx/check-vk-hash-in-oink-rv

Conversation

@lucasxia01

@lucasxia01 lucasxia01 commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

Checks that the vk hash being passed in matches the hash of the verification key that's generated from the transcript in the Oink recursive verifier. Also updates the VK hash to be 254 bits instead of 128 bits.

Closes AztecProtocol/barretenberg#1447.

@lucasxia01 lucasxia01 requested a review from LeilaWang as a code owner July 8, 2025 16:44
@lucasxia01 lucasxia01 force-pushed the lx/check-vk-hash-in-oink-rv branch from 00333e0 to ccef1ce Compare July 8, 2025 16:46
@lucasxia01 lucasxia01 self-assigned this Jul 8, 2025
@lucasxia01 lucasxia01 added the ci-full Run all master checks. label Jul 8, 2025
FF vkey_hash = decider_vk->vk_and_hash->vk->add_hash_to_transcript(domain_separator, *transcript);
vinfo("vk hash in Oink recursive verifier: ", vkey_hash);
vinfo("expected vk hash: ", decider_vk->vk_and_hash->hash);
decider_vk->vk_and_hash->hash.assert_equal(vkey_hash);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core change

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth a comment explanation?

@ledwards2225 ledwards2225 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - couple minor requests

Comment thread barretenberg/cpp/src/barretenberg/client_ivc/acir_bincode_mocks.hpp Outdated
FF vkey_hash = decider_vk->vk_and_hash->vk->add_hash_to_transcript(domain_separator, *transcript);
vinfo("vk hash in Oink recursive verifier: ", vkey_hash);
vinfo("expected vk hash: ", decider_vk->vk_and_hash->hash);
decider_vk->vk_and_hash->hash.assert_equal(vkey_hash);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe worth a comment explanation?

// Check the size of the recursive verifier
if constexpr (std::same_as<RecursiveFlavor, MegaZKRecursiveFlavor_<UltraCircuitBuilder>>) {
uint32_t NUM_GATES_EXPECTED = 870572;
uint32_t NUM_GATES_EXPECTED = 870546;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big moves. Is it clear what this is from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess splitting a 254 challenge into two adds some gates.

independent_hash_buffer.clear();
add_to_hash_buffer(label, new_challenge);
return new_challenges[0];
add_to_hash_buffer(label, buffer_hash);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LeilaWang LeilaWang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@lucasxia01 lucasxia01 merged commit 0999e1b into merge-train/barretenberg Jul 9, 2025
4 checks passed
@lucasxia01 lucasxia01 deleted the lx/check-vk-hash-in-oink-rv branch July 9, 2025 13:31
github-merge-queue Bot pushed a commit that referenced this pull request Jul 9, 2025
See
[merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md).

BEGIN_COMMIT_OVERRIDE
chore: stdlib bool internal audit  (#15070)
feat: improve Shplonk api (#15422)
fix(merge-train): don't queue merge if merge-train failed queue, pass on
rebase logic (#15508)
chore: nuke bit array (#15522)
chore: remove template parameters (#15530)
chore: no PK (#15386)
chore!: Correct public inputs propagation in the tube (#15547)
chore: use `batch_invert` in native IPA verifier (#15557)
chore: Move `stdlib::uint_plookup` to `stdlib::uint` (#15460)
chore: use const ref commitment keys (#15584)
fix: hiding circuit vk computed only once (#15589)
feat: transcript can hash objects independently (#15510)
chore: readme for benchmarking remotely (#15512)
chore: fix avm test (#15592)
chore: hash more stuff for IPA. (#15519)
chore: fix avm build in merge-train/bb (#15594)
feat!: structured public inputs via kernel io (#15383)
fix!: aggregate correct nested pairing points in the hiding circuit
(#15598)
fix: bb merge-train conflicts (#15617)
chore: Refactor shplonk verifier api (#15618)
chore!: databus consistency checks in the hiding circuit (#15599)
feat!: VK hash consistency check (#15591)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: sergei iakovenko <105737703+iakovenkos@users.noreply.github.com>
Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com>
Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com>
Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
Co-authored-by: ledwards2225 <98505400+ledwards2225@users.noreply.github.com>
Co-authored-by: Raju Krishnamoorthy <krishnamoorthy@gmail.com>
Co-authored-by: notnotraju <raju@aztec-labs.com>
Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com>
Co-authored-by: Jean M <132435771+jeanmon@users.noreply.github.com>
Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com>
Co-authored-by: Santiago Palladino <spalladino@users.noreply.github.com>
Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants