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 prove verify command #299

Closed
wants to merge 3 commits into from
Closed

Add prove verify command #299

wants to merge 3 commits into from

Conversation

cyberbono3
Copy link

@cyberbono3 cyberbono3 commented Jun 8, 2024

Resolves #238

cargo run --example cmd prove --dst ./triton-vm/examples/proof.txt
Proof generated in: 43s
Proof size: 1820KB
Stark, claim and proof written to ./triton-vm/examples/proof.txt
cargo run --example cmd verify ./triton-vm/examples/proof.txt     
stark length: 103
claim length: 148
Proof verified in: 175.564791ms

@cyberbono3 cyberbono3 marked this pull request as ready for review June 12, 2024 14:25
Copy link
Member

@jan-ferdinand jan-ferdinand left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I think this is a decent example showcasing how proofs can be stored on disk, read from disk, and subsequently verified. For a full resolution of #238, I think the main shortcomings are:

  • The program to be proven & verified is hardcoded. For a full-fledged CLI, the program (as well as input and non-determinism) should be given by the user at runtime.
  • Being an example, invocation of the CLI is a bit awkward. To me, it feels more natural to write triton-cli prove my_program.tasm than cargo run --example cmd prove my_program.tasm. If the PR added a crate (for example in the same workspace), that crate could be a standalone binary. This binary could then even be installed.

An additional note: As structopt is not actively developed anymore and superseded by clap, I think it is preferrable to use clap as the command line argument parser.

Should you have questions regarding some of these steps, feel free to ask. Also, please don't feel obligated by any of this; adding an example as a starting point for a full-fledged CLI is fine addition by itself.

Would you want to keep working on this?

@cyberbono3
Copy link
Author

Thanks for the PR!

I think this is a decent example showcasing how proofs can be stored on disk, read from disk, and subsequently verified. For a full resolution of #238, I think the main shortcomings are:

  • The program to be proven & verified is hardcoded. For a full-fledged CLI, the program (as well as input and non-determinism) should be given by the user at runtime.
  • Being an example, invocation of the CLI is a bit awkward. To me, it feels more natural to write triton-cli prove my_program.tasm than cargo run --example cmd prove my_program.tasm. If the PR added a crate (for example in the same workspace), that crate could be a standalone binary. This binary could then even be installed.

An additional note: As structopt is not actively developed anymore and superseded by clap, I think it is preferrable to use clap as the command line argument parser.

Should you have questions regarding some of these steps, feel free to ask. Also, please don't feel obligated by any of this; adding an example as a starting point for a full-fledged CLI is fine addition by itself.

Would you want to keep working on this?

yes!

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.

add command line tool for proof generation & verification
2 participants