Proof Generation Guide

Minimum Requirements

Cycles Per SegmentRAM

1024

16G

16384

28.2G

32768

95.2G

65536

96.3G

262144

130.1G

1. Compile the Go code to MIPS

Write your own go program, and compile with

export GOOS=linux
export GOARCH=mips
export GOMIPS=softfloat
go build [YOUR_PROGRAM_NAME].go

This produces an ELF binary.

export BASEDIR=/path/to/your/go/file/directory
export ELF_PATH=/path/to/your/go/binary
export SEG_SIZE=[SEE MINIMUM REQUIREMENT CYCLES FOR EXACT VALUE BASED ON YOUR RAM]

2. Split the ELF into Segments

This should take a few seconds

RUST_LOG=trace BLOCK_NO=13284491 SEG_OUTPUT=/tmp/output \
    cargo run --release --example zkmips split

3. Generate Proof for Each Segment

This should take about 10 minutes

RUST_LOG=trace BLOCK_NO=13284491 SEG_FILE="/tmp/output/0" \
    cargo run --release --example zkmips prove

4. Aggregate Proofs

This should take 20 minutes to a few hours, depending on the number of segments being aggregated

RUST_LOG=trace BLOCK_NO=13284491 SEG_FILE_DIR="/tmp/output" SEG_FILE_NUM=$(ls /tmp/output -1 | wc -l) \
    cargo run --release --example zkmips aggregate_proof_all

ls /tmp/output -1 | 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

Once you generate this folder, you need to Verify the Proof.

Last updated