A next-generation decentralized platform for recording, tokenizing, and managing audio content on the blockchain with Self Protocol identity verification. Built with Next.js, Filecoin, and IPFS for secure, permanent audio storage with privacy-first identity verification.
- π Self Protocol Identity Verification: Privacy-first identity verification using zero-knowledge proofs
- ποΈ High-Quality Audio Recording: Record audio directly in browser with real-time waveform visualization
- π Blockchain NFT Minting: Tokenize audio as NFTs on Filecoin Calibration testnet
- π¦ Decentralized Storage: Permanent storage using Lighthouse and IPFS
- π‘οΈ Verification Gates: Only verified users can create and tokenize audio content
- πΌ Creator Dashboard: Manage your verified identity and audio NFT collection
- π Multi-Wallet Support: Connect with MetaMask, WalletConnect, and more via RainbowKit
- π Production Ready: Enterprise-grade error handling and user experience
- Next.js 15.3 - React framework with App Router and Turbopack
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- RainbowKit - Multi-wallet connection UI
- Wagmi - React hooks for Ethereum
- Ethers.js v6 - Ethereum library for blockchain interactions
- Lucide React - Modern icon library
- Self Protocol - Privacy-first identity verification
- Zero-Knowledge Proofs - Age and identity verification without revealing personal data
- Passport/Aadhaar Support - Multiple document types for global accessibility
- Lighthouse SDK - IPFS file storage and encryption
- IPFS - Decentralized file storage
- Hardhat - Ethereum development environment
- Solidity - Smart contract development
- OpenZeppelin - Secure smart contract libraries
- Filecoin Calibration - Primary testnet for development and testing
- Filecoin Mainnet - Production deployment target
- EVM Compatibility - Works with Ethereum-compatible networks
SONIC_SAT/
βββ app/ # Next.js App Router pages
β βββ buyer/ # Buyer dashboard page
β βββ store/ # Main audio recording & tokenization page
β βββ test-verification/ # Self Protocol testing page
β βββ verification-callback/ # Self Protocol callback handler
β βββ page.tsx # Homepage
β βββ layout.tsx # Root layout with providers
β βββ globals.css # Global styles and CSS variables
β βββ providers.tsx # Wagmi and RainbowKit providers
β βββ index.tsx # App entry point
βββ components/ # React components
β βββ SelfProtocolVerification.tsx # Identity verification component
β βββ BuyerDashboardHeader.tsx # Buyer dashboard header
β βββ BuyerDashboardLayout.tsx # Buyer dashboard layout
β βββ AppRouter.tsx # Application routing
β βββ Footer.tsx # Site footer
β βββ Header.tsx # Site header with wallet connection
β βββ WalletConnect.tsx # Wallet connection component
β βββ FeatureTag.tsx # Feature highlight tags
β βββ StatCard.tsx # Statistics display cards
βββ contracts/ # Solidity smart contracts
β βββ SonicSelfVerification.sol # Self Protocol verification contract
β βββ SonicIPToken.sol # Audio NFT token contract
βββ contexts/ # React contexts
β βββ IPContext.tsx # IP and user data context
β βββ RoleContext.tsx # User role management context
βββ hooks/ # Custom React hooks
β βββ useEthers.ts # Ethers.js integration hooks
βββ lib/ # Utility libraries and services
β βββ contractConfig.ts # Contract addresses and ABIs
β βββ selfProtocolService.ts # Self Protocol integration service
β βββ sonicIpContract.ts # IP token contract utilities
β βββ contract.ts # Legacy contract configuration
βββ public/ # Static assets
β βββ assets/ # Images and media files
β β βββ background/ # Background images
β β βββ logos/ # Logo files
β βββ favicon.ico # Site favicon
βββ scripts/ # Deployment and utility scripts
βββ .env.local # Local environment variables
βββ .env.production # Production environment variables
βββ hardhat.config.js # Hardhat blockchain development config
βββ next.config.ts # Next.js configuration with webpack
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies and scripts
βββ README.md # This comprehensive guide
Before setting up the project, ensure you have the following installed:
- Node.js >= 22.0.0 - Download from nodejs.org
- npm >= 10.0.0 (comes with Node.js) or yarn >= 1.22.0
- Git - Download from git-scm.com
- MetaMask or any Web3 wallet - Install MetaMask
- Self Protocol Mobile App - Download from app store for identity verification
- Lighthouse API Key - Get from lighthouse.storage
git clone https://github.com/hedauav/SONIC.git
cd SONIC/SONIC_SAT# Install all dependencies with legacy peer deps for compatibility
npm install --legacy-peer-deps
# Or if you prefer yarn
yarn installImportant: Use --legacy-peer-deps flag to handle dependency conflicts between packages.
Create a .env.local file in the root directory with the following variables:
# Lighthouse IPFS Configuration
NEXT_PUBLIC_LIGHTHOUSE_API_KEY=your_lighthouse_api_key_here
# Wallet Connect Configuration
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_walletconnect_project_id
# Self Protocol Configuration
NEXT_PUBLIC_SELF_ENDPOINT=https://api.self.xyz
NEXT_PUBLIC_SELF_APP_NAME=Sonic SAT
NEXT_PUBLIC_SELF_SCOPE=sonic-sat-verification
# Smart Contract Addresses (Filecoin Calibration Testnet)
NEXT_PUBLIC_SONIC_VERIFICATION_CONTRACT=0xe797FD53EE2254af2D2d35399486E53b7e6ba5d5
NEXT_PUBLIC_SONIC_IP_TOKEN_CONTRACT=0x332b7fefb103ce489b20D461bdDf253Fe305678E
# Network Configuration
NEXT_PUBLIC_NETWORK_NAME=Filecoin Calibration
NEXT_PUBLIC_NETWORK_RPC=https://api.calibration.node.glif.io/rpc/v1
NEXT_PUBLIC_CHAIN_ID=314159Lighthouse API Key:
- Visit lighthouse.storage
- Sign up for an account
- Generate an API key from your dashboard
- Add it to your
.env.localfile
WalletConnect Project ID:
- Visit cloud.walletconnect.com
- Create a new project
- Copy the Project ID
- Add it to your
.env.localfile
For identity verification, you'll need the Self Protocol app:
- iOS: Search "Self Protocol" in App Store
- Android: Search "Self Protocol" in Google Play Store
Add Filecoin Calibration testnet to MetaMask:
- Network Name: Filecoin Calibration
- RPC URL:
https://api.calibration.node.glif.io/rpc/v1 - Chain ID:
314159 - Currency Symbol:
tFIL - Block Explorer:
https://calibration.filfox.info/
Get testnet FIL for transactions:
- Visit faucet.calibration.fildev.network
- Enter your wallet address
- Request testnet FIL
npm run devThe application will be available at http://localhost:3000
- Frontend: Navigate to
http://localhost:3000- should load the homepage - Wallet Connection: Click "Connect Wallet" - should show wallet options
- Network: Ensure MetaMask is connected to Filecoin Calibration
- Self Protocol: Go to
/storepage and test identity verification
Self Protocol Verification:
- Navigate to
/storepage - Connect your Web3 wallet to Filecoin Calibration
- Complete Self Protocol identity verification:
- Scan QR code with Self Protocol mobile app
- Take photo of passport or Aadhaar card
- Complete selfie verification
- Wait for proof generation
- Verification is recorded on blockchain (valid for 30 days)
Alternative Verification:
- If Self Protocol fails, use the "Alternative Verification" option
- This provides temporary verification for development/testing
Recording Process:
- After verification, access the recording interface
- Grant microphone permissions when prompted
- Click record button to start recording
- Monitor real-time waveform visualization
- Click stop to end recording
- Preview your audio with playback controls
Audio Upload:
- Click "Upload to IPFS" after recording
- Audio is encrypted and stored on IPFS via Lighthouse
- Receive IPFS hash for permanent storage
- Audio is now ready for tokenization
Minting Process:
- Enter NFT metadata:
- Token Name: Descriptive name for your audio NFT
- Description: Detailed description of the content
- Creator Info: Your verified identity information
- Review gas fees and transaction details
- Click "Tokenize & Store on Blockchain"
- Confirm transaction in MetaMask
- Wait for blockchain confirmation
- Receive NFT token ID and transaction hash
My Collection Features:
- Navigate to collection page
- View all your tokenized audio NFTs
- Play audio directly from IPFS
- View NFT metadata and blockchain details
- Share IPFS links with others
- Track verification status and expiry
npx hardhat compilenpx hardhat test# Start local Hardhat network
npx hardhat node
# Deploy contracts (in another terminal)
npx hardhat run scripts/deploy.js --network localhostUpdate hardhat.config.js with Filecoin Calibration network:
networks: {
calibration: {
url: "https://api.calibration.node.glif.io/rpc/v1",
accounts: [process.env.PRIVATE_KEY],
chainId: 314159
}
}npx hardhat run scripts/deploy.js --network calibrationAfter deployment, update the contract addresses in:
lib/contractConfig.ts.env.local.env.production
# Deploy to Filecoin mainnet
npx hardhat run scripts/deploy.js --network filecoin
# Verify contracts (if supported)
npx hardhat verify --network filecoin <CONTRACT_ADDRESS>npm run dev# Build the application
npm run build
# Start production server
npm run start
# Or deploy to Vercel/Netlify
vercel --prod# Check for build errors
npm run build
# Run type checking
npm run type-check
# Run linting
npm run lint- Filecoin Calibration Testnet (Development)
- Chain ID:
314159 - RPC:
https://api.calibration.node.glif.io/rpc/v1 - SonicSelfVerification:
0xe797FD53EE2254af2D2d35399486E53b7e6ba5d5 - SonicIPToken:
0x332b7fefb103ce489b20D461bdDf253Fe305678E
- Chain ID:
- Filecoin Mainnet (Production)
- Chain ID:
314 - RPC:
https://api.node.glif.io/rpc/v1 - Contracts: TBD (deploy when ready for production)
- Chain ID:
| Variable | Description | Example |
|---|---|---|
NEXT_PUBLIC_LIGHTHOUSE_API_KEY |
Lighthouse IPFS storage API key | 7d4a2b8c... |
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID |
WalletConnect project identifier | a1b2c3d4... |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_SELF_ENDPOINT |
Self Protocol API endpoint | https://api.self.xyz |
NEXT_PUBLIC_SELF_APP_NAME |
Application name for Self Protocol | Sonic SAT |
NEXT_PUBLIC_SELF_SCOPE |
Verification scope identifier | sonic-sat-verification |
| Variable | Description | Testnet Address |
|---|---|---|
NEXT_PUBLIC_SONIC_VERIFICATION_CONTRACT |
Self Protocol verification contract | 0xe797FD53EE2254af2D2d35399486E53b7e6ba5d5 |
NEXT_PUBLIC_SONIC_IP_TOKEN_CONTRACT |
Audio NFT token contract | 0x332b7fefb103ce489b20D461bdDf253Fe305678E |
| Variable | Description | Value |
|---|---|---|
NEXT_PUBLIC_NETWORK_NAME |
Display name for network | Filecoin Calibration |
NEXT_PUBLIC_NETWORK_RPC |
RPC endpoint URL | https://api.calibration.node.glif.io/rpc/v1 |
NEXT_PUBLIC_CHAIN_ID |
Network chain identifier | 314159 |
"Proof Failed" Error:
- Ensure good lighting when taking document photos
- Use passport instead of other documents (higher success rate)
- Check stable internet connection
- Update Self Protocol mobile app to latest version
- Try alternative verification if Self Protocol fails repeatedly
QR Code Not Loading:
- Check browser console for errors
- Ensure you're on Filecoin Calibration network
- Refresh the page and try again
- Use "Open in Self App" direct link as fallback
MetaMask Not Connecting:
- Ensure MetaMask is installed and unlocked
- Check you're on the correct network (Filecoin Calibration)
- Clear browser cache and cookies
- Try refreshing the page
Network Configuration:
- Manually add Filecoin Calibration network to MetaMask
- Ensure RPC URL is correct:
https://api.calibration.node.glif.io/rpc/v1 - Chain ID must be
314159
Dependency Conflicts:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm install --legacy-peer-depsEnvironment Variables Not Loading:
- Ensure
.env.localfile is in root directory - Restart development server after changing environment variables
- Check variable names start with
NEXT_PUBLIC_
IPFS Upload Failures:
- Verify Lighthouse API key is correct
- Check network connectivity
- Ensure sufficient storage quota on Lighthouse account
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript type checking
# Smart Contracts
npx hardhat compile # Compile contracts
npx hardhat test # Run contract tests
npx hardhat node # Start local blockchain
npx hardhat clean # Clean compiled artifacts
# Deployment
vercel --prod # Deploy to Vercel
npm run build && npm run start # Local production test-
Fork & Clone
git clone https://github.com/your-username/SONIC.git cd SONIC/SONIC_SAT -
Setup Development Environment
npm install --legacy-peer-deps cp .env.example .env.local # Configure your environment -
Create Feature Branch
git checkout -b feature/your-feature-name
-
Development Standards
- Follow TypeScript strict mode
- Use Tailwind CSS for styling
- Write comprehensive tests for new features
- Ensure Self Protocol integration works
- Test on Filecoin Calibration testnet
-
Testing Checklist
- Wallet connection works
- Self Protocol verification completes
- Audio recording functions properly
- IPFS upload succeeds
- NFT minting works on testnet
- No console errors
- Responsive design works
-
Submit Pull Request
- Provide clear description of changes
- Include screenshots/videos for UI changes
- Reference any related issues
- Ensure all tests pass
- TypeScript: Use strict typing, avoid
any - React: Use functional components with hooks
- CSS: Use Tailwind CSS classes, avoid custom CSS
- Naming: Use descriptive variable and function names
- Comments: Document complex logic and Self Protocol integrations
This project is licensed under the MIT License. See the LICENSE file for details.
- Self Protocol - Privacy-first identity verification
- Filecoin - Decentralized storage network
- Lighthouse - IPFS storage and encryption
- IPFS - InterPlanetary File System
- Next.js - React framework
- RainbowKit - Wallet connection UI
- Wagmi - React hooks for Ethereum
- Ethers.js - Ethereum library
- OpenZeppelin - Smart contract security
- Tailwind CSS - Utility-first CSS framework
- Filecoin Foundation for testnet support
- Self Protocol team for identity verification infrastructure
- Lighthouse team for IPFS storage solutions
- Open source community for tools and libraries
- Documentation: This README and inline code comments
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Repository: https://github.com/hedauav/SONIC
- Live Demo: [Coming Soon - Deploy to production]
- Documentation: [This README]
- Primary: @hedauav
- Contributors: See Contributors
# 1. Clone and setup
git clone https://github.com/hedauav/SONIC.git
cd SONIC/SONIC_SAT
npm install --legacy-peer-deps
# 2. Configure environment
cp .env.example .env.local
# Add your API keys to .env.local
# 3. Start development
npm run dev
# 4. Open browser
# Navigate to http://localhost:3000
# Connect wallet to Filecoin Calibration
# Complete Self Protocol verification
# Start creating audio NFTs!π΅ Welcome to the future of decentralized audio content creation with privacy-first identity verification!
β‘ Powered by Filecoin, IPFS & Self Protocol