Built for HackTX 2025
AuthLens is a blockchain-powered video authentication platform that ensures the integrity and verifiability of video evidence. By storing cryptographic hashes of video chunks on the Ethereum blockchain, AuthLens provides tamper-proof verification of video authenticity, timestamps, and ownership.
- π Blockchain-Backed Verification: Store cryptographic hashes on Ethereum for immutable proof
- β±οΈ Timestamp Validation: Track exact recording times for each video chunk
- π₯ Chunked Processing: Process videos in 1-minute segments for efficient handling
- π Instant Verification: Quickly verify if a video exists on the blockchain
- π Decentralized Trust: Leverage blockchain technology for transparent, tamper-proof records
AuthLens/
βββ contracts/ # Solidity smart contracts
β βββ VideoAuth.sol # Main video authentication contract
βββ backend/ # Python FastAPI server
β βββ main.py # API endpoints
β βββ test_client.py # Testing script
β βββ requirements.txt # Python dependencies
βββ AuthLens-Frontend/ # React frontend application
βββ ignition/ # Hardhat deployment modules
βββ test/ # Smart contract tests
βββ hardhat.config.ts # Hardhat configuration
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- MetaMask wallet with Sepolia testnet ETH
- Alchemy or Infura account for RPC access
npm installCreate a .env file in the root directory:
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
PRIVATE_KEY=your_wallet_private_key_here
β οΈ Security Note: Never commit your.envfile or share your private key!
Deploy the VideoAuth contract to Sepolia testnet:
npx hardhat ignition deploy ignition/modules/Deploy.ts --network sepoliaAfter deployment, note the contract address displayed in the console. You'll need this for the backend configuration.
Check the deployment status:
npx hardhat ignition status chain-11155111To verify the contract functionality:
npx hardhat testcd backendpip install -r requirements.txtCreate a .env file in the backend directory:
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY
PRIVATE_KEY=your_wallet_private_key_here
CONTRACT_ADDRESS=your_deployed_contract_address_hereCopy the compiled contract ABI to the backend:
copy ..\artifacts\contracts\VideoAuth.sol\VideoAuth.json VideoAuth.jsonOr on macOS/Linux:
cp ../artifacts/contracts/VideoAuth.sol/VideoAuth.json VideoAuth.jsonpython main.pyThe server will start at http://localhost:8000
Open your browser and navigate to:
- API Documentation:
http://localhost:8000/docs - Health Check:
http://localhost:8000/
The project includes a comprehensive test script to verify all functionality:
python test_client.pyThis test script will:
- β Check server health
- π€ Upload video chunks with timestamps
- π Verify videos on the blockchain
- π₯ Retrieve videos from specific time ranges
- β° Test time range queries
You can also test individual endpoints using curl or the interactive API docs at http://localhost:8000/docs:
curl -X POST "http://localhost:8000/api/video/process-chunk?start_time=2025-01-15T10:00:00&end_time=2025-01-15T10:01:00" ^
-F "video=@path/to/your/video.mp4"curl -X POST "http://localhost:8000/api/video/verify" ^
-F "video=@path/to/your/video.mp4"curl "http://localhost:8000/api/video/range?start_time=2025-01-15T10:00:00&end_time=2025-01-15T11:00:00"cd AuthLens-Frontendnpm installnpm startThe frontend will open at http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /api/video/process-chunk |
Upload and process video chunk |
| POST | /api/video/verify |
Verify if video exists on blockchain |
| GET | /api/video/range |
Get videos in time range |
The VideoAuth contract provides two main functions:
- storeHash(bytes32 _videoHash): Stores a video hash on the blockchain
- verifyHash(bytes32 _videoHash): Verifies if a hash exists and returns the uploader address
Problem: Contract deployment fails
- Solution: Ensure you have enough Sepolia ETH in your wallet (get free testnet ETH from Sepolia faucet)
Problem: Backend can't connect to contract
- Solution: Verify the CONTRACT_ADDRESS in your backend
.envfile matches the deployed contract address
Problem: Transaction reverts with "hash already registered"
- Solution: This video hash already exists on the blockchain - this is expected behavior for duplicate videos
This project is licensed under the MIT License.
Built with β€οΈ for HackTX 2025
- Ethereum Foundation for blockchain infrastructure
- Hardhat for development tools
- FastAPI for the backend framework
After setting the variable, you can run the deployment with the Sepolia network:
npx hardhat ignition deploy --network sepolia ignition/modules/Counter.ts