Inspiration: Everyone is talking about AI scams, but the actual nightmare scenario is the "Liar's Dividend." We are seeing a massive shift where guilty people look at real evidence—like actual CCTV or genuine call recordings—and simply tell the judge, "That’s an AI deepfake."

Under Section 65B of the Indian Evidence Act, if you can't cryptographically prove the chain of custody, the court throws the evidence out. Right now, victims have to wait 6 to 12 months for a forensic lab just to prove a video hasn't been tampered with. We built TrustChain because the legal system has no fast, mathematical way to verify reality. We needed to make digital truth undeniable in seconds, not months.

What it does: TrustChain is an end-to-end cryptographic pipeline that takes a suspicious file and turns it into court-ready evidence. Fingerprint: Instantly calculates a SHA-256 hash of the raw media the second it hits our server. Detect: Scans the physics and spatial data of the media for synthetic artifacts. Lock: Dual-anchors the file's hash to the Ethereum blockchain and an RFC 3161 timestamp. Report: Spits out a portable PDF with a deterministic liability score and a verifiable QR code.

How we built it: We wired together a decoupled microservice architecture using Python, FastAPI, and React.

The Physics Engine (Layer 2): Standard deepfake detectors use neural networks to fight other neural networks—a black box that breaks when new models drop. We bypassed this. For video, we run frames through EfficientNet-B4 to catch spatial glitches. For audio, we use Bispectrum Analysis. AI vocoders completely miss the physical air-friction of human vocal cords. We calculate the bicoherence kurtosis to mathematically flag the absence of real-world physics:

The Custody Anchor (Layer 3): A Web3 hash alone gets laughed out of court. We used web3.py to write the SHA-256 hash to a Sepolia smart contract, but simultaneously wrapped it in a FreeTSA RFC 3161 timestamp. This gives us both mathematical immutability and a legally recognized timeline.

The Liability Output (Layer 4): Courts don't let AI assign blame. We built a pure Python rules engine that calculates liability (User vs. Platform vs. AI Model) based on hard-coded variables. Finally, ReportLab generates an offline-ready PDF with the blockchain TX ID.

Challenges we ran into: Dependency Hell: Shoving PyTorch, librosa, and transformers into one environment is a nightmare for server memory. We had to ruthlessly optimize. For video, we extract only every 10th frame to keep processing times under 15 seconds without crashing the backend.

Blockchain Latency vs. UX: The Sepolia testnet takes about 15 seconds to confirm a block. If we left that synchronous, our FastAPI endpoint would timeout and the UI would freeze. We had to move the blockchain anchoring into asynchronous background tasks so the frontend could show a clean loading state.

The Web3 Reality Check: Realizing that decentralized ledgers aren't enough for Indian courts without a centralized time authority forced us to pivot mid-build. Engineering the "Dual-Anchor" approach (Blockchain + RFC 3161) was a massive hurdle, but it's the only way the product actually works in the real world.

Accomplishments that we're proud of: Ditching MFCC for LFCC: Standard audio models use MFCC because it mimics human hearing. The problem? Deepfake artifacts hide in the high frequencies that MFCC compresses. We realized this, swapped three lines of code to use LFCC (Linear Frequency Cepstral Coefficients), and started scanning the exact bands where AI vocoders fail.

Deterministic Logic over AI Magic: We resisted the urge to use an LLM for everything. Our liability engine is a transparent, spreadsheet-style matrix that cyber-insurance adjusters and lawyers can actually trust.

The Output is the Product: We didn't just build a SaaS dashboard. The final PDF holds the blockchain TX ID and the detection logic. Even if our servers get wiped tomorrow, the victim's proof survives.

What we learned: We learned that technical novelty is useless if it ignores legal reality. We had to dive deep into digital forensics, realizing that physical acoustics (like phase coupling) beat black-box AI classifiers every time. We also learned how to bridge the massive gap between decentralized Web3 tech and rigid courtroom evidence standards.

Built With

Share this project:

Updates