zkmopro / mopro

Making client-side proving on mobile simple.
https://zkmopro.org
Apache License 2.0
121 stars 33 forks source link

Add support for triton-vm STARK proofs #215

Open chancehudson opened 3 months ago

chancehudson commented 3 months ago

Problem

We should add support for generating STARK proofs in the triton-vm using their assembly language.

Details

The triton vm parses some assembly, executes it in a VM, and generates a proof of execution showing

Each program can accept public inputs and secret inputs. Proofs are generally < 1 MB, growing logarithmically with program length.

Proofs require no pre-shared constants. e.g. no zkey, srs, vkey, pkey, etc.

Acceptance criteria

Add a test generating a proof from an assembly program. The test should accept some public and private inputs and generate some outputs.

chancehudson commented 3 months ago

Here is a program that takes no inputs and generates no outputs.

push 0
push 10
push 100
push 1000
dup 3
dup 5
dup 4
push 2
push 4
mul
invert
mul
add
push -1
mul
add
dup 5
dup 3
dup 5
dup 5
dup 6
dup 7
dup 8
mul
mul
mul
invert
mul
add
mul
swap 3
pop 1
halt