Skip to content

feat(stm): Verify SNARK proof#3090

Merged
damrobi merged 16 commits intomainfrom
damrobi/msnark/3041-verify-snark-proof
Mar 24, 2026
Merged

feat(stm): Verify SNARK proof#3090
damrobi merged 16 commits intomainfrom
damrobi/msnark/3041-verify-snark-proof

Conversation

@damrobi
Copy link
Copy Markdown
Collaborator

@damrobi damrobi commented Mar 17, 2026

Content

This PR includes the addition of a proof.rs module in proof_system/halo2_snark/ that contains a SnarkProof structure and a verify function to verify the proof. The structure and function follow a similar style to the concatenation proof. For now, the verify function loads/generates the srs and generates the verification_key on the fly in the function itself.

I left some non-doc comments in the code that we can discuss and remove as you deem necessary. The names are also up for debate as I used Snark to prefix the structure and constants but we could go for Halo2Snark or something more precise,

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
  • Documentation
    • No new TODOs introduced

Comments

Issue(s)

Relates to #3041

@damrobi damrobi self-assigned this Mar 17, 2026
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 17, 2026

Test Results

    5 files  ±0    201 suites  ±0   1h 16m 5s ⏱️ + 7m 42s
2 810 tests +8  2 810 ✅ +8  0 💤 ±0  0 ❌ ±0 
9 908 runs  +8  9 908 ✅ +8  0 💤 ±0  0 ❌ ±0 

Results for commit 96e4430. ± Comparison against base commit d0e7a3d.

♻️ This comment has been updated with latest results.

@damrobi damrobi temporarily deployed to testing-preview March 17, 2026 08:50 — with GitHub Actions Inactive
@damrobi damrobi force-pushed the damrobi/msnark/3041-verify-snark-proof branch from 7e2633a to d326cca Compare March 17, 2026 11:35
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
@damrobi damrobi marked this pull request as ready for review March 17, 2026 12:12
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
@damrobi damrobi temporarily deployed to testing-preview March 17, 2026 12:40 — with GitHub Actions Inactive
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
@damrobi damrobi temporarily deployed to testing-preview March 17, 2026 14:56 — with GitHub Actions Inactive
@damrobi damrobi force-pushed the damrobi/msnark/3041-verify-snark-proof branch from bac0c2e to 20ac880 Compare March 17, 2026 14:57
@curiecrypt curiecrypt requested a review from Copilot March 17, 2026 15:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial SNARK proof verification support to the mithril-stm Halo2 SNARK proof system (feature-gated by future_snark), by introducing a SnarkProof type and a verify entry point similar in spirit to the existing concatenation proof flow.

Changes:

  • Introduces halo2_snark::proof module with SnarkProof + verification logic (including temporary SRS/VK derivation inside verify).
  • Adds SNARK_PROOF_LENGTH constant to halo2_snark module.
  • Adds new crate dependencies needed by the verifier path (blake2b_simd, rand_chacha).

Reviewed changes

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

File Description
mithril-stm/src/proof_system/halo2_snark/proof.rs New SNARK proof container, SRS loading/generation helper, and verify implementation (+ feature-gated tests).
mithril-stm/src/proof_system/halo2_snark/mod.rs Wires in the new proof submodule and defines the proof byte-length constant.
mithril-stm/Cargo.toml Adds dependencies required by the new verification implementation.

Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/mod.rs
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
@damrobi damrobi temporarily deployed to testing-preview March 17, 2026 15:14 — with GitHub Actions Inactive
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Copy link
Copy Markdown
Collaborator

@hjeljeli32 hjeljeli32 left a comment

Choose a reason for hiding this comment

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

Looks a very good step towards the SNARK path in STM, and the proof generation/verification tests are useful. I left a couple of non-blocking comments probably more relevant when we wire the E2E path and move to product-ready code.

Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
@damrobi damrobi force-pushed the damrobi/msnark/3041-verify-snark-proof branch from 20ac880 to 7f18b2c Compare March 19, 2026 11:45
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Fixed
@damrobi damrobi temporarily deployed to testing-preview March 19, 2026 12:57 — with GitHub Actions Inactive
@damrobi damrobi requested a review from jpraynaud March 19, 2026 13:59
@damrobi damrobi temporarily deployed to testing-preview March 19, 2026 13:59 — with GitHub Actions Inactive
@damrobi damrobi temporarily deployed to testing-preview March 19, 2026 16:12 — with GitHub Actions Inactive
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/mod.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
Comment thread mithril-stm/src/protocol/aggregate_signature/error.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
@damrobi damrobi temporarily deployed to testing-preview March 20, 2026 16:26 — with GitHub Actions Inactive
@damrobi damrobi temporarily deployed to testing-preview March 20, 2026 16:50 — with GitHub Actions Inactive
@damrobi damrobi temporarily deployed to testing-preview March 20, 2026 17:31 — with GitHub Actions Inactive
@damrobi damrobi temporarily deployed to testing-preview March 20, 2026 18:03 — with GitHub Actions Inactive
@damrobi damrobi requested review from curiecrypt and jpraynaud March 23, 2026 09:25
Copy link
Copy Markdown
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I just left few minor comments to be addressed before merging.

Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
@damrobi damrobi temporarily deployed to testing-preview March 23, 2026 14:54 — with GitHub Actions Inactive
Copy link
Copy Markdown
Collaborator

@curiecrypt curiecrypt left a comment

Choose a reason for hiding this comment

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

Nice work!
The test coverage is thorough: roundtrip, wrong message, wrong params, random bytes, serialization, and golden test cover the important cases well. The CircuitVerificationKey wrapper with custom serde is clean. The verify function signature is straightforward and consistent with the concatenation proof style.

I left a few comments on minor issues.

LGTM 🚀

Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
Comment thread mithril-stm/src/proof_system/halo2_snark/proof.rs Outdated
@damrobi damrobi force-pushed the damrobi/msnark/3041-verify-snark-proof branch from c522bba to 96e4430 Compare March 24, 2026 08:31
@damrobi damrobi temporarily deployed to testing-preview March 24, 2026 08:50 — with GitHub Actions Inactive
@damrobi damrobi merged commit 7127c11 into main Mar 24, 2026
57 checks passed
@damrobi damrobi deleted the damrobi/msnark/3041-verify-snark-proof branch March 24, 2026 10:08
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.

6 participants