A zero-knowledge proof image editor that verifies image transformations and allows to prove image provenance.
The ZK Image Editor creates a ZK proof for image transformations using Succinct SP1, allowing anyone to verify the authenticity and history of edited images. The system:
- Binds transformations to images: Computes the hashes of both original and transformed images
- Provides trustless verification: Anyone can verify the proof without trusting any participant
- Creates immutable provenance chains: Each verified proof establishes a link between the original image hash and the transformed image hash
When a user edits an image, the browser loads a WASM module compiled from the Rust library, allowing transformations to be rendered in real-time. Once editing is complete, both the original image and the list of transformations are sent to the Prover API.
The API processes the request through an SP1 program that applies each transformation, creates hashes for both original and transformed images, and verifies signatures. The resulting proof can be submitted to an instance of the ImageVerifier contract for on-chain verification, creating an immutable record of the image's provenance.
For more details, see the blog post.
The project consists of five core components:
- Image Processing Library (
/img-editor/lib
): Rust library for image transformations, compiled to both WASM (browser) and RISC-V (SP1) - SP1 Program (
/img-editor/program
): Core SP1 program that generates proofs for image transformations - Prover API (
/img-editor/api
): Axum-based API that handles proof generation requests - Image Verifier Contract (
/contracts
): Smart contract for on-chain verification of image transformation proofs - User Interface (
/ui
): Next.js application with real-time image editing capabilities
- Rust (latest stable)
- Node.js (v20+)
- Access to SP1 Prover Network (https://docs.succinct.xyz/docs/sp1/generating-proofs/prover-network)
-
Clone the repository:
git clone https://github.com/saugardev/zkeditor.git cd zkeditor
-
Build and run the API:
cd img-editor/api cargo run --release
-
Run the UI:
cd ui pnpm install pnpm run dev
-
Open your browser and navigate to
http://localhost:3000
For detailed build and run instructions for each component, refer to their respective README files: