Cover generated by FreePik
VIMz is currently (Dec. 2023) the fastest and most efficient program to proof authenticity of transformed/editted images w.r.t. an original source. It is built on top of NOVA recursive zkSNARKs with the front-end of Nova-Scotia (using Circom language for defining internal circuits). The protocol supports image resolutions of up to 4K (3840 x 2160) and higher.
Ppaper: [2024] Dziembowski, Ebrahimi, Hassanizadeh, VIMz: Verifiable Image Manipulation using Folding-based zkSNARKs
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm install v16.20.0
Note
in rare cases (miss-configured Linux distros), if you got an error stating that version "v16.20.0" was not found; following command might help:
export NVM_NODEJS_ORG_MIRROR=http://nodejs.org/dist
npm install -g snarkjs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
sudo apt install gcc
sudo apt install build-essential nlohmann-json3-dev libgmp3-dev nasm
git clone https://github.com/iden3/circom.git
cd circom
cargo build --release
cargo install --path circom
Once you have installed dependencies, you can proceed with setting up and running VIMz. To obtain the latest version of VIMz, clone its GitHub repository using the following command:
git clone https://github.com/zero-savvy/vimz.git
Head to the nova
directory:
cd vimz/nova
build and install vimz
using cargo
:
cargo build
cargo install --path .
verify installation of vimz
:
vimz --help
go to the circuits directory:
cd vimz/circuits
build node modules:
npm install
build ZK circuits using the provided script in this directory:
./build-circuits.sh
vimz --function <FUNCTION>
--resolution <RESOLUTION> --input <FILE>
--circuit <R1CS FILE> --output <FILE>
--witnessgenerator <BINARY/WASM FILE>
We've built the tools necessary for benchmarking using the samples provided in the samples
directory. To do this,
simply Go to the main directory of vimz repo and run any number of transformations as you prefer using the provided script:
./benchmark.sh [list-of-transformations]
Example 1: benchmarking a single transformation:
./benchmark.sh contrast
or
./benchmark.sh blur
or
./benchmark.sh grayscale
Example 2: benchmarking parallel execution of multiple transformations:
./benchmark.sh contrast blur
or
./benchmark.sh resize blur shapness
Note
Since the proof generation process can be time consuming, it is recommended to initially benchmark with only one transformation at a time~(replicating the results presented in Table IV of the paper). Once these results are verified, you can proceed to run multiple transformations in parallel to replicate the results shown in Table V.
Sample output: The script generates a file (or multiple files, one per given transformation) with a .output
suffix in the same directory. These files contain the standard output of running the vimz
command directly, as shown in Figure below. The output includes various performance metrics. The total proof generation time can be calculated as the sum of two numbers: RecursiveSNARK creation
and CompressedSNARK::prove:
from the output.
- We thank @iden3 for building the awesome Circom language and provding the CircomLib.
- This work currently heavily relies on Nova-Scotia's compiler for transforming Circom circuits to the ones comptible with Nova.
- The very early version of the project (solely based on Circom without NOVA) was inspired by image transformation proofs from @TrishaDatta's Circom circuits repository,
which were related to the medium post By Trisha Datta and Dan Boneh.
This work is licensed under Attribution-NonCommercial 4.0 International