hackquest logo

ArbiPic

On-Chain Verifiable Photo Capture System empowered by Arbitrum Orbit L3 and Stylus to beat deepfakes and AI

視頻

描述

ArbiPic 📸

On-Chain Verifiable Photo Capture System using Stylus and Arbitrum Orbit L3

A decentralized application that combats AI-generated fake images by enabling users to capture photos via webcam and cryptographically verify them on-chain. Using Arbitrum’s Stylus (Rust smart contracts) and Orbit L3, each photo is hashed, stored on IPFS, and verified on the blockchain with ZK-style ownership proofs.


🌟 Features

Feature

Description

📸 Webcam Capture

Real-time photo capture using react-webcam

🔐 On-Chain Verification

SHA-256 hash stored immutably on Arbitrum

⚡ Stylus Contracts

Rust/WASM for ~10x gas savings vs Solidity

🌐 IPFS Storage

Decentralized image storage via Pinata

🔗 ZK Commitments

keccak256-based ownership proofs

🟣 Orbit L3

Custom L3 chain for ultra-low cost verification

🐦 Social Sharing

Tweet verification proofs directly

🔍 Verification Page

Anyone can verify authenticity by uploading an image

🔄 Network Switching

Seamlessly switch between Sepolia and L3

🏷️ Watermarked Badges

Download verified images with proof overlay


🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         FRONTEND                                │
│  React 18 + TypeScript + Vite + Tailwind + Wagmi v2            │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────────┐  │
│  │ PhotoCapture│  │ VerifyPage  │  │ NetworkSwitcher        │  │
│  │ Enhanced    │  │             │  │ (Sepolia ↔ Orbit L3)   │  │
│  └─────────────┘  └─────────────┘  └─────────────────────────┘  │
└───────────────────────────┬─────────────────────────────────────┘
                            │
        ┌───────────────────┼───────────────────┐
        ▼                   ▼                   ▼
┌───────────────┐  ┌────────────────┐  ┌────────────────────┐
│   IPFS        │  │  Arbitrum      │  │  Orbit L3          │
│   (Pinata)    │  │  Sepolia       │  │  (Local/Custom)    │
│               │  │  Chain: 421614 │  │  Chain: 333333     │
│  Images +     │  │                │  │                    │
│  Metadata     │  │  ┌──────────┐  │  │  ┌──────────┐      │
└───────────────┘  │  │ Stylus   │  │  │  │ Stylus   │      │
                   │  │ Contract │  │  │  │ Contract │      │
                   │  │ (Rust)   │  │  │  │ (Rust)   │      │
                   │  └──────────┘  │  │  └──────────┘      │
                   └────────────────┘  └────────────────────┘

📦 Multi-Network Deployment

Network

Contract Address

Chain ID

RPC

Arbitrum Sepolia

0xeb246817d2440f82f4b4c04c2c120afefe1e5ec4

421614

https://sepolia-rollup.arbitrum.io/rpc

Orbit L3 (Local)

0x1294b86822ff4976bfe136cb06cf43ec7fcf2574

333333

http://127.0.0.1:3347


🚀 Quick Start

Prerequisites

  • Node.js 18+ and npm

  • Rust toolchain: rustup install stable

  • Cargo Stylus CLI: cargo install cargo-stylus --locked

  • Docker (for Orbit L3 local development)

  • MetaMask wallet

  • Testnet ETH: Get from Sepolia Faucet

1. Clone & Install

git clone https://github.com/yourusername/ArbiPic.git
cd ArbiPic

# Install frontend dependenciescd frontend && npm install

# Build Rust contractcd ../contracts && cargo build --release

2. Configure Environment

Create frontend/.env:

VITE_PINATA_JWT=your_pinata_jwt_token
VITE_PINATA_GATEWAY=your-gateway.mypinata.cloud
VITE_APP_URL=http://localhost:5173

3. Run Frontend

cd frontend
npm run dev

Visit http://localhost:5173


🟣 Orbit L3 Deployment

For ultra-low cost verification on your own L3 chain:

Start Local L3

# Clone nitro-testnode
git clone --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git
cd nitro-testnode

# Start L1 → L2 → L3 chainyes | ./test-node.bash --init --l3node --detach

Deploy Contract to L3

cd ArbiPic/contracts

cargo stylus deploy \
    --endpoint http://127.0.0.1:3347 \
    --private-key 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659

Add L3 to MetaMask

Field

Value

Network Name

ArbiPic L3 (Orbit)

RPC URL

http://127.0.0.1:3347

Chain ID

333333

Currency Symbol

ETH

Pre-funded test account:

  • Address: 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E

  • Private Key: 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659

See docs/ORBIT_L3_DEPLOYMENT.md for detailed guide.


📝 Usage Guide

Capture & Verify a Photo

  1. Connect Wallet: Click “Connect Wallet” and connect MetaMask

  2. Select Network: Use the network switcher (🔵 Sepolia or 🟣 Orbit L3)

  3. Capture Photo: Click “📸 Capture Photo”

  4. Verify On-Chain: Click “🔐 Verify On-Chain” to submit

  5. View Results: Get IPFS link, transaction hash, and verification ID

  6. Share: Tweet your verified photo or copy the verification link

Verify Someone Else’s Photo

  1. Go to /verify page

  2. Upload the image or paste the verification ID

  3. System checks on-chain if the photo was verified

  4. See owner address, timestamp, and ZK proof status

Prove Ownership (ZK Proof)

If you verified a photo, you can prove ownership without revealing the image:

  1. Click “🔐 Prove Ownership”

  2. Your locally-stored secret is used to verify against on-chain commitment

  3. Cryptographic proof confirms you’re the original owner


📊 Gas Benchmarks

Operation

Stylus (Rust)

Solidity

Savings

verifyPhoto

~45,000 gas

~120,000 gas

~63%

getAttestation

~8,000 gas

~25,000 gas

~68%

verifyZkProof

~12,000 gas

~35,000 gas

~66%

See docs/GAS_BENCHMARKS.md for detailed benchmarks.


🛠️ Development

Contract Development

cd contracts
cargo stylus check
cargo build --release --target wasm32-unknown-unknown
cargo stylus deploy --endpoint https://sepolia-rollup.arbitrum.io/rpc --private-key $KEY

Frontend Development

cd frontend
npm run dev       # Start dev server
npm run build     # Build for production
npm run preview   # Preview production build

🎯 What we have Achieved

Category

Implementation

Stylus

Rust smart contract with keccak256 ZK proofs

Orbit L3

Custom chain deployment with nitro-testnode

Gas Efficiency

60-70% savings vs Solidity

IPFS

Decentralized storage via Pinata

ZK Proofs

Privacy-preserving ownership verification

Multi-Chain

Network switcher (Sepolia + L3)

Social Proof

Twitter sharing integration

Modern UX

React 18 + Wagmi v2 + Tailwind


🔮 Future Roadmap

  • Production Orbit Chain - Deploy on mainnet L3

  • Full ZK Proofs - Implement SNARKs/STARKs for complete privacy

  • Batch Verification - Verify multiple photos in one transaction

  • AI Detection - Integrate deepfake detection algorithms

  • Mobile App - React Native version

  • Cross-Chain Bridge - Verify proofs across L2/L3


Built with ❤️ 🏆

Fighting AI fakes with blockchain technology

黑客松進展

Built from Scratch solely for this hackathon and for future milestones

技術堆疊

Rust
Orbit L3
Stylus
React
Web3
Ethers
TailwindCSS
PinataIPFS

籌資狀態

N/A

團隊負責人
AAdil Husain
行業
Other