Skip to content

Repository files navigation

FaceChain: Face Identification and Blockchain Verification

This project demonstrates the requested pipeline end to end:

face scan -> face detection/encoding -> live reverse-image search -> blockchain record -> re-verification

Run it

python -m venv .venv
# Windows: .venv\\Scripts\\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
python pipeline.py path/to/face.jpg

The scan is uploaded to Google Lens. The first returned external result is recorded. If Google presents a consent or challenge page, inspect the printed search URL and replay the run with the selected result:

python pipeline.py path/to/face.jpg --skip-search --result-url "https://example.com/post"

chain.json is an append-only local blockchain. Each block contains the source image hash, the face encoding hash, the discovered URL, and the search metadata. Blocks are mined with a small proof-of-work and linked by previous_hash; the CLI immediately recomputes every block and prints PASS/FAIL. You can verify an existing ledger without image dependencies using python verify_chain.py (or python pipeline.py --verify after installing the requirements).

Design notes and limitations

  • OpenCV's Haar cascade detects the largest visible face. The encoding is a deterministic normalized 32x32 grayscale face fingerprint, suitable for demonstrating identity linkage but not a production biometric system.
  • Google Lens is a public web endpoint and may rate-limit, require consent, or change its HTML. No search result is hardcoded.
  • The blockchain is local and simulated, so it demonstrates tamper evidence and re-verification without requiring a wallet or paid RPC. For production, replace mine_block with a public testnet transaction and store the same record hash on-chain.
  • Only publicly returned links are recorded; the project does not download or republish social media content.

Recording checklist

Show the terminal steps [1/3], [2/3], [3/3], one or more live Lens result URLs, the mined block hash, and Re-verification: PASS. Then edit one value in chain.json and run python verify_chain.py to show that tampering fails.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages