Revolutionary mobile app that uses hardware-backed TEE security to track driving speed, rewards safe driving behavior, and generates court-admissible evidence for legal protection.
ChainSpeed combines iOS Secure Enclave TEE technology with multi-chain blockchain infrastructure to create the world's first legally-admissible speed tracking system that rewards safe driving. Built during a hackathon, this app addresses three major markets: the $6B annual speeding ticket industry, the $200B insurance data market, and the growing drive-to-earn ecosystem.
- ๐ Hardware-Backed Security: Real iOS Secure Enclave integration for tamper-proof speed records
- โ๏ธ Legal Protection: Generate court-admissible evidence against false speeding tickets
- ๐ฐ Drive-to-Earn: Earn XP for safe driving, redeem for real gift cards (Target, Netflix)
- ๐ Multi-Chain: Hedera for legal records, Zircuit for rewards
- ๐ฑ Seamless UX: Privy embedded wallets with gasless transactions
- ๐ Privacy-First: Anonymous data aggregation for traffic insights
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ React Native โโโโโถโ Privy Wallet โโโโโถโ Multi-Chain โ
โ + TEE Securityโ โ Gasless Txns โ โ Deployment โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ iOS Secure โ โ Merkle Trees โ โ Legal Proof โ
โ Enclave โ โ 30s Checkpoints โ โ Generation โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- SpeedRegistry:
0xBB8647F3eCa9fb1f2eb049B07697Ad02f8720ac8 - XPRewards:
0x7224Cf802c4e6bDE9e67C8Eec2673dB85B0B7816
- SpeedRegistry:
0xC1768e08130BA10305064DbA76C57E890B270b3F - XPRewards:
0xBB8647F3eCa9fb1f2eb049B07697Ad02f8720ac8
- Node.js 18+
- iOS device with Face ID/Touch ID (for TEE features)
- Expo CLI or Expo Go app
# Clone the repository
git clone https://github.com/narasim-teja/chainSpeed.git
cd chainSpeed
# Install dependencies
yarn install
# Start the development server
yarn start
# Run on iOS
yarn iosCreate your Privy account and update app.json:
{
"expo": {
"extra": {
"privyAppId": "your-privy-app-id",
"privyClientId": "your-privy-client-id"
}
}
}// Real iOS Secure Enclave integration
const teeService = getTEECryptoService();
await teeService.initialize(); // Generate hardware keys
await teeService.authenticateSession(); // Face ID auth
const signature = await teeService.signSpeedData(speedRecord); // Hardware signing- GPS + accelerometer data collected every second
- Each record signed by Secure Enclave with Face ID protection
- 30-second Merkle tree checkpoints for efficient verification
- Hedera: Stores legal speed checkpoints (low cost, enterprise security)
- Zircuit: Processes XP rewards (enhanced security for user assets)
- 1 XP per safe mile (under 75 mph speed limit)
- Streak bonuses for consecutive safe driving days
- Real gift cards (Target, Netflix) redeemable with XP
- React Native + Expo: Cross-platform mobile development
- TypeScript: Type-safe development
- iOS Secure Enclave: Hardware-backed cryptographic signing
- Multi-sensor fusion: GPS, accelerometer, gyroscope validation
- Hedera: Primary blockchain for legal records
- Zircuit: Secondary chain for rewards system
- Privy: Embedded wallets and gasless transactions
- Viem: Ethereum interactions
- TEE Hardware Signing: Tamper-proof speed record signatures
- Merkle Trees: Efficient cryptographic proofs
- Chain Linking: Sequential record validation
- Anonymous Aggregation: Privacy-preserving data insights
chainspeed/
โโโ app/ # Expo Router screens
โ โโโ index.tsx # Main tracking screen
โ โโโ rewards.tsx # XP and gift card redemption
โ โโโ profile.tsx # Legal proof generation
โโโ components/ # Reusable UI components
โโโ services/ # Core business logic
โ โโโ TEECryptoService.ts # Secure Enclave integration
โ โโโ LocationService.ts # GPS tracking
โ โโโ MerkleService.ts # Checkpoint creation
โ โโโ BlockchainService.ts # Multi-chain interactions
โ โโโ XPService.ts # Drive-to-earn logic
โโโ contracts/ # Smart contracts
โ โโโ SpeedRegistry.sol # Speed checkpoint storage
โ โโโ XPRewards.sol # Drive-to-earn system
โโโ constants/ # Configuration
- Login: Seamless authentication with Privy
- TEE Setup: Initialize Secure Enclave with Face ID
- Start Tracking: Begin secure speed recording
- Drive Safely: Earn XP for staying under speed limits
- Generate Proofs: Create legal evidence when needed
- Drive under 75 mph to earn 1 XP per mile
- Maintain daily driving streaks for bonus XP
- Redeem XP for real gift cards:
- Target $10 = 1,000 XP
- Netflix $10 = 1,000 XP
- Target $50 = 5,000 XP
- Netflix $50 = 5,000 XP
- Navigate to Profile โ Generate Speed Proof
- Select date/time range of alleged violation
- Generate blockchain-verified proof document
- Present QR code evidence in court
- Hardware Key Generation: Private keys created in iOS Secure Enclave
- Biometric Protection: Face ID/Touch ID required for signing
- Tamper Detection: Chain-linked signatures prevent data manipulation
- Session Management: 30-minute authenticated sessions
- Local Processing: GPS data processed on-device
- Anonymous Aggregation: City-level statistics only
- Selective Disclosure: Users control data sharing
- Encrypted Storage: Sensitive data encrypted at rest
- $6B Speeding Tickets: Unfair violations with no defense mechanism
- $200B Insurance Data: Companies profit while drivers get nothing
- Drive-to-Earn Gap: No real-world utility in existing apps
- User Rewards: XP system funded by data insights
- Insurance Partnerships: Anonymous safe driving analytics
- Traffic Data: City planning and navigation services
- Legal Services: Premium proof generation features
# Build for iOS
yarn ios --configuration Release
# Build for Android
yarn android --variant=release
# Deploy smart contracts
cd contracts
npx hardhat deploy --network hedera-testnet
npx hardhat deploy --network zircuit-testnet# Run tests
yarn test
# Test TEE functionality (requires physical iOS device)
yarn test:tee
# Test blockchain integration
yarn test:contracts