EEG brainwave identity verification with zero-knowledge proofs, unhackable biometrics.
Neural Identity Verification System - Complete Project Overview Project Concept & Motivation Our project, "Neural Identity Verification System", represents a revolutionary approach to digital identity verification using brainwave patterns instead of traditional biometric methods. This system combines cutting-edge neuroscience with blockchain technology to create a privacy-preserving, unique identity verification mechanism. The core innovation lies in using EEG (Electroencephalography) brainwave patterns as a biometric identifier, similar to how World Chain uses iris scanning for Proof of Humanity, but with the advantage of being completely non-invasive and privacy-preserving through zero-knowledge proofs. [HARDWARE PART] [This section will be completed by your friend who developed the EEG hardware components, ESP32 integration, and 8-channel EEG monitoring system] Software Architecture & Implementation
How We Built BrainID
The Journey & Technical Architecture
Building this project was honestly one of the most challenging yet rewarding experiences we've had. The idea of using brainwaves for identity verification seemed crazy at first, but as we dove deeper into the technical possibilities, it became clear that this could actually work.
[Hardware/EEG Processing Component] [This section covers the ESP32 integration, 8-channel EEG signal acquisition, and real-time neural signal processing - implemented by our hardware specialist teammate]
Core Technology Stack & Implementation
Smart Contract Layer - Solidity on Base Sepolia
We started with the blockchain foundation because we knew this had to be bulletproof. Deployed three main contracts:
EEGRegistry.sol - The main registry EEGGroup.sol - Group management with Semaphore EEGVerifier.sol - ZK proof verification
Why Base Sepolia? Honestly, it was a practical choice. Low gas fees for testing, good tooling support, and it's EVM compatible so we could use all the Ethereum development tools we're familiar with. The deployment process was smooth using Hardhat.
The Tricky Part: Integrating Semaphore protocol wasn't straightforward. We had to really understand how the zero-knowledge proofs work because you can't just copy-paste this stuff. The identity commitments had to be generated correctly, and the Merkle tree structure had to be compatible with the frontend proof generation.
Backend API - Node.js/Express with Semaphore Integration
Running on port 8000 8 main endpoints for complete functionality
Technology Choices: Node.js/Express - We're most comfortable with this stack TypeScript - Caught so many bugs during development LevelDB - For persistent Merkle tree storage Semaphore Protocol - The real MVP here for zero-knowledge proofs
The Challenge: The Semaphore protocol integration was the hardest part. We had to understand Poseidon hashing, zk-SNARKs, and how to properly generate identity commitments. The documentation is good, but implementing it in a real system with proper error handling and edge cases took weeks.
What We're Proud Of: The API is completely stateless and can scale horizontally. Each endpoint is atomic, and the Merkle tree operations are thread-safe through LevelDB's built-in locking.
EEG Processing Server - Python Flask
Port 5000 - Flask with Socket.IO Processes raw EEG → 280 features → 2KB biometric key
Why Python? The EEG processing algorithms were already implemented in Python, and the NumPy/SciPy ecosystem is unmatched for signal processing. Plus, interfacing with the hardware components was much easier.
The Hacky Part: The biometric key generation is where we got creative. We're taking 280 neural features and using a combination of frequency domain analysis and statistical measures to generate a reproducible 2KB key. The algorithm has built-in noise tolerance, so the same person generates similar keys even with slight variations in EEG readings.
Socket.IO Integration: This was actually fun to implement. Real-time streaming of EEG data to the frontend creates this amazing user experience where you can see your brainwaves in real-time. The challenge was handling disconnections gracefully and ensuring the data stream stays synchronized.
Frontend - Next.js 14 with Modern UI
Port 3001 - Next.js with TypeScript Real-time EEG visualization + blockchain integration
Technology Stack: Next.js 14 - Latest features, great developer experience TypeScript - Non-negotiable for complex state management TailwindCSS - Rapid UI development Socket.IO Client - Real-time EEG data streaming RainbowKit - Wallet connections (this saved us weeks) Wagmi - Ethereum hooks and utilities
The UI Challenge: Creating a professional-looking EEG monitoring interface was tough. We wanted it to feel like medical equipment but still be approachable. The glass-morphism design with real-time data visualization struck the right balance.
What's Actually Clever: The progressive loading states. Instead of instant responses, we added realistic delays that match what users expect from medical devices. The EEG capture takes 3-5 seconds, blockchain confirmations show 3.5 seconds - it feels more trustworthy.
Integration Challenges & Solutions
CORS Nightmare: The biggest headache was getting all three services to talk to each other. Flask on 5000, Node.js on 8000, Next.js on 3001 - CORS was blocking everything. We ended up configuring flask-cors properly and setting up development proxies.
Socket.IO Complexity: Getting real-time EEG streaming to work reliably across all three services was tricky. We had to implement proper connection handling, reconnection logic, and data synchronization. The reward is seeing live brainwaves in the browser - it's magical.
Zero-Knowledge Proof Generation: This was the most technically challenging part. Understanding how to take a 2KB biometric key and generate a proper Semaphore identity commitment that works with the smart contracts. The math is complex, but the privacy benefits are worth it.
Partner Technologies That Made This Possible
Semaphore Protocol: Absolute game-changer. Without this, we'd have to build zero-knowledge infrastructure from scratch. The privacy guarantees are cryptographically sound, and the developer experience is good once you understand it.
RainbowKit: Saved us months of wallet integration work. Multiple wallet support, great UX, and it just works. The Base Sepolia integration was seamless.
LevelDB: Perfect for our Merkle tree storage needs. Fast, reliable, and the API is simple enough that we didn't need to worry about database administration.
Socket.IO: Real-time communication between Python and React. The cross-language support and automatic fallbacks make it production-ready.
The Particularly Hacky Bits
Biometric Key Consistency: The biggest hack is how we ensure the same person generates similar keys despite EEG variations. We're using a combination of frequency band ratios, statistical moments, and signal correlation patterns. It's not perfect, but it works well enough for a proof-of-concept.
Demo Timing: All the delays in the UI are artificial. Real EEG processing could be much faster, but we slowed everything down so judges can actually see what's happening during demos. The 1.5-second delays between steps and 3.5-second blockchain confirmations are purely for presentation.
ESP32 Simulation: Since we don't have real hardware connected during demos, we're simulating the ESP32 connection at IP 192.168.1.100. The backend generates realistic EEG-like signals that look convincing in the UI.
Development Workflow: Running three separate servers (Python, Node.js, Next.js) during development was a pain. We ended up with a complex terminal setup and had to be careful about port conflicts. Not elegant, but it works.
What We Learned
Zero-Knowledge Proofs: This project forced us to really understand zk-SNARKs beyond the surface level. The privacy implications are profound - we can verify someone's humanity without storing any personal biometric data.
Signal Processing: Working with EEG data taught us a lot about frequency domain analysis, noise filtering, and feature extraction. The human brain generates incredibly complex signals.
Real-Time Systems: Coordinating real-time data flow between three different technologies (Python, Node.js, React) was a great lesson in system architecture.
Blockchain Integration: Moving beyond simple smart contracts to a full application with real-world data integration. The gap between blockchain theory and practice is significant.
This project pushed us technically in ways we didn't expect. The combination of neuroscience, cryptography, and blockchain created unique challenges that required creative solutions. We're proud of what we built, and we think it demonstrates the potential for privacy-preserving biometric systems.