Add stateless PoR verification (verify_stateless + aggregate_root)#49
Closed
wilfreddenton wants to merge 2 commits into
Closed
Add stateless PoR verification (verify_stateless + aggregate_root)#49wilfreddenton wants to merge 2 commits into
wilfreddenton wants to merge 2 commits into
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
…nd its placeholder fields
6dc5456 to
114bf3e
Compare
Contributor
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Medium Risk
Changes the shared prove/verify preprocessing and introduces an alternate verification path with weaker off-ledger file binding; correctness relies on SNARK + valid-root checks and new equivalence tests.
Overview
Adds stateless PoR verification for hosts that store the file registry on-chain instead of an in-memory
FileLedger. Public entry points areverify_stateless(valid aggregated roots only) andaggregate_root/aggregate_root_from_filesso a contract can recompute the current ledger root in canonicalfile_idorder.Verification is refactored around a
LedgerViewtrait (FileLedgervsStatelessLedger). Shared logic lives inverify_with; stateless mode skips per-filercregistry checks (callers enforce registration) but still checks multi-fileproof.ledger_rootagainst the valid-root set and runs the same SNARK path.Plan::make_plannow takesAggInputs: prove usesAggInputs::Ledger(indices + root from the live tree); verify usesAggInputs::Proof(SNARK-boundledger_root,aggregated_tree_depth,ledger_indices). Challenge-derived fields andbuild_z0_primaryare unified so prover and verifier stay aligned.Integration tests assert stateless verify matches ledger verify for single- and multi-file proofs and that missing roots reject multi-file proofs.
Reviewed by Cursor Bugbot for commit 114bf3e. Bugbot is set up for automated code reviews on this repo. Configure here.