Skip to content

spec: Recursion - #943

Draft
erik-3milabs wants to merge 10 commits into
spec/mainfrom
spec/recursion
Draft

spec: Recursion#943
erik-3milabs wants to merge 10 commits into
spec/mainfrom
spec/recursion

Conversation

@erik-3milabs

Copy link
Copy Markdown
Collaborator

No description provided.

@erik-3milabs erik-3milabs self-assigned this Aug 21, 2026
@erik-3milabs erik-3milabs added the spec Updates and improvements to the spec document label Aug 21, 2026
@github-actions

Copy link
Copy Markdown

Kimi Code Review

⚠️ Review failed: Kimi API request failed with status 401


Automated review by Kimi (Moonshot AI)

@github-actions

Copy link
Copy Markdown

Codex Code Review

  • Medium — Recursive verification omits the required commitment (spec/recursion.typ:105). verify accepts a commitmentSpace, but the recursive branch treats commitment_1 as a function; lines 116–118 similarly pass verifier functions directly. Use an explicitly defined specialization operation producing comm(verify'(commitment_0, commitment_1, ·)). As written, the equations are ill-typed and do not establish the claimed recursive chain.

Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
*Record $record$.*
The record contains all challenges the prover derived using Fiat-Shamir.

*Tasks for $verify'_b\(commitment_0, commitment_1, b, proof, record)$:*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is missing a few of the ad-hoc checks, which are (I think) mostly related to memory and paging.
It would probably be a good idea to have an overview of those somewhere central as well.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not content with this section, at all. Indeed, stuff is missing.
I propose we have a full verifier description in verifier.typ (including all the ad-hoc checks you mention) and here only mention how to transform that monolithic verifier into the split/recursive verifier in this section.

wdyt of that split?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Works for me

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I rewrote this section. Let me know what you think!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the offloading to the original v_f and v_b should work to kick the can down the road and have a full description elsewhere 👍

erik-3milabs and others added 4 commits August 26, 2026 10:14
Co-authored-by: Robin Jadoul <robin.jadoul@gmail.com>
Co-authored-by: Erik <159244975+erik-3milabs@users.noreply.github.com>
Comment thread spec/recursion.typ
Comment on lines +215 to +225
When recursing on this process, the prover provides the verifier with this commitment.
We thus have to demonstrate the commitments the prover provides are as expected.
This is achieved by having the verification algorithm `COMMIT` (see @commit)
to the public input it is provided.
This act produces an imbalance in the LogUp-component of the proof-of-verification,
which must be balanced during verification in the _next_ recursion layer.
In later recursions, the verifier must consistently `COMMIT` to its public input
and use the _same_ public input to balance out the LogUp-component of the proof
it is provided.
This solution effectively kicks the can down the road; the final verifier has to
provide the initial input to the program as input to verify the recursive proof.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. We may not have access to COMMIT in a future flock-fieldvm hybrid
  2. Isn't this handled by $\mathbb{c}_1 = \bar{\mathbb{x}}$ already? Since the instance $\mathbb{x}$ includes the public input?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re 2.

Do you mean that having the guest COMMIT to $\mathbb{c}_1$ is excessive, since there must be a PAGE storing it, and all PAGEs are committed to by the VM?

In that case the verifier will have to add a constraint to that specific PAGE table, constraining that it contains the commitment on the required address 🤔 or were you thinking of a different solution?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are multiple PAGEs that need to be present to correctly represent the ELF being loaded into memory, so those would be part of $\bar{\mathbb{x}}$ already. And the ELF is the public input part, potentially with the PAGEs for the commitments made by the guest program.
So in the end, we'd need these specific tables to be used already as precomputed tables (which could/would be part of a verification key that can be derived from the ELF once and not computed on every verification).

Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
$

*Final verification.*
$verify'(commit(instance), (commit(verify'_b), commit(verify'_f)), 1, proof^((n))) =? one$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We may be able to get rid of the b argument by having the statement being proven the OR of both options:
I know a proof that is either accepted for the original statement OR for the recursion function.
I suppose this is essentially absorbing this bit into the proof or witness, but it cleans up the final verification and allows proofs without compressing to be used without any further change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I like the idea, but am not confident that it works well in practice. Specifically, for the ultimate verifier to confirm the proof, they would have to execute both v(x, proof) and v(v'(x, v', proof) to determine whether one of the two is true.

I think a better approach would be to absorb b into the proof. From a notation perspective, this still gets rid of the b, but now you have a bit which allows you to select the right verification configuration.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sure, turning it from a hint into an explicit value inside the proof should work fine

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe the theoretical part is actual nicer represented as an OR statement (not sure, but it avoids making assumptions on the structure of the proof), but we can have the bit inside the proof in practice, making it convenient in the implementation too.

@cdesaintguilhem cdesaintguilhem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mostly minor comments!

Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
verify': commitmentSpace^2 times {0, 1} times proofSpace: (commitment_0, commitment_1, b, proof) mapsto
cases(
verify(commitment_0, proof) &text("if") b=0,
verify(commitment_1((commitment_0, commitment_1); dot), proof) &text("if") b=1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can't parse what commitment_1((commitment_0, commitment_1); dot) is meant to be here.

Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
are henceforth referred to as _function instances_, or simply _instances_.
Where convenient, we may also denote this as $function(input; dot) in instanceSpace$
with instance space $instanceSpace$.
We then define $relation subset.eq instanceSpace$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This relation is actually a language.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I rewrote the paragraph, as discussed. Is it correct now?

Comment thread spec/recursion.typ
Comment thread spec/recursion.typ
Comment on lines +212 to +213
Since these commitments are deterministic, the verifier can locally reconstruct
the commitments and verify any opening proofs against its own version of the commitment.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As an optimisation: if the verifier has the DECODE and relevant PAGE tables in the clear, the prover does not even need to provide the corresponding openings as part of the proof string.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The downside would be that you get an increased storage cost in the verifying key, where storing those tables on-chain would be very costly, compared to just merkle roots.

@RobinJadoul RobinJadoul left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering whether we should choose for the $f$ function in the proof system to be the ELF proof, or if it should purely be the VM itself, and moving the ELF into public inputs.

Comment thread spec/recursion.typ

When recursing on this process, the prover provides the verifier with this commitment.
We thus have to demonstrate the commitments the prover provides are as expected.
This is achieved by having the verificationan algorithm `COMMIT` (see @commit)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
This is achieved by having the verificationan algorithm `COMMIT` (see @commit)
This is achieved by having the verification algorithm `COMMIT` (see @commit)

Comment thread spec/recursion.typ
+ execute $verify_b (comm(verify'(comm(instance), comm(verify'); dot)), proof)$

*$verify'_f\(comm(instance), (comm(verify'_b), comm(verify'_f)), b, proof, record)$:*
- verify proof: $verify_b (comm(verify'(comm(instance), comm(verify'); dot)), proof)$

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- verify proof: $verify_b (comm(verify'(comm(instance), comm(verify'); dot)), proof)$
- verify proof: $verify_f (comm(verify'(comm(instance), comm(verify'); dot)), proof)$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants