Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to prove a program as well #19

Closed
Tracked by #35
Dominik1999 opened this issue Nov 25, 2022 · 2 comments · Fixed by #50
Closed
Tracked by #35

Add ability to prove a program as well #19

Dominik1999 opened this issue Nov 25, 2022 · 2 comments · Fixed by #50

Comments

@Dominik1999
Copy link
Contributor

Dominik1999 commented Nov 25, 2022

At the moment, we only execute the Miden assembly program. We should add the ability to prove and also to verify a program.

Proving a Miden program in lib.rs

We can add the feature as another function, pub fn prove_program and also have the program, the inputs and the output_count as function inputs.

The problem so far is, that we can't return a tuple or a complex struct from Rust to the frontend using wasm-bindgen, see https://stackoverflow.com/questions/75064800/how-to-return-a-tuple-to-frontend-from-wasm

There are solutions, but I was not able to implement them in #50

Another problem is that there is no info about the trace or the time exposed in Miden v0.3. So we don't know how many cycles or how long it took, see #29. The problem with the duration of the proving step could be solved by adding a timestamp to the frontend.

Proving a Miden program in the App.tsx

We add another function like for run_program. The return values so far are the stack_output and the overflow_addresses.
However, we do not get the proof or any other info yet to print, see above.

In an ideal world, we would get some info while the proving step is executed, like the info that is logged when you prove via the CLI.

Open questions to clarify in the working group

Maybe the ability to prove is enough for this iteration, but if not we need to answer

  • What do we want to output while proving?
  • What do we want to output during proving?
  • How do we want to show the proof?

Any opinions / ideas on the above @grjte or @Overcastan ?

@Dominik1999 Dominik1999 changed the title Add ability to prove a program as well [WIP] Add ability to prove a program as well Jan 26, 2023
@grjte
Copy link
Contributor

grjte commented Jan 26, 2023

For now, I would aim to show the same output as we show in the CLI when proving

@Dominik1999
Copy link
Contributor Author

That would be nice, indeed. Unfortunately, those metrics are not exposed when you import Miden.

We would need access to that logger here:

https://github.com/0xPolygonMiden/miden-vm/blob/9c8af67a7768b920772b3a42d89947f7f639e089/miden/src/cli/prove.rs#L46-L50

But importing Miden VM v0.3. and using miden::prove:: does not expose this logger. Do you know a way how to access the logger? I mean it does not even log, when we don't use the Miden CLI I assume.

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 a pull request may close this issue.

2 participants