
LensMint Camera
Tamper-proof Web3 camera with ZK authenticity and instant NFT memories for everyone.
Demo
About
LensMint is a full hardware-to-blockchain camera system designed to guarantee the authenticity and ownership of real-world photos. Built on a Raspberry Pi camera with hardware-derived cryptographic identity, every photo is signed at capture, hashed, and proven genuine using zero-knowledge proofs generated through vlayer and verified on-chain via RISC Zero. The system uploads all media to Filecoin for permanent decentralized storage and mints an ERC-1155 NFT representing the authenticated memory. A built-in QR system lets people in the photo instantly claim their NFT, enabling proof of attendance, verified memories, and automatic revenue sharing. LensMint provides a trustless way to prove a photo’s device origin, timestamp, and integrity—solving authenticity, provenance, and monetization issues for creators, journalists, events, and scientific documentation. 📌 Problem Modern photography has lost trust. AI-generated images, deepfakes, and easy metadata manipulation make it nearly impossible to verify whether a photo is real, who captured it, or whether it has been tampered with. Journalists, wildlife photographers, event organizers, and creators need a reliable way to prove authenticity. Creators also lack transparent monetization; there’s no standard for proving ownership, tracking usage, or distributing royalties. 💡 Solution LensMint is a hardware-based Web3 camera system that creates tamper-proof, cryptographically verified photos at the moment of capture. Each photo is automatically signed, hashed, verified with zero-knowledge proofs, stored permanently, and converted into a claimable NFT. People in the photo simply scan a QR code to claim their authenticated memory, enabling verified attendance and frictionless creator monetization. 🛠️ How It Works (Technical Breakdown) Each camera generates a hardware-derived cryptographic identity tied to the device. When a photo is taken, the image is signed using the device key and its SHA-256 hash is generated. This data is passed to vlayer to generate a zero-knowledge proof proving the device, timestamp, and integrity—without exposing raw metadata. A RISC Zero verifier contract validates the ZK proof entirely on-chain. Image + metadata are stored permanently on Filecoin with immutable CIDs. The camera displays a QR code linked to a claim server; users scan and enter their wallet to receive the minted NFT. Smart contracts ensure provenance, authenticity, and optional revenue-sharing between tagged participants. 🎯 What LensMint Enables Trustless, verifiable photography (proof that a real device captured a real moment) Proof of attendance for events, meetups, conferences On-chain memory preservation with permanent Filecoin storage Verified journalism and scientific documentation Creator monetization via royalties and transparent provenance ZK-powered privacy, proving authenticity without leaking sensitive info like exact GPS or EXIF
How it's made
## **🔧 Hardware Layer** LensMint runs on a **Raspberry Pi 4** with a **Pi Camera Module v3** and a **3.5" touchscreen**. We built a **custom hardware identity system** where the device generates a private key derived from hardware entropy (serial, CPU ID, randomness mix). This creates a **unique, non-exportable camera identity** used to sign every photo. The camera interface uses **Picamera2**, with real-time preview, 1080p capture, rotation correction, and custom Kivy UI for a touch-friendly camera app. We also wrote low-level image handling utilities to: * Capture RAW JPEG buffers * Compute SHA-256 on-device * Sign image metadata with hardware key * Queue offline uploads when network is down This makes the camera act like a **standalone cryptographic signer** for all photos. --- ## **🖥️ Software (On-Device Application)** The frontend is a **Python/Kivy** app providing: * Live preview * Capture & video mode * Gallery * QR claiming interface * Status feedback It communicates with the backend via a lightweight **local REST API**. A small Python module handles: * Hardware key generation * Signing operations * Image hashing * EXIF sanitization * Automatic device registration via Web3 This turns the camera into a **self-contained cryptographic photo oracle**. --- ## **🌐 Hardware Web3 Service (Backend)** The backend is a **Node.js/Express** service running on the same Pi (or edge server). It handles everything the camera shouldn’t: heavy Web3 calls, uploads, and ZK integration. Tech stack: * **Node.js (Express)** – local REST API * **Ethers.js** – blockchain interaction * **SQLite** – claims database * **Multer** – file handler * **Synapse Filecoin SDK** – uploads to Filecoin/IPFS This service receives signed images, verifies signatures, uploads media, and triggers mints. --- ## **🧠 Zero-Knowledge Proof Pipeline (vlayer + RISC Zero)** This is the core innovation. **1. Generating ZK Proofs (vlayer API)** We use vlayer to produce **zero-knowledge proofs from external metadata and device signatures**. It proves: * The photo hash matches * The device key matches a registered identity * Timestamp is fresh * Image wasn’t AI-generated or altered This allows on-chain verification **without revealing EXIF or sensitive data**. **2. On-chain verification (RISC Zero Verifier Contract)** The ZK proof is validated using a **RISC Zero verifier contract**, allowing trustless validation of: * Authentic capture * Device identity * Integrity of metadata This is the cornerstone of **tamper-proof photography**. --- ## **📦 Storage Layer (Filecoin / IPFS)** The Synapse SDK uploads: * Raw photo file * Metadata JSON (proof, signatures, CIDs, device ID, hash) Both are stored permanently on **Filecoin** with CID-based addressing. This gives us: * Permanent, decentralized memory * Immutable provenance * Zero dependency on centralized cloud storage --- ## **🔗 Smart Contracts (Ethereum Sepolia)** Three key contracts: ### **1. DeviceRegistry.sol** * Registers camera identities * Ensures only authorized devices can mint * Verifies device → wallet ownership ### **2. LensMintERC1155.sol** * Mints the actual authenticated photo NFTs * Enforces device-only minting * Supports editions, transfers, and claims ### **3. LensMintVerifier.sol** * Uses **RISC Zero** to verify ZK proofs * Validates image hash + metadata hash * Confirms the device is legit All logic is optimized for gas and tamper-proof provenance. --- ## **📱 Claiming System (Public Server + QR Flow)** We built a public claim server where each photo: * Creates a unique claim ID * Generates a QR code * Waits for user wallet submission * Signals the device to mint to that wallet This allows **users in the photo** to instantly claim the NFT without needing the camera operator. --- ## **⚙️ Hacky (but awesome) Engineering** We had to build several creative hacks: * **Hardware-derived private key generator** without exposing entropy sources * Custom Python → Node communication layer to handle signed JPEG buffers * On-device **queue-based uploader** for bad network situations * Real-time QR code generation inside a Kivy UI * Image signing + hashing pipeline optimized to avoid lag on Raspberry Pi * A mini Web3 RPC load balancer to avoid slow public RPCs * A single-click “auto-register device on-chain” system These hacks allowed a low-powered Raspberry Pi to run **ZK proofs, Filecoin uploads, cryptographic signing, and real-time camera preview all together**.