A multiplayer blockchain-based game with identity verification using Self Protocol.
- Self Protocol Authentication: Secure identity verification using zero-knowledge proofs
- Multiplayer Gaming: Real-time multiplayer game using Socket.IO
- Blockchain Integration: Smart contracts on Ethereum/Celo
- Multiple Game Areas: Cinema, Library, Townhall, and main game areas
- Node.js (v16 or higher)
- MongoDB (local or cloud)
- ngrok (for development with Self Protocol)
git clone https://github.com/adityabelgaonkar05/eth-delhi.git
cd eth-delhicd backend
npm installCreate .env file:
cp .env.example .envEdit .env with your MongoDB URI:
MONGO_URI=mongodb://localhost:27017/cryptoverse-game
PORT=3001
NODE_ENV=development
SELF_SCOPE=cryptoverse-gamecd ../frontend
npm install --legacy-peer-depsSelf Protocol requires a public HTTPS endpoint. For development, we use ngrok:
npm install -g ngrokcd backend
npm startcd backend
npm run tunnelThis will output something like:
π Ngrok tunnel created: https://abc123.ngrok.io
π Update your SELF_ENDPOINT to: https://abc123.ngrok.io/api/auth/verify
cd frontend
npm run dev- Open your browser to
http://localhost:5173 - When prompted, enter your ngrok URL (e.g.,
https://abc123.ngrok.io) - The system will test the connection and save the configuration
The application is configured to use Self Protocol with the following settings:
- Minimum Age: 18 years
- Excluded Countries: North Korea, Iran, Syria
- Required Documents: Government-issued ID (Passport, ID Card, or Aadhaar)
- Disclosed Information: Name, Nationality, Gender
Users must:
- Be 18 years or older
- Have a valid government-issued document
- Not be from restricted countries
- Complete Self Protocol identity verification
POST /api/auth/verify- Self Protocol verification endpointGET /api/auth/status/:userIdentifier- Check user verification statusGET /api/auth/health- Health check
All game areas require Self Protocol authentication:
- Main Game: Multiplayer tile-based game
- Cinema: Video streaming and events
- Library: Educational content
- Townhall: Community discussions
Verified users get:
- Unique blockchain-style identifier
- Verified nationality and basic profile
- Game progression tracking
- Achievement system
# Backend with nodemon
cd backend
npm run dev
# Frontend with Vite HMR
cd frontend
npm run devMONGO_URI=mongodb://localhost:27017/cryptoverse-game
PORT=3001
NODE_ENV=development
SELF_SCOPE=cryptoverse-game
SELF_ENDPOINT=https://your-ngrok-url.ngrok.io/api/auth/verify
BACKEND_URL=https://your-ngrok-url.ngrok.ioVITE_API_URL=https://your-ngrok-url.ngrok.io
VITE_SELF_SCOPE=cryptoverse-game
VITE_SELF_ENDPOINT=https://your-ngrok-url.ngrok.io/api/auth/verifyThis means Self Protocol cannot reach your localhost endpoint. Make sure:
- ngrok is running and creating a tunnel
- Your backend server is running on port 3001
- You've entered the correct ngrok URL in the frontend setup
Check that:
- Backend server is running (
npm startin backend folder) - MongoDB is connected
- ngrok tunnel is active and pointing to port 3001
Download the Self app from your device's app store:
- iOS: Search "Self Sovereign Identity"
- Android: Search "Self Protocol"
For production deployment:
- Deploy backend to a cloud service (Heroku, Railway, etc.)
- Update environment variables with production URLs
- Set
NODE_ENV=production - Use production MongoDB database
- Configure CORS for your production frontend domain
- Fork the repository
- Create a feature branch
- Make your changes
- Test with Self Protocol authentication
- Submit a pull request
MIT License - see LICENSE file for details.
For Self Protocol specific issues, visit: https://docs.self.xyz For game-related issues, create an issue in this repository.