Privacy-preserving identity verification for decentralized Rotating Savings and Credit Associations (ROSCAs) powered by Self Protocol and PYUSD.
ROSCA-Guard revolutionizes traditional rotating savings circles by combining blockchain technology with zero-knowledge identity verification. Built for the Self Protocol hackathon, this platform enables verified users to participate in automated savings circles while maintaining complete privacy.
- π Zero-Knowledge KYC: Identity verification using Self Protocol (Passport & Aadhaar support)
- π° PYUSD Integration: Stablecoin-based automated payments and payouts
- βοΈ Cross-Chain Architecture: KYC on Celo, ROSCA operations on Ethereum
- π Smart Contract Automation: No manual coordination required
- π― Reputation System: Merit-based payout selection
- π DeFi Yield: Earn additional returns on pooled funds
- π Global Access: Support for region-specific and international circles
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React) β
β - RainbowKit Wallet Connection β
β - Self Protocol QR Code Integration β
β - ROSCA Circle Management UI β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Backend (Express.js + TypeScript) β
β - Self Protocol Backend Verifier β
β - Cross-Chain Bridge Service β
β - API Gateway β
ββββββββ¬ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Celo Testnet β β Ethereum Sepoliaβ
β β β β
β KYC Verifier β β ROSCA Factory β
β (Self Protocol)β β ROSCA Circles β
β β β PYUSD Token β
βββββββββββββββββββ βββββββββββββββββββ
- Node.js >= 18.0.0
- npm >= 8.0.0
- MetaMask or compatible Web3 wallet
- Self Protocol mobile app (iOS / Android)
- Clone the repository
git clone https://github.com/anumukul/ROSCA-Guard.git
cd ROSCA-Guard- Install Backend Dependencies
cd backend
npm install- Configure Backend Environment
cp .env.example .envEdit .env with your configuration:
NODE_ENV=development
PORT=3001
# Blockchain RPCs
CELO_RPC_URL=https://alfajores-forno.celo-testnet.org
ETHEREUM_RPC_URL=https://sepolia.infura.io/v3/YOUR_INFURA_KEY
# Contract Addresses
KYC_VERIFIER_ADDRESS=0xAE8d27497451A252815B86898CDAd029be1417e9
ROSCA_FACTORY_ADDRESS=0x9F01d0beE74AC0aF15a390cF5bd54E28EF4BbBac
# Self Protocol
SELF_CONFIG_ID=0x766466f264a44af31cd388cd05801bcc5dfff4980ee97503579db8b3d0742a7e
# Frontend URL
FRONTEND_URL=http://localhost:3000- Start Backend
npm run dev- Install Frontend Dependencies
cd ../frontend
npm install --legacy-peer-deps- Configure Frontend Environment
cp .env.example .envEdit .env:
VITE_API_URL=http://localhost:3001
VITE_SELF_CONFIG_ID=0x766466f264a44af31cd388cd05801bcc5dfff4980ee97503579db8b3d0742a7e- Start Frontend
npm run devVisit http://localhost:3000 π
-
Verify Identity
- Connect your Web3 wallet
- Choose verification method (Passport or Aadhaar)
- Scan QR code with Self Protocol app
- Complete zero-knowledge verification
-
Create or Join ROSCA Circle
- Browse available circles or create new one
- Set monthly contribution amount in PYUSD
- Define circle parameters (size, duration, eligibility)
-
Participate in Circles
- Make monthly PYUSD contributions automatically
- Receive payouts when it's your turn
- Earn yield on pooled funds
- Build reputation through consistent participation
cd contracts
# Install dependencies
npm install
forge install
# Configure deployment
cp .env.example .env
# Edit .env with your private key and RPC URLs
# Deploy KYC Verifier on Celo
forge script script/DeployKYC.s.sol --rpc-url $CELO_RPC_URL --broadcast --verify
# Deploy ROSCA Factory on Ethereum
forge script script/DeployFactory.s.sol --rpc-url $ETHEREUM_RPC_URL --broadcast --verify# Backend tests
cd backend
npm test
# Smart contract tests
cd contracts
forge test
# Frontend tests
cd frontend
npm test- Framework: React 18 + TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Web3: RainbowKit + wagmi + viem
- Identity: Self Protocol SDK (
@selfxyz/core,@selfxyz/qrcode) - State Management: React Query
- Routing: React Router v6
- Runtime: Node.js + Express.js
- Language: TypeScript
- Identity Verification: Self Protocol Backend Verifier
- Blockchain Interaction: ethers.js v5
- Security: Helmet, CORS, Rate Limiting
- Validation: express-validator
- Language: Solidity 0.8.28
- Framework: Foundry
- Identity: Self Protocol Verification Root
- Standards: ERC-20 (PYUSD), Custom ROSCA logic
- Networks: Celo (KYC), Ethereum (ROSCAs)
- Backend Hosting: Render
- Frontend Hosting: Vercel
- Version Control: Git + GitHub
- CI/CD: GitHub Actions (optional)
- KYC Verifier:
0xAE8d27497451A252815B86898CDAd029be1417e9 - Network: Celo Alfajores
- Explorer: View on CeloScan
- ROSCA Factory:
0x9F01d0beE74AC0aF15a390cF5bd54E28EF4BbBac - ROSCA Analytics:
0x45Fdf95185922b91627F0B340AFA3DF0fED650E7 - Mock PYUSD:
0x1e4e7e50E176A66BBEFC61331898F5ffdE49DBd6 - Network: Ethereum Sepolia
- Explorer: View on Etherscan
Extends Self Protocol's SelfVerificationRoot for on-chain identity verification.
function isEligibleForROSCA(
address user,
string memory requiredCountry,
uint256 circleMinAge,
uint256 circleMaxAge
) external view returns (bool eligible, string memory reason);Factory pattern for creating and managing ROSCA circles.
function createCircle(
uint256 monthlyAmount,
uint256 maxMembers,
uint256 duration,
string memory country,
uint256 minAge,
uint256 maxAge
) external returns (uint256 circleId);Individual ROSCA circle with automated payment cycles and reputation tracking.
function joinCircle() external onlyKYCVerified;
function makeContribution() external onlyMember;
function distributePayout() external onlyOwner;import { SelfBackendVerifier, AllIds, DefaultConfigStore } from "@selfxyz/core";
const verifier = new SelfBackendVerifier(
"rosca-guard-v1",
"https://rosca-guard.onrender.com/api/self/verify-self",
false, // production mode
AllIds,
new DefaultConfigStore({
minimumAge: 18,
excludedCountries: [],
ofac: true,
}),
"uuid"
);
const result = await verifier.verify(
attestationId,
proof,
publicSignals,
userContextData
);contract KYCVerifier is SelfVerificationRoot {
function customVerificationHook(
ISelfVerificationRoot.GenericDiscloseOutputV2 memory output,
bytes memory userData
) internal override {
// Store verified user data on-chain
verifiedUsers[userAddress] = VerifiedUser({
nationality: output.nationality,
age: calculatedAge,
verificationTimestamp: block.timestamp,
isVerified: true
});
}
}- Production:
https://rosca-guard.onrender.com - Development:
http://localhost:3001
GET /healthPOST /api/self/verify-self
Content-Type: application/json
{
"attestationId": "1",
"proof": {...},
"publicSignals": {...},
"userContextData": "..."
}GET /api/self/kyc-status/:addressPOST /api/self/check-eligibility
Content-Type: application/json
{
"userAddress": "0x...",
"circleId": 1
}GET /api/bridge/statsPOST /api/bridge/create-circle
Content-Type: application/json
{
"monthlyAmount": 100,
"maxMembers": 5,
"duration": 12,
"country": "IN",
"minAge": 18,
"maxAge": 65
}For complete API documentation, see API.md
Celo Alfajores (for KYC transactions)
- Faucet: https://faucet.celo.org/celo-sepolia
- Request: 0.5 CELO per day
Ethereum Sepolia (for ROSCA operations)
- Faucet: https://sepoliafaucet.com
- Request: 0.5 ETH per day
Mock PYUSD
- Use the faucet function in the deployed contract
- Or call
faucet(amount)to mint test tokens
- Install Self Protocol app on your mobile device
- Set up test passport in the app (staging mode)
- Run the frontend locally
- Scan QR code to initiate verification
- Complete the verification flow
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ROSCA-Guard/
βββ backend/
β βββ src/
β β βββ api/ # API routes
β β β βββ bridgeRoutes.ts
β β β βββ selfRoutes.ts
β β βββ services/ # Business logic
β β β βββ CrossChainBridge.ts
β β β βββ SelfVerificationService.ts
β β βββ app.ts # Express app
β βββ package.json
β βββ tsconfig.json
βββ contracts/
β βββ src/
β β βββ KYCVerifier.sol
β β βββ ROSCAFactory.sol
β β βββ ROSCACircle.sol
β β βββ ROSCAAnalytics.sol
β β βββ YieldManager.sol
β β βββ DateParser.sol
β βββ script/ # Deployment scripts
β βββ test/ # Contract tests
β βββ foundry.toml
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ hooks/ # Custom hooks
β β βββ services/ # API services
β β βββ config/ # Configuration
β β βββ App.tsx
β βββ package.json
β βββ vite.config.ts
βββ README.md
- Backend SDK: SelfBackendVerifier for proof verification
- Smart Contracts: SelfVerificationRoot integration
- Zero-Knowledge Proofs: Privacy-preserving identity verification
- Multi-Document Support: Passport and Aadhaar verification
- Primary Currency: All ROSCA contributions in PYUSD
- Smart Contract Integration: ERC-20 standard implementation
- Automated Payments: Monthly contributions and payouts
- Yield Generation: DeFi integration for returns
- Cross-Chain Architecture: KYC on Celo, operations on Ethereum
- Reputation System: Merit-based payout selection
- Sybil Resistance: Identity verification prevents fake accounts
- Financial Inclusion: Accessible global savings circles
This project is licensed under the MIT License - see the LICENSE file for details.
- Self Protocol for zero-knowledge identity verification
- PayPal/Paxos for PYUSD stablecoin
- Celo Foundation for affordable blockchain infrastructure
- Ethereum Foundation for smart contract platform
- ETHGlobal for hosting hackathons and fostering innovation
- Live Demo: [Frontend URL] (Coming soon on Vercel)
- Backend API: https://rosca-guard.onrender.com
- GitHub: https://github.com/anumukul/ROSCA-Guard
- Demo Video: [YouTube Link] (Coming soon)
- Developer: Anumukul
- Email: anumukul009@gmail.com
- Twitter: @anumukul
- GitHub: @anumukul
- Self Protocol KYC integration
- PYUSD smart contract implementation
- Cross-chain bridge architecture
- Backend API deployment
- Frontend deployment on Vercel
- Mainnet deployment
- Mobile app integration
- Additional DeFi yield sources
- Governance features
- Multi-language support
Built with β€οΈ for the EthGlobal New-Delhi Hackathon
Empowering financial inclusion through privacy-preserving identity verification