Skip to content

Conversation

@Leo-Besancon
Copy link

This PR aims to close #17.
It adds the access of aux final values in the MidenAirBuilder.

Currently, the tests in Plonky3 fails as the FibPermAir Air is not built on the same assumptions than the AirScript codegen.

Notes:

  • This work is based on the branch corresponding to PR feat: add fri params suitable for miden proving #19, so it also contains its commits.
  • We assume that whenever we work with buses, the Air contains constraints to make sure that the values given by the prover are the correct one. For instance, for each bus, we should have a constraint such as:
  builder.when_last_row().assert_zero_ext(AB::ExprEF::from(aux_current[0].clone().into()) - aux_bus_boundary_values[0].into());

This means that it should not be needed to commit to the values. If the prover lies on values it provides, the constraints should not be verified.

  • For now, we do not handle variable-length public inputs.

Copy link

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

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

Looks great!
As you said, it would be great to add support for variable-length public inputs.
A couple of things worth thinking about:

  1. Since we are focusing on the Miden use-case for now, should we make the addition of the boundary constraints, using the provided boundary values, automatic ?
  2. I believe we should include the values sent by the prover to the verifier into the Fiat-Shamir transcript.
  3. The equality check is not necessary for soundness, at least in the current setup, as long as we have the boundary constraints from point 1 above.

@Leo-Besancon Leo-Besancon marked this pull request as ready for review December 16, 2025 14:17
@Leo-Besancon
Copy link
Author

Leo-Besancon commented Dec 16, 2025

Hi @Al-Kindi-0, putting it in review as I now have:

Since we are focusing on the Miden use-case for now, should we make the addition of the boundary constraints, using the provided boundary values, automatic ?

This is already handled in the AirScript codegen: for each bus, two constraints are automatically included in the graph:

  • that the bus is empty in the first row
  • that the bus equals the corresponding aux_bus_boundary_values value in the last row

I'll check what can be done in the prover / verifier side.

@Leo-Besancon
Copy link
Author

Hello again @Al-Kindi-0

1. Since we are focusing on the Miden use-case for now, should we make the addition of the boundary constraints, using the provided boundary values, automatic ?

I have not yet put it on the branch of this PR, but could you look at this commit: 0a5752b

It basically wraps the air provided in the prove and verify functions into a MidenAir that delegates everything to the air, but adds the bus boundary constraintss automatically.

I've tested it in AirScript and it works well (in the test_air_plonky3_varlen_boundary_last.rs test, if I remove the codegen boundary constraints but provide inconsistant variable length public inputs, the verification fails as expected).

Some caveats is that we could have duplicated constraints (so we would need to remove the boundary handling from the codegen). What do you think?

Copy link

@adr1anh adr1anh left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

@Al-Kindi-0 Al-Kindi-0 left a comment

Choose a reason for hiding this comment

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

Looks great, thank you Leo!
Left a few questions and nits (but I think I found the answer by the end of the review for the most important one)

@Al-Kindi-0 Al-Kindi-0 merged commit 632fb26 into 0xMiden:main Dec 17, 2025
6 checks passed
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.

Expose the aux boundary values from the proof to the builder

3 participants