triton-vm icon indicating copy to clipboard operation
triton-vm copied to clipboard

feat: triton-cli prove/verify, proof binary serialization

Open chancehudson opened this issue 7 months ago • 12 comments

This PR adds a new crate triton-cli. This crate exposes a cli with two commands

  • prove: read asm from file, prove it, and write the resulting proof to file
  • verify: read a proof from file, verify it, and print details about it

Proofs are serialized in a simple binary format. This format is described in the main.rs for the cli crate.

From inside the triton-cli directory run cargo install --path . to add the triton-cli to your path.

> triton-cli prove ./simple.asm out.proof --private-inputs=12412414,9 --public-inputs 214
proving...
success!
proof written to: out.proof
>
> triton-cli verify out.proof
proof is valid!
program digest: 0xbd500d8c2bc5b683fe957fa7e2525808b1eb113ad21a99044eec82abdff548e6f27d8b1429c6eaef
=================
security level: 160 bits
FRI expansion factor: 4
trace randomizers: 166
colinearity checks: 80
codeword checks: 160
=================
public inputs:
(none)
public outputs:
(none)
>

Things to watch out for:

  • proof data is written non-atomically, halting the process can create a corrupt proof file
  • inputs are not implemented
  • the binary format describes lengths as "number of 64-bit words" instead of number of bytes

Closes #238

chancehudson avatar Jul 11 '24 00:07 chancehudson