zkSampler

zkSampler: Prove your audio edits are legit—ZK-verified samples, no secrets revealed.

Project Description

zkSampler is a zero-knowledge proof system for verifiable audio sampling. It allows artists, producers, and creators to prove that an edited audio clip originates from a specific original sample—and that only allowed transformations (such as pitch shift, time stretch, or reverse) were applied—without revealing anything else about the transformation process or original content.

This helps solve a core issue in music production and remix culture: trustless attribution. Today, there’s no way to prove you used a sample fairly unless you reveal the exact workflow or transformation chain—something artists often want to keep secret. zkSampler leverages ZK proofs to cryptographically verify sample lineage and transformation authenticity while preserving creative privacy.

The flow is simple: • Upload and (optionally) cryptographically sign the original audio file. • Apply a transformation (like reversing the sample) inside the browser. • Submit the transformed file, transformation manifest, and optional signature to the zkSampler API. • Generate a ZK proof using SP1 zkVM showing the transformation was correct. • Verify the proof on-chain using our Solidity verifier, and download a signed output package.

This opens the door to fair use, NFTs backed by verified transformations, on-chain sample registries, and more.

How it's Made

zkSampler is built as a full-stack, end-to-end verifiable computation system using the following technologies:

🔧 Core Technologies • SP1 zkVM (Succinct) – Used for zero-knowledge proof generation and execution. The transformation logic is written in Rust and compiled to run inside SP1’s zkVM, enabling custom provable functions (e.g., pitch shifting, reversing audio). • Rust + Cargo Prove – We used SP1’s cargo prove tool to scaffold a barebones ZK project, structured with program, script, and verifier modules. Audio transformation is implemented using fixed-point arithmetic and linear interpolation for time-stretching. • Next.js (React Frontend) – The web interface allows users to upload, edit, and preview audio. Uses WaveSurfer.js for waveform visualization and animations. • WASM-powered DSP – For browser-based audio editing, we compiled audio DSP logic to WebAssembly so users can preview their edits before proving them. • Axum (Rust API Backend) – A lightweight server that accepts multipart uploads, transformation JSON, and Ethereum signatures. It orchestrates proof generation and returns proof artifacts, hashes, and transformed audio. • Solidity Verifier Contract – A modified verifier contract (based on zkEditor’s SP1 integration) that validates the Groth16 proof on-chain. It accepts public inputs like audio hash, signer address, and transformation metadata. • Ethereum Signature Integration – Users can sign their audio using a wallet (via EIP-191), and the ZK circuit verifies this signature within the SP1 runtime.

🧩 Architecture • The project is split into two major folders: • zk-sampler/: Rust-based ZK logic and proof system • frontend/: React-based UI built with Next.js, using Tailwind, Framer Motion, and Aceternity UI components for styling and animation • The API layer bridges the two, handling: • File uploads • Transformation manifest parsing • Calling SP1 prove or execute modes • Returning a JSON package with proof, verification key, public values, and output audio

🔍 Notable / Hacky Bits • We used audio fingerprinting and waveform hashing with fixed precision to avoid floating-point issues in the zkVM. • DSP code had to be re-implemented with integer-only math for SP1 compatibility. • To sync frontend WASM transformations with backend ZK proof logic, we enforced a strict spec for the transformation manifest, shared across browser and backend. • Debugging ZK circuits for audio was challenging—waveforms are far less forgiving than pixels!

background image mobile

Join the mailing list

Get the latest news and updates