Skip to content

Formalize Ironwood zero knowledge in Lean - #1

Draft
TalDerei wants to merge 198 commits into
mainfrom
establish-zk
Draft

Formalize Ironwood zero knowledge in Lean#1
TalDerei wants to merge 198 commits into
mainfrom
establish-zk

Conversation

@TalDerei

@TalDerei TalDerei commented Sep 10, 2026

Copy link
Copy Markdown

Formalizes both statistical honest-verifier zero knowledge (HVZK) for the interactive protocol and statistical zero knowledge (ZK) for its Fiat–Shamir transform in the classical programmable random-oracle model for the fixed Ironwood protocol, using the pinned prover description and the existing Lean definitions at base ad4a6ad8f75a64368bae4186006480410a687cce. The development lives in Zcash/Snark/ZeroKnowledge and is included in the default build and trust census.

The failure model follows Zakura 1.4.0: identity points return errors and a zero IPA round challenge panics, with no automatic retry. This differs from the pinned description's fresh-randomness retry behavior.

The joint PLONK/IPA simulator covers the sparse power-of-two IPA mask (Common #225) and the linear evaluation mask (Common #267), including their correlations with the commitments and other prover messages. The sampling model reduces independent uniform 512-bit integers modulo the scalar-field order. It proves the exact reduction bias instead of assuming uniform field blinds or rejection sampling.

m is the number of Actions. 148m + 46 counts the prover's private random field elements for one proof attempt, used to mask witness data and blind commitments.

For one interactive reference prover attempt with m Actions and eleven IPA rounds, the compiler-derived theorem gives a simple guarantee: any test of the verifier's view has probabilities differing by at most epsilon(m) between the real prover and the witness-free simulator, under the explicit assumptions below.

$$ \varepsilon(m) = \frac{42882m + 4113}{p} + (148m + 70)\delta < m \cdot 2^{-238}, \qquad m \ge 1. $$

$$ \delta = \frac{r(p-r)}{p \cdot 2^{512}} \le 2^{-260}, \qquad 2^{512} = Qp + r. $$

Here p is the scalar-field order and r is the remainder when dividing 2^512 by p.

  • Rare exceptional cases: (42882m + 4113)/p bounds the contribution from events such as zero denominators and exceptional verifier challenges.
  • Bias of one sample: delta is the exact statistical distance between one uniform 512-bit integer reduced modulo p and a uniform field element.
  • Accumulated sampling bias: (148m + 70) delta adds the sampling-bias costs across the proof's distribution comparisons.

Thus delta measures one sample's bias; epsilon(m) bounds the total simulation error. The bound grows linearly with the number of Actions. For one Action, the simulation error is below $2^{-238}$, with most of that allowance coming from the exceptional-case term. This establishes statistical closeness for the reference experiment.

The development connects the statistical comparison to the Action circuit and constructs the required circuit rows from application witnesses. It discharges the masking, compiler, commitment-routing, and encoding conditions for the specified reference prover. The simulator uses public data and has no witness argument.

Completeness:

The new application-witness bridge uses Ironwood’s existing Action circuit completeness theorem to establish valid circuit rows from witnesses satisfying the stated construction conditions. Our ZK capstones then apply to those rows: interactive statistical HVZK and Fiat–Shamir statistical ZK, the latter in the classical programmable random-oracle model.

The theorem wideActionWitness_completeness_error_bound shows that a valid witness produces an accepted proof except with an explicitly bounded failure probability. The event counts both aborted attempts and completed proofs rejected by the existing typed verifier.

For m >= 1 Actions, under the stated witness, setup, and independent uniform-bit-tape assumptions, the completeness bound is:

$$ \eta(m) = \frac{42904m + 8271}{p} + (296m + 160)\delta < m \cdot 2^{-238}, \qquad m \ge 1. $$

Here p and delta are as above, with $\delta \le 2^{-260}$. Acceptance is at least $1 - \eta(m)$; for one Action, the abort-or-rejection bound is below $2^{-238}$. This is completeness with high probability: perfect completeness would require acceptance probability exactly one, while permitted exceptional challenges can cause failure.

The conservative budget adds the honest emission-failure bound, the real-to-simulator error, and the simulator’s exceptional-challenge bound. The acceptance proof and numerical certificates are included in this branch; full-build validation is still in progress. This addition concerns the interactive reference prover at the repository’s existing typed, post-decode verifier boundary.

Assumptions and scope:

The statistical results assume witnesses satisfying the application construction conditions, the stated setup, and fresh independent uniform input bits. The interactive experiment uses an independent verifier tape; the Fiat–Shamir ZK theorem uses a classical programmable random oracle and its own error bounds. Results for seeded generators rely on the stated PRNG security assumptions and include their distinguishing advantage. See the proof map and theorem boundaries for the exact endpoints and premises.

The application-witness builder stores each of the five Fq scalars as two 128-bit Fp limbs and reconstructs its natural representative before computing scalar windows. Exact decoding covers the full Fq range, including representatives at or above |Fp|, without an additional scalar-hint bound.

The release provenance records the identity-product shortcut's exceptional divergence from the reference scan and its 2042m/p + delta comparison allowance. The displayed bounds are the Lean reference-model bounds.

TalDerei and others added 30 commits September 9, 2026 22:19
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
TalDerei and others added 5 commits September 9, 2026 22:19
Preserve every observed result, intermediate cache, final state, and exhaustion flag. Include actual prover execution, growing caches, bit decoding, and tape pairing in the runtime bound, with exact source and probability-law equalities for every candidate private prefix.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Record the exact source tree, full declaration inventory, focused builds, and repository guards.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Prove bounded program-class membership for the complete interactive prover and
recorded retries, including the stream-view and exhaustion reductions. Preserve
the original source laws and count retained auxiliary data, all test reads, and
the complete real prover and cached retry execution.

Keep PRNG security as an explicit assumption and document the stored-input cost
model. Independent review remains open, so retain the checklist.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Record the full workspace build, exact proof tree, direct declaration inventory,
and repository guards for 4a87136b. Update the review baseline and retain the
checklist until independent review is complete.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Record three separate AI-agent reviews of the interactive/application,
oracle/retry, and operational-resource claims at 469ad6bb. Preserve exact
diagnostics, dependency inventories, sampling arithmetic, and review scope.

Remove the completed checklist and repair its incoming links. The reviewers
reported no blocking findings and requested no proof-source changes; the
existing 4,858-job build baseline remains unchanged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@TalDerei TalDerei closed this Sep 10, 2026
@TalDerei TalDerei reopened this Sep 10, 2026
@TalDerei TalDerei changed the title Add conditional statistical HVZK proofs for Ironwood Formalize Ironwood zero knowledge in Lean Sep 10, 2026
TalDerei and others added 7 commits September 10, 2026 00:28
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Connect the public simulator's IPA equation to the rejecting typed
verifier, transfer its rejection bound to the reference prover, and
include failures to complete proof emission.

Add Action witness corollaries using the existing circuit completeness
bridge and the conservative one-attempt error budget:
(42904m + 8271)/p + (296m + 160) delta < m * 2^-238, for m >= 1.

Register the new endpoints in the trust census and document the result.
Lean elaboration and the final build are pending. Static source checks,
endpoint coverage, and exact rational bound arithmetic passed.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Document theorem purposes and proof-side computability boundaries, pin
dependencies, retire the superseded Action route, and update trust censuses.

Compose bounded source, map-scan, and coverage certificates with explicit
empty-remainder obligations while preserving the public proof statements.

Validation: static census, target coverage, import, documentation, spelling,
and whitespace checks passed. Full Lean build deferred at user request.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Keep navigation in the short README and point directly to the Lean
theorem and bound definitions. Update the program guide and retained
review record so no live Markdown links target the removed document.

Documentation links and whitespace checks passed.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Replace the expanded source, scan, and coverage modules with compact
whole-program checks. Keep the same certificate statements and direct
trust assertions, with explicit elaboration resource overrides.

Fix the cost-bound and opening-collision proof scripts, and clarify that
multicore instance rejection can follow advice blinding draws.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
TalDerei and others added 14 commits September 10, 2026 13:35
Avoid expanding the full oracle runner during the wrapper equality proof,
and remove unused section instances and simp arguments.
Remove the requested optimization notes and repair their references.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Encode all five Fq scalar hints in two 128-bit Fp limbs and reconstruct
their natural representatives before computing windows. Remove the
scalar-hint bound from witness construction and its downstream theorems.

Document the released identity-product shortcut and failure semantics,
include its zero-factor regression, and tighten endpoint census coverage
and source-certificate rejection checks.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Pin the Common prover-fingerprint producer and successful one- and
two-Action captures, retaining the existing verifier anchors. Reconstruct
transcript messages from captured inputs and raw randomness with a proved
equality to the Lean reference prover. Add authenticated regeneration,
malformed-capture checks, and explicit CI replay.

The focused replay and trust-census build and capture checks pass. The full
Lean build and numerical transcript comparisons are still in progress.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Prove fresh-cache programming for an arbitrary accepted typed proof before
instantiating the Action prover. Unfold only the observation wrappers when
matching the encoded result, keeping elaboration within default heartbeats.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Pin Common 0b9371b and copy its one- and two-Action Lean exports unchanged.
Reuse the verifier regeneration pipeline through regenerate-prover-fixtures.sh
and the shared MANIFEST.tsv; remove the separate Python decoder and binary
artifacts. Completed-run reuse checks the recorded output hashes before writes.

Compare the encoded Lean proof against the original Rust proof buffer and
reject empty, modified, truncated, or extended buffers. Save completed Lean
compilation before the separate long-running prover replay.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
CPolynomial.X uses Classical.choice in its erased canonicity proof.
Declare that existing dependency in the collision fixture census while
retaining the checks that it is a safe, computable definition.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Pin Common 4a0c2822259b0018defd43aaa72e720922ca4c60 and its source archive
after adding the missing Claude co-author trailer to PR #415.

Regenerated both prover captures and all six verifier artifacts with the
authenticated pipeline. All eight artifacts remain byte-identical; update
the prover manifest and source links to the rewritten producer revision.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Pin the Common producer to c9282976edc7b925f446825343d03fb4f614ab14
and regenerate both prover captures from its authenticated source archive.
The exported namespaces now quote each identifier component. All recorded
values and both original proof buffers remain unchanged.

Update the producer delta hashes, provenance links, and fixture manifest.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Pin Common ea8db623b6700f0719a1f078fc4be9df6e3da87a and authenticate
its updated exporter source. Regenerate both prover captures; all
fixture bytes remain unchanged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Use direct index cases in firstTapeEquiv instead of Fin.cons, whose
Fin.induction implementation reevaluates earlier entries in nested
readers. Prove the existing columnCoinEquiv_cons_apply statement for
the new definition without changing the tape permutation.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Use array-backed vectors for the fixed and advice query orders.
Nested Fin.cons readers reevaluate earlier entries during row queries;
the indexed tables preserve every query and rotation while avoiding
that repeated work. The replay modules and their trust census build,
and kernel-checked finite cases match both original tables.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Use iterative synthetic division and indexed coefficient blocks for complete
constraint numerators. Prove equality with the existing dense algorithms,
including coefficient padding, root order, and nonzero remainders.

Pin the new equivalences and add wide-polynomial regressions that exercise
the interpreter's default stack. The full replay exposed both recursive
division and recursive block reads exceeding that stack.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Allow selecting the complete single- or multi-Action replay while retaining
both cases as the runner's default. Run the independent captures concurrently
in CI, wait for both processes, and fail the step if either exits unsuccessfully.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant