Skip to content

starknet_transaction_prover,workspace: run the circuit verifier as a bootloader task - #15088

Closed
einat-starkware wants to merge 1 commit into
claude/privacy-proof-os-verify-gsxf2h-4-registry-pinfrom
claude/privacy-proof-os-verify-gsxf2h-5-verifier-task
Closed

einat-starkware wants to merge 1 commit into
claude/privacy-proof-os-verify-gsxf2h-4-registry-pinfrom
claude/privacy-proof-os-verify-gsxf2h-5-verifier-task

Conversation

@einat-starkware

@einat-starkware einat-starkware commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Part 4 of the single-proof verification stack. This PR closes milestone 1: a single transaction's proof is verified by the real Cairo1 circuit verifier running as a bootloader task, and the verifier's output digest is checked against the digest recomputed from the transaction's proof facts. No OS program changes.

  • run_circuit_verifier_task: runs the privacy circuit verifier executable as a single simple-bootloader task on the transaction's processed proof and parses the bootloader's output page ([1, 10, verifier_program_hash, digest words 0..7]).
  • verify_circuit_verifier_task_output: checks the verifier program hash against a pinned value, then compares the verifier's output digest with compute_verification_digest of the given processed-proof output digest.
  • Fixture: the proving side's processing of the golden leaf, generated with stwo_run_and_prove_recursive_tree at proving commit b75d21f9 under the canonical_small registry. The end-to-end test passes: bootloader-run verifier digest == digest recomputed from the transaction's proof facts. Invalid-proof, wrong-program-hash and wrong-digest paths are covered.

Reading the digest from the OS output (the packed low/high felts and unpack_output_digest) moved to #15064.

Stack (restructured):

🤖 Generated with Claude Code

https://claude.ai/code/session_01E43QxCycT6DpDJo435Ft8R

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces proof-verification logic tied to pinned verifier binaries and digest semantics; dependency split between cairo-program-runner-lib 1.3.1 and 2.4.0 increases integration risk, but changes are isolated to the transaction prover with strong test coverage.

Overview
Adds a new verifier_task module to starknet_transaction_prover that runs the Stwo circuit verifier executable as a single simple-bootloader Cairo task (via cairo-program-runner-lib) over a transaction’s processed proof, then validates the result.

run_circuit_verifier_task stages the verifier executable and processed proof on disk, builds a Cairo1 program task, runs the simple bootloader with all_cairo_stwo layout, and parses the bootloader output page into CircuitVerifierTaskOutput (pinned verifier program hash + Blake2s verification digest). verify_circuit_verifier_task_output checks the hash against an expected felt and compares the digest to compute_verification_digest from the proof’s output digest (from starknet_os::proof_fact_fold).

The crate gains a direct cairo-program-runner-lib dependency; Cargo.lock resolves 1.3.1 for this crate while proving-stack crates stay on 2.4.0, and several proving dependencies move to hashbrown 0.17.1. Tests use gzipped fixtures and cover happy path, wrong hash/digest, and corrupted proof failure.

Reviewed by Cursor Bugbot for commit 32effb4. Bugbot is set up for automated code reviews on this repo. Configure here.

@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 3dec722 to 984111c Compare September 2, 2026 11:43
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 5ccc8b0 to 45d2292 Compare September 2, 2026 11:43
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 45d2292 to ccdf52c Compare September 2, 2026 11:47
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch 2 times, most recently from 05ae64e to 2f011f1 Compare September 2, 2026 12:13
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from ccdf52c to 3ea9055 Compare September 2, 2026 12:13
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 2f011f1 to c5a699f Compare September 2, 2026 12:29
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch 2 times, most recently from 9c77ed6 to b628c29 Compare September 2, 2026 12:45
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch 2 times, most recently from 207de5d to 028fc14 Compare September 2, 2026 13:11
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch 2 times, most recently from 9aecebb to c9f1861 Compare September 2, 2026 13:41
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 028fc14 to 9898ff6 Compare September 2, 2026 13:41
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from c9f1861 to fcf4042 Compare September 17, 2026 13:36
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch 2 times, most recently from 800f216 to 4a1bd94 Compare September 22, 2026 09:22
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from fcf4042 to 377b5b4 Compare September 22, 2026 09:22
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 4a1bd94 to 495f2a8 Compare September 23, 2026 09:17
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 377b5b4 to 78719ea Compare September 23, 2026 09:17
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 495f2a8 to e436fb3 Compare September 23, 2026 12:59
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 78719ea to 715f6db Compare September 23, 2026 12:59
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from e436fb3 to 07a97d4 Compare September 23, 2026 14:56
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 715f6db to f99428f Compare September 23, 2026 14:56
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 07a97d4 to 71819dc Compare September 24, 2026 08:11
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from f99428f to 85939ce Compare September 24, 2026 08:11
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 71819dc to c74489d Compare September 24, 2026 08:15
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from 85939ce to 0d3dd94 Compare September 24, 2026 08:15
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from c74489d to 91050c6 Compare September 24, 2026 13:28
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch 2 times, most recently from 44b22ee to cdf7d20 Compare September 24, 2026 17:20
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 91050c6 to 8a68a55 Compare September 24, 2026 17:20
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from cdf7d20 to cd0a0ba Compare September 28, 2026 08:01
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 8a68a55 to 7403cf0 Compare September 28, 2026 08:01
@einat-starkware
einat-starkware removed this pull request from stack #15094 September 28, 2026 08:16
@einat-starkware
einat-starkware added this pull request to stack #15156 September 28, 2026 08:17
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 7403cf0 to f561d1d Compare September 28, 2026 10:51
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from cd0a0ba to d4a5279 Compare September 28, 2026 10:51
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from f561d1d to 53df634 Compare September 30, 2026 10:47
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from d4a5279 to 0108b56 Compare September 30, 2026 10:47
@einat-starkware einat-starkware changed the title starknet_transaction_prover,starknet_os,workspace: run the circuit verifier as a bootloader task starknet_transaction_prover,workspace: run the circuit verifier as a bootloader task Sep 30, 2026
@einat-starkware
einat-starkware removed this pull request from stack #15156 September 30, 2026 10:51
@einat-starkware
einat-starkware added this pull request to stack #15158 September 30, 2026 10:53
…bootloader task

Runs the privacy circuit verifier executable as a single simple
bootloader task on a transaction's processed proof, parses the
bootloader's output page, and checks the verifier's output digest
against the verification digest recomputed from the processed proof's
output digest. The fixture processed proof is the proving side's
processing of the golden leaf, generated with
stwo_run_and_prove_recursive_tree at proving commit b75d21f9 under the
canonical_small registry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E43QxCycT6DpDJo435Ft8R
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-4-registry-pin branch from 3c21ea2 to a281d7b Compare September 30, 2026 15:46
@einat-starkware
einat-starkware force-pushed the claude/privacy-proof-os-verify-gsxf2h-5-verifier-task branch from ec69402 to 32effb4 Compare September 30, 2026 15:46
@einat-starkware
einat-starkware removed this pull request from stack #15158 October 1, 2026 08:23

Copy link
Copy Markdown
Contributor Author

Closing: the stack now runs the circuit verifier in Cairo, from the aggregator (#15161, #15163, #15162), instead of as a Rust bootloader task. This PR's verifier and processed-proof fixtures moved to starknet_os in #15163.


Generated by Claude Code

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.

3 participants