Skip to content

feat(stm): enable plutus friendly hash#3417

Merged
damrobi merged 4 commits into
mainfrom
damrobi/msnark/3307-enable-plutus-friendly-hash
Jul 20, 2026
Merged

feat(stm): enable plutus friendly hash#3417
damrobi merged 4 commits into
mainfrom
damrobi/msnark/3307-enable-plutus-friendly-hash

Conversation

@damrobi

@damrobi damrobi commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Content

This PR includes a switch of the Blake2b transcript hash function used when generating IVC proofs. The current implementation a version of Blake2b-512 that is not Plutus friendly. The latest update of MidnightZK introduced a Blake2b256 which is Plutus friendly and can be used as a transcript hash. More details in this discussion.

Changes:

All blake2b_simd::State uses were replaced by Blake2b256 and the test assets were regenerated.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Comments

Issue(s)

Closes #3307

@damrobi damrobi self-assigned this Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

Test Results

     5 files  ± 0     209 suites  ±0   1h 36m 14s ⏱️ - 1h 38m 31s
 3 334 tests  - 51   3 334 ✅  - 51  0 💤 ±0  0 ❌ ±0 
11 066 runs   - 54  11 066 ✅  - 54  0 💤 ±0  0 ❌ ±0 

Results for commit 3585373. ± Comparison against base commit e5f3c86.

This pull request removes 51 tests.
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_out_of_bounds
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_too_large_for_circuit_range
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::indices_not_increasing
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_merkle_path_mismatch
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_swap_keep_merkle_path
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_wrong_verification_key
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_corrupt_sibling
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_flip_position
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_long
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_short
…

♻️ This comment has been updated with latest results.

@damrobi
damrobi temporarily deployed to testing-preview July 17, 2026 14:51 — with GitHub Actions Inactive
@damrobi
damrobi temporarily deployed to testing-2-preview July 17, 2026 14:51 — with GitHub Actions Inactive
@damrobi
damrobi force-pushed the damrobi/msnark/3307-enable-plutus-friendly-hash branch from 7c6b351 to f28e284 Compare July 17, 2026 15:00
@damrobi
damrobi temporarily deployed to testing-2-preview July 17, 2026 16:12 — with GitHub Actions Inactive
@damrobi
damrobi temporarily deployed to testing-preview July 17, 2026 16:12 — with GitHub Actions Inactive
@damrobi
damrobi marked this pull request as ready for review July 20, 2026 07:29
@jpraynaud
jpraynaud requested a review from Copilot July 20, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the IVC transcript hash used by the experimental SNARK (future_snark) path to a Plutus-friendly Blake2b variant by switching from blake2b_simd::State to midnight_proofs::transcript::Blake2b256, and regenerates associated test assets.

Changes:

  • Replace all blake2b_simd::State transcript usages with Blake2b256 across IVC proof generation and aggregate signature plumbing.
  • Update circuit test utilities to use Sha256 for shared-cache fingerprinting and remove blake2b_simd dependency entries from mithril-stm.
  • Adjust IVC test/generator code to use the new transcript hash type.

Reviewed changes

Copilot reviewed 6 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
mithril-stm/src/protocol/aggregate_signature/signature.rs Switch IVC aggregate-signature variant and helpers/tests to IvcProof<Blake2b256>.
mithril-stm/src/protocol/aggregate_signature/clerk.rs Update IVC proving pipeline return type to IvcProof<Blake2b256>.
mithril-stm/src/proof_system/ivc_halo2_snark/proof.rs Use Blake2b256 transcript for IVC proof generation and update tests accordingly.
mithril-stm/src/circuits/test_utils/file_mutex.rs Replace Blake2b-based cache fingerprinting with Sha256 + hex::encode.
mithril-stm/src/circuits/halo2_ivc/tests/common/generators/proofs.rs Update test proof generation/verification helpers to use Blake2b256.
mithril-stm/Cargo.toml Remove blake2b_simd optional/dev dependency wiring from future_snark.
Cargo.lock Drop blake2b_simd from the mithril-stm dependency list.
Comments suppressed due to low confidence (1)

mithril-stm/src/proof_system/ivc_halo2_snark/proof.rs:392

  • The local variable blake2b_bytes is now produced with the Blake2b256 transcript hash, so the name is misleading (it previously implied the older Blake2b variant). Renaming it to blake2b256_bytes (or similar) will make the transcript choice explicit and reduce confusion when reading/debugging proof generation.
        let blake2b_bytes = IvcProof::<Blake2b256>::prove_with_transcript(
            &self.ivc_setup.srs,
            &self.ivc_setup.ivc_proving_key,
            &circuit_data,
            &public_inputs,
            &mut self.rng,
        )?;
        let proof = IvcProof::new(
            IvcProofBytes::new(blake2b_bytes),
            prover_input.next_state,
            prover_input.next_accumulator,
        );

@jpraynaud jpraynaud left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@damrobi
damrobi force-pushed the damrobi/msnark/3307-enable-plutus-friendly-hash branch from f30863d to 3585373 Compare July 20, 2026 07:49
@damrobi
damrobi temporarily deployed to testing-2-preview July 20, 2026 08:54 — with GitHub Actions Inactive
@damrobi
damrobi temporarily deployed to testing-preview July 20, 2026 08:54 — with GitHub Actions Inactive
@damrobi
damrobi merged commit 8e46f80 into main Jul 20, 2026
91 of 94 checks passed
@damrobi
damrobi deleted the damrobi/msnark/3307-enable-plutus-friendly-hash branch July 20, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable plutus friendly hash for IVC proving

3 participants