Repository navigation
feat(oracle): account for cached searches and graph collisions - #1205
alexanderlhicks wants to merge 85 commits into
Conversation
…xmss-accounted-graph
…me-integration-RyirXhom/VCVOrdered into prototype/leanxmss-accounted-graph
…rototype/leanxmss-accounted-graph
…ired-derivation-caches
🤖 PR Summary
OverviewThis pull request formalizes a large collection of theorems and definitions related to random-oracle caching, graph collision bounds, and cost accounting for hash-based signature schemes. It extends the The PR body (provided) explains the motivation: bounding events against a query budget in hash-based signature proofs where the random oracle may be cached, and treating graph collisions. It mentions that this draft groups dependencies used by EthLib's leanXMSS prototype, that the adaptive-trial result is separately reviewed in #1203, and that the signing-view work in #1009 carries a 127‑bit theorem. The per‑file summaries, however, state that the PR body is empty; we note this discrepancy but rely on the actual PR body and the code changes. All proofs are complete: no Mathematical FormalizationQuery Counting and Oracle Moments
Cached Searches and Partnerships
Graph Collision Bounds and Cost Accounting
Simulation Semantics and Compositionality
Refactoring and API Expansion
Testing
CompletenessAll proofs are complete: no Discrepancy NoteThe per‑file summaries for Statistics
Lean Declarations ✏️ Added: 446 declaration(s)
…and 296 more not listed.
📋 **Additional Analysis**No findings. Last updated: 2026-11-21 04:03 UTC. |
Build Timing Report
CPU work is Rebuilt ModulesRebuilt 102 modules (83 without an earlier time). The 19 with an earlier time took 70s here against 60s when last built (+9s (+15.4%)). Estimated clean-build compile time, summed over all 1779 modules: 4366s before, 4556s after (+190s (+4.3%)). Per-module times are wall-clock under whatever parallel load the run had, so treat small differences as noise; a large change on one module is the signal. Showing 20 slowest of 102 rebuilt modules.
|
|
A note for when this is ready for review, so the connection isn't lost: the accounting for cached searches overlaps two PolyFun pieces tracked in Verified-zkEVM/PolyFun#387, the amortized transfer through caching handlers ( |
A hash-based signature proof often observes several events on one random oracle. A message search may stop early or revisit an address. A verifier may open a tree node whose children have yet to be sampled. Bounding each event against the entire query budget would spend the same calls several times.
The lemmas here keep the random-oracle cache and the charges from the same execution. They bound the first and second moments of adaptive trials, relate a verifier's children to a stored graph node, and preserve a stopped caller's state through optional replies. The cache-replay relation also preserves the final cache, so a caller can use it before another adaptive query.
The public query equation lets a downstream verifier identify which graph query it makes using an ordinary import.
For example, take a known input whose stored answer is
true. A program may replace a read of that input bytruebefore running any continuation. From an empty cache even a sampler that always returnstrueleaves a visible difference: only the queried program adds the entry. The test inVCVioTest/CacheReplay.leanchecks both cases.Stacked on #1202. The adaptive-trial result is also available for separate review in #1203. EthLib #3704 uses these results to prove the original 127-bit strong unforgeability statement for the keyed leanXMSS signer. All address formats, signer behavior and the final forgery theorem live downstream. The signing-view work in #1009 carries a 127-bit theorem from the deterministic SHAKE-128s byte game to its bit-vector transcription.
Its joint budget charges one unit per signing attempt.
EthLib’s leanXMSS budget counts the hash calls within signing and key generation.
The presampling theorem in #1009 preserves a later caller’s return value in distribution.
Here cache replay also preserves which answers that caller can read from the final cache.
A local integration of #1009 at
6a59713aand this branch atb30616barequired merging two import lists,VCVio.leanandVCVioTest.lean.Keeping the imports from both branches gave tree
e6a766c837317f2a7ef1d79f92a06ff29a4d247a.On that tree,
lake --rehash --wfail build VCVio HashSig VCVioTestpassed all 11,185 jobs.A downstream file imported both library roots and checked the SHAKE-128s byte and bit-vector theorems alongside the public graph-query equation.
At
b30616ba,lake build --wfail VCVio VCVioTestcompleted all 10,424 jobs on Lean 4.36.0. Codex prepared this draft with AI assistance.