Skip to content

spec: Recursion - #943

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

spec: Recursion#943
erik-3milabs wants to merge 9 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
#let (prove, verify) = ($italic("p")$, $italic("v")$)

// Mathematical symbols
#let (zero, one) = ($bb(0)$, $bb(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.

Do we need these to be bb? It already feels like a lot of bb throughout the document

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.

It already feels like a lot of bb throughout the document

I know! Once I stumbled across bb on Typst, I fell in love with it 🙈 Let's collaborate on reducing its use to an acceptable level 😉

Do we need these to be bb?

Specifically bb? No. I did feel like it would be useful to distinguish these booleans false/true from normal 0/1, also because some programs use 1 as error state and 0 as success state; I didn't want there to be confusion on what 0/1 meant. I considered bot and top, but was not content with how they looked.

Do you agree that distinguishing them from false/true is valuable? Do you perhaps know of a different useful symbol here?

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 don't think it's strictly needed here to have the separation, as long as it's clearly defined what counts as a "successful" execution. But I'd say top/bot or serif("success")/serif("fail") or the like could probably work as well or better, if you don't want to just to with 0/1

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.

Refactored it to just 0/1.

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 on lines +51 to +53
&: prob[verify\(commit(instance), prove\(instance; witness)) = one | instance(witness) = one] = 1 \
forall instance in instanceSpace without relation, forall proof in proofSpace
&: prob[verify\(commit(instance), proof) = one] < epsilon

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.

what probability space is this over? For the prover I'm assuming internal randomness, but the verifier should presumably be deterministic

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 this may be a side-effect of formalizing things as NIZKs, since the common way to express this as an interactive proocol can rely on the random challenges from the verifier for both of these.
For a NIZK, the soundness becomes computationally secure, presumably, so it becomes dependent on the prover somewhere.

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.

wdyt of simply rephrasing this in terms of completeness (= proof for solvable instances is accepted) and completeness (= any proof for unsolvable instances is rejected), without the mathematical formulae?

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.

done

Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment thread spec/recursion.typ Outdated
Comment on lines +108 to +109
where it is assumed that $comm(function(x_1, x_2, dot))$ can be easily
constructed from $comm(function), comm(x_1)$, and $comm(x_2)$.

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.

Is this formulation the case in practice for us, and how does it interact with the absorption remark? That is, we let the verifier take an instance as argument, which has already absorbed its input, so that part of the formalization seems slightly wrong here. If we keep instance as (f, i) without the reinterpretation as f(i; .) it might work, but then the way we commit should also change a bit to have a commitment to f and potentially plain i (maybe a commitment to i works, but I'm not 100% certain).

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.

My view on this is as follows:

  • f is the program with any constants baked in. The commitment of f is the merkle commitment of the DECODE table.
  • i are the program settings. The commitment of i is the merkle commit of the PAGE tables containing public memory.

So, I would say that instance-comm( f(i; ·) ) ≡ (function-comm(f), input-comm(i))

Is this formulation [of commit composition] the case in practice for us?

I believe so, yes

and how does it interact with the absorption remark?

Could you elaborate what you mean by this?

(I haven't refactored the text to work with split instances just yet; would like to reach understanding on the topic before performing the refactor)

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.

So, I would say that instance-comm( f(i; ·) ) ≡ (function-comm(f), input-comm(i))

My surface reading without this clarification would be to read f(i; ·) as the function with now also i "baked in".
Maybe this needs some in-text clarification.

It can also help a bit to make the definition of bb(X) have a instead of plain = when reinterpreting it as purely functions taking a witness.

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.

Could you elaborate what you mean by this?

I mean kinda that I read f(i; ·) as absorbing i into f (as clarified in my previous comment). So you'd end up with some weirdness on how exactly the commitments work there, similar-ish to the circularity of the absorption remark.

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.

Let me know if the rephrasing works

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!

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>
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.

2 participants