Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamalbuilds/refugee-identity-issuer
https://github.com/kamalbuilds/refugee-identity-issuer
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kamalbuilds/refugee-identity-issuer
- Owner: kamalbuilds
- Created: 2024-11-07T07:38:57.000Z (7 days ago)
- Default Branch: main
- Last Pushed: 2024-11-07T07:53:26.000Z (7 days ago)
- Last Synced: 2024-11-07T08:34:24.626Z (7 days ago)
- Language: TypeScript
- Homepage: https://refugee-identity-issuer.vercel.app
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Refugee Identity Issuer (RII)
## Tagline
A decentralized solution for verifying and documenting refugee identities using blockchain technology and zero-knowledge proofs.## Demo Video
## Problem Statement
Undocumented refugees face significant challenges in proving their identity and status, which affects their access to essential services and humanitarian aid. Traditional identity verification systems are often:
- Centralized and vulnerable to data breaches
- Difficult to access in crisis situations
- Prone to document loss or destruction
- Lacking in privacy protection
- Not easily verifiable by multiple organizations## Solution
RII leverages blockchain technology, specifically Silk Wallet SDK and Zeronym, to create a secure, privacy-preserving identity verification system for refugees. The solution combines:
- Zero-knowledge proofs for privacy
- Soul-bound tokens (SBTs) for immutable verification
- Decentralized storage for documents
- Biometric verification
- Numbers Protocol for media authenticity## Features
### 1. Secure Identity Verification
- Multi-step verification process
- Biometric data collection
- Document validation
- Zero-knowledge proof generation### 2. Privacy Protection
- Core Privacy Features
### 1. Zero-Knowledge Proofs via Silk Wallet
- Allows refugees to prove their identity without revealing actual data
- Generates Soul-bound tokens (SBTs) that verify status without exposing personal information
- Implementation reference:```15:46:frontend/components/VerificationForm.tsx
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setStatus('loading')
try {
// Request KYC SBT
const sbtResult = await requestSBT('kyc')
if (sbtResult) {
// Verify refugee status with the API
const response = await fetch('/api/verify-refugee', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
address: userAddress,
...verificationData,
}),
})if (response.ok) {
setStatus('success')
} else {
throw new Error('Verification failed')
}
}
} catch (error) {
console.error('Verification error:', error)
setStatus('error')
}
}
```### 2. Decentralized Data Storage
- Personal data is encrypted and stored off-chain
- Documents are stored using Numbers Protocol with encryption
- Only cryptographic proofs are stored on-chain
- Reference:```19:54:frontend/services/numbersProtocol.ts
async captureMedia(file: File, metadata: {
refugeeId: string;
location: string;
description: string;
category: string;
}) {
// Create a capture with metadata and signatures
const capture = await this.captureLib.createCapture({
asset: file,
metadata: {
...metadata,
timestamp: Date.now(),
application: 'Refugee Identity Issuer',
captureType: 'REFUGEE_DOCUMENTATION'
}
});// Sign the capture
const signedCapture = await this.captureLib.sign(capture);// Store the capture on Web3.Storage
const cid = await this.storage.put([
new File([JSON.stringify(signedCapture)], 'capture.json')
]);// Register the capture on Numbers Protocol
const registration = await this.captureLib.register({
capture: signedCapture,
cid,
network: 'testnet' // or 'mainnet' for production
});return {
cid,
registration
};
```### 3. Biometric Data Protection
- Biometric data is never stored directly
- Only verification status is recorded
- Uses secure hash functions for biometric templates
- Reference:```9:13:frontend/app/types/index.ts
biometricData: {
fingerprint?: boolean;
faceId?: boolean;
irisScanned?: boolean;
};
```### 4. Selective Disclosure
Refugees can choose which information to share with different organizations:
- Basic identity verification
- Document verification status
- Biometric verification status
- Location history (optional)
- Medical records (if applicable)### 5. Access Control Mechanisms
- Role-based access control for verifiers
- Time-limited access tokens
- Audit trails for all data access
- Emergency access protocols### 6. Data Minimization
- Only essential data is collected
- Data is automatically archived or deleted after specified periods
- Verification events record minimal necessary information:```30:36:frontend/app/types/index.ts
export interface VerificationEvent {
timestamp: string;
type: 'document_upload' | 'biometric_capture' | 'verification_status_change';
status: 'success' | 'failure';
details: string;
verifiedBy?: string;
}
```### 7. Consent Management
- Explicit consent required for each data collection
- Granular control over data sharing
- Right to be forgotten implementation
- Clear documentation of data usage### 8. Technical Privacy Measures
- End-to-end encryption for all communications
- Secure key management
- Network-level privacy protections
- Regular privacy audits### 9. Compliance Features
- GDPR compliance tools
- UNHCR data protection guidelines
- International humanitarian law considerations
- Regular compliance updates### 10. Privacy-Preserving Verification
- Third-party verifiers can check status without accessing personal data
- Cryptographic proofs of verification
- Tamper-evident verification history
- Reference:```3:25:frontend/app/api/verify-refugee/route.ts
export async function POST(request: Request) {
try {
const body = await request.json()
const { address, name, location, refugeeId } = body// Here you would:
// 1. Verify the provided information
// 2. Check against existing refugee databases if available
// 3. Store the verification result
// 4. Issue a Zeronym SBT for the verified refugee// For demo purposes, we'll just return success
return NextResponse.json({
success: true,
message: 'Refugee status verified successfully'
})
} catch (error) {
return NextResponse.json(
{ success: false, message: 'Verification failed' },
{ status: 500 }
)
}
}
```## Best Practices Implementation
1. **Data Collection**
- Clear purpose specification
- Minimal data collection principle
- Secure data transmission
- Privacy-preserving storage2. **Data Processing**
- Processing only with consent
- Purpose limitation
- Data accuracy maintenance
- Processing security3. **Data Sharing**
- Controlled sharing mechanisms
- Audit trails
- Revocation capabilities
- Encrypted transmission4. **User Rights**
- Access to personal data
- Right to rectification
- Right to erasure
- Data portability### 3. Document Management
```19:28:frontend/app/types/index.ts
export interface DocumentInfo {
id: string;
type: 'passport' | 'id_card' | 'birth_certificate' | 'unhcr_document' | 'other';
documentNumber: string;
issueDate: string;
expiryDate?: string;
issuingCountry: string;
documentImage: string;
verificationStatus: 'pending' | 'verified' | 'rejected';
}
```### 4. Biometric Integration
```9:13:frontend/app/types/index.ts
biometricData: {
fingerprint?: boolean;
faceId?: boolean;
irisScanned?: boolean;
};
```### 5. Verification History
```30:36:frontend/app/types/index.ts
export interface VerificationEvent {
timestamp: string;
type: 'document_upload' | 'biometric_capture' | 'verification_status_change';
status: 'success' | 'failure';
details: string;
verifiedBy?: string;
}
```## How It Works
1. **Initial Connection**
- User connects using Silk Wallet
- Creates a privacy-preserving wallet
- Reference:```9:20:frontend/app/page.tsx
export default function Home() {
return (
Refugee Identity Verification
)
}
```2. **Verification Process**
- Personal Information Collection
- Document Upload and Verification
- Biometric Data Capture
- Final Review and Submission
Reference:```12:17:frontend/app/verification/page.tsx
const steps = [
{ id: 1, title: 'Personal Information' },
{ id: 2, title: 'Document Upload' },
{ id: 3, title: 'Biometric Verification' },
{ id: 4, title: 'Review & Submit' },
];
```3. **Backend Processing**
- Verification of submitted information
- Integration with refugee databases
- SBT issuance
Reference:```8:12:frontend/app/api/verify-refugee/route.ts
// Here you would:
// 1. Verify the provided information
// 2. Check against existing refugee databases if available
// 3. Store the verification result
// 4. Issue a Zeronym SBT for the verified refugee
```## Technical Stack
- Frontend: Next.js 13 with TypeScript
- Styling: Tailwind CSS
- Authentication: Silk Wallet SDK
- Identity Verification: Zeronym
- Media Authentication: Numbers Protocol
- Smart Contracts: EVM-compatible## Getting Started
1. Clone the repository
2. Install dependencies:
```bash
npm install
```3. Set up environment variables:
```env
NEXT_PUBLIC_NUMBERS_NETWORK_ID=
NEXT_PUBLIC_NUMBERS_PRIVATE_KEY=
NEXT_PUBLIC_WEB3_STORAGE_TOKEN=
```4. Run the development server:
```bash
npm run dev
```## Security Considerations
- All personal data is encrypted and stored off-chain
- Zero-knowledge proofs ensure privacy
- Biometric data is never stored directly
- Documents are stored in a decentralized manner
- All verifications are immutable and auditable## Future Enhancements
1. Multi-language Support
2. Offline Verification Capabilities
3. Integration with Additional Identity Providers
4. Enhanced Biometric Security Features
5. Mobile Application Development
6. Cross-border Verification Protocol
7. Emergency Access Procedures
8. Integration with Major Aid Organizations## Contributing
We welcome contributions! Please see our contributing guidelines for more details.
## License
MIT License - see LICENSE.md for details
## Support
For support, please open an issue in the GitHub repository or contact our support team.
This project is part of the broader initiative to provide digital identity solutions for displaced persons worldwide.