december 2025GitHubVideo Demo

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

FeatureDescription
๐Ÿ“ธ Webcam CaptureReal-time photo capture using react-webcam
๐Ÿ” On-Chain VerificationSHA-256 hash stored immutably on Arbitrum
โšก Stylus ContractsRust/WASM for ~10x gas savings vs Solidity
๐ŸŒ IPFS StorageDecentralized image storage via Pinata
๐Ÿ”— ZK Commitmentskeccak256-based ownership proofs
๐ŸŸฃ Orbit L3Custom L3 chain for ultra-low cost verification
๐Ÿฆ Social SharingTweet verification proofs directly
๐Ÿ” Verification PageAnyone can verify authenticity by uploading an image
๐Ÿ”„ Network SwitchingSeamlessly switch between Sepolia and L3
๐Ÿท๏ธ Watermarked BadgesDownload 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

NetworkContract AddressChain IDRPC
Arbitrum Sepolia0xeb246817d2440f82f4b4c04c2c120afefe1e5ec4421614https://sepolia-rollup.arbitrum.io/rpc
Orbit L3 (Local)0x1294b86822ff4976bfe136cb06cf43ec7fcf2574333333http://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 dependencies
cd frontend && npm install

# Build Rust contract
cd ../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 chain
yes | ./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

FieldValue
Network NameArbiPic L3 (Orbit)
RPC URLhttp://127.0.0.1:3347
Chain ID333333
Currency SymbolETH

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

๐Ÿ”‘ Smart Contract API

Stylus Contract (Rust)

fn verify_photo(photo_hash: U256, zk_commitment: U256) -> U256
fn get_attestation(photo_hash: U256) -> (U256, Address, U256)
fn is_verified(photo_hash: U256) -> bool
fn verify_zk_proof(photo_hash: U256, secret: U256) -> bool
fn get_owner_of(photo_hash: U256) -> Address
fn get_photo_count() -> U256

ABI (Solidity-compatible)

function verifyPhoto(uint256 photoHash, uint256 zkCommitment) returns (uint256)
function getAttestation(uint256 photoHash) view returns (uint256, address, uint256)
function isVerified(uint256 photoHash) view returns (bool)
function verifyZkProof(uint256 photoHash, uint256 secret) view returns (bool)
function getOwnerOf(uint256 photoHash) view returns (address)
function getPhotoCount() view returns (uint256)

๐Ÿ“Š Gas Benchmarks

OperationStylus (Rust)SoliditySavings
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.


๐Ÿ“ Project Structure

ArbiPic/
โ”œโ”€โ”€ contracts/                    # Rust Stylus smart contract
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ lib.rs               # Main contract code
โ”‚   โ”‚   โ””โ”€โ”€ main.rs              # ABI export
โ”‚   โ”œโ”€โ”€ solidity/
โ”‚   โ”‚   โ””โ”€โ”€ PhotoVerifierSolidity.sol
โ”‚   โ”œโ”€โ”€ Cargo.toml
โ”‚   โ””โ”€โ”€ Stylus.toml
โ”œโ”€โ”€ frontend/                     # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Header.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ NetworkSwitcher.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ PhotoCaptureEnhanced.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ VerifyPage.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ zkProof.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ipfs.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ verification.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ eas.ts
โ”‚   โ”‚   โ”œโ”€โ”€ config.ts
โ”‚   โ”‚   โ””โ”€โ”€ App.tsx
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.ts
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ GAS_BENCHMARKS.md
โ”‚   โ””โ”€โ”€ ORBIT_L3_DEPLOYMENT.md
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ deploy.sh
โ”‚   โ””โ”€โ”€ benchmark.sh
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ 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

๐Ÿ’ก Why Stylus?

BenefitDescription
โšก 10x Gas SavingsWASM execution is more efficient than EVM bytecode
๐Ÿฆ€ Rust SafetyMemory safety, no null pointers, no buffer overflows
๐Ÿ”ง Modern ToolingCargo, rustfmt, clippy, rust-analyzer support
๐Ÿ”„ EVM CompatibleFull interoperability with Solidity contracts
๐Ÿ“ฆ Rich EcosystemAccess to all Rust crates (with no_std support)

๐ŸŽฏ What we have Achieved

CategoryImplementation
โœ… StylusRust smart contract with keccak256 ZK proofs
โœ… Orbit L3Custom chain deployment with nitro-testnode
โœ… Gas Efficiency60-70% savings vs Solidity
โœ… IPFSDecentralized storage via Pinata
โœ… ZK ProofsPrivacy-preserving ownership verification
โœ… Multi-ChainNetwork switcher (Sepolia + L3)
โœ… Social ProofTwitter sharing integration
โœ… Modern UXReact 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

๐Ÿ”— Resources


Built with โค๏ธ ๐Ÿ†

Fighting AI fakes with blockchain technology