Valida zk-VM
Last updated
These instructions assume that you have installed the toolchain and produced or obtained a Valida executable, such as by using the compiler toolchain following the instructions above. They assume that you are in the Valida Docker image shell or the valida-shell.
To execute a program, where the path to the program executable file is $PROGRAM, and the path to write the output to is $OUTPUT:
valida run --fast $PROGRAM $OUTPUTThe input to the program will be read from stdin. The output of the program will also be written to stdout, in addition to $OUTPUT.
To execute a program, where the path to the program executable file is $PROGRAM, the path to write the output to is $OUTPUT, and the path to read the input from is $INPUT:
valida run --fast $PROGRAM $OUTPUT $INPUTThe output of the program will also be written to stdout, in addition to $OUTPUT.
To prove an execution of a program, where the path to the program executable file is $PROGRAM, and the path to write the proof file to is $PROOF:
The input to the program will be read from stdin. The output of the program will be written to stdout.
To prove an execution of a program, where the path to the program executable file is $PROGRAM, the path to the input file is $INPUT, and the path to write the proof file to is $PROOF:
The output will be written to stdout.
To verify a proof, where the path to the program executable file is $PROGRAM, the path to a file containing the claimed output is $OUTPUT, and the path to the proof file is $PROOF:
The result (success or an error message) will be written to stdout. The above command verifies the claim that there exists some input which, when provided to $PROGRAM, results in the program halting with output $OUTPUT. It verifies the claim by checking the provided proof, $PROOF.
See zk-VM: Advanced Usage for "power user" options for the zk-VM.
Last updated
valida prove $PROGRAM $PROOFvalida prove $PROGRAM $PROOF $INPUTvalida verify $PROGRAM $PROOF $OUTPUT