Guides
Proof Generation Guide

Proof Generation Guide

Minimum Requirements

Cycles Per SegmentRAM
3276813G
6553619G
26214427G

Clone and enter the ZKM Repo

git clone https://github.com/zkMIPS/zkm.git
cd zkm

Set the Default Variables

export RUST_LOG=info
export BASEDIR=$PWD
export SEG_SIZE=65536 # See cycles above for exact value based on your RAM
export ARGS='[PUBLIC] [PRIVATE]'
export SEG_OUTPUT=/tmp/output
export SEG_FILE_DIR=/tmp/output

Compile the Go Program into a MIPS Executable

GOOS=linux GOARCH=mips GOMIPS=softfloat go build -C /your/program/location

This produces an ELF binary

export ELF_PATH=/your/program/location
cd $BASEDIR

If you previously ran a program that generated segments, make sure to clear the segments with rm -rf /tmp/output

Split the ELF into Segments

cargo run --release --example zkmips split

Prove and Aggregate the Individual Segments

SEG_FILE_NUM=$(ls /tmp/output | wc -l) \
    cargo run --release --example zkmips prove_segments

ls /tmp/output | wc -l outputs how many segments are present in the output file directory.

After aggregating the proof, you should receive a result: ../verifier/data/test_circuit with the files:

  • common_circuit_data.json
  • proof_with_public_inputs.json
  • verifier_only_circuit_data.json
  • After this step you will Verify the Proof.