Production-ready cross-border remittance platform powered by Stellar Soroban smart contracts with zero-knowledge privacy
- $700B+ Remittance Market: Addresses Africa's cross-border payment challenges with avg fees of 8.2%
- 45+ African Countries: Serves underbanked populations with instant, affordable transfers
- Regulatory Compliance: Built-in KYC/AML with zero-knowledge privacy preservation
- Latest Soroban SDK (21.7.0): Leverages newest smart contract capabilities
- Zero-Knowledge Proofs: Uses Protocol X-Ray's BN254 curves and Groth16 verification
- Intelligent Pathfinding: Optimizes routes through Stellar DEX for best rates
- Anchor Integration: Seamless fiat on/off-ramps across African markets
- Security First: Comprehensive error handling, input validation, and access controls
- Scalable Design: Modular contract architecture supporting millions of transactions
- Developer Experience: Complete SDK, documentation, and deployment automation
- Open Source: Follows Stellar ecosystem best practices for community contribution
graph TB
subgraph "Frontend Layer"
UI[Next.js Frontend]
WALLET[Freighter Wallet]
end
subgraph "Stellar Network"
HORIZON[Horizon API]
SOROBAN[Soroban RPC]
end
subgraph "Smart Contracts"
REMIT[Remittance Contract]
COMP[Compliance Contract]
PATH[Pathfinder Contract]
ANCHOR[Anchor Registry]
end
subgraph "External Services"
KYC[KYC Providers]
ORACLES[Price Oracles]
ANCHORS[African Anchors]
end
UI --> WALLET
UI --> HORIZON
UI --> SOROBAN
SOROBAN --> REMIT
REMIT --> COMP
REMIT --> PATH
REMIT --> ANCHOR
COMP --> KYC
PATH --> ORACLES
ANCHOR --> ANCHORS
WALLET --> SOROBAN
- Private KYC: Prove compliance without revealing personal data
- Sanctions Screening: Verify clean status using zk-proofs
- Selective Disclosure: Share only necessary information per jurisdiction
- DEX Optimization: Finds best routes through Stellar's decentralized exchange
- Multi-Hop Trading: Automatic path discovery for optimal exchange rates
- Liquidity Aggregation: Combines multiple sources for better pricing
- 45+ Countries: Comprehensive coverage across African corridors
- Local Anchors: Integration with regional fiat on/off-ramps
- Mobile First: Optimized for African mobile internet conditions
- Regulatory Ready: Built-in compliance for different African jurisdictions
- Multi-Signature: Support for organizational treasury management
- Rate Limiting: Protection against high-frequency abuse
- Circuit Breakers: Automatic safety mechanisms for unusual activity
- Audit Trail: Complete transaction history and compliance reporting
# Required tools
- Node.js 18+ and npm/yarn
- Rust 1.70+ with wasm32 target
- Soroban CLI 21.0+
- Git
# Install Soroban CLI
cargo install --locked soroban-cli --features opt
# Add wasm32 target
rustup target add wasm32-unknown-unknown# Clone repository
git clone https://github.com/yourusername/afristar-pay-v2.git
cd afristar-pay-v2
# Install dependencies
npm install
cd frontend && npm install && cd ..# Deploy to Stellar Testnet (recommended for development)
./scripts/deploy.sh
# This will:
# β
Build all Soroban contracts
# β
Deploy to testnet
# β
Initialize with sample corridors
# β
Generate frontend .env file
# β
Run integration testscd frontend
npm run dev
# Open http://localhost:3000
# Connect Freighter wallet (testnet)
# Start sending remittances! πafristar-pay-v2/
βββ π¦ contracts/
β βββ remittance/ # Main remittance logic
β βββ compliance/ # Zero-knowledge KYC/AML
β βββ pathfinder/ # DEX route optimization
β βββ anchor-registry/ # Fiat gateway management
β
βββ βοΈ frontend/
β βββ src/app/ # Next.js 14 app router
β βββ src/components/ # React components
β βββ src/contexts/ # Stellar & wallet integration
β βββ src/hooks/ # Custom React hooks
β
βββ π οΈ scripts/
β βββ deploy.sh # Automated deployment
β βββ test.sh # Integration tests
β βββ setup-dev.sh # Development environment
β
βββ π docs/
β βββ API.md # Contract API reference
β βββ SECURITY.md # Security considerations
β βββ CONTRIBUTING.md # Development guidelines
β
βββ π README.md # This file
// Create new remittance transaction
pub fn create_remittance(
env: Env,
sender: Address,
recipient: Address,
send_asset: Address,
dest_asset: Address,
send_amount: i128,
min_dest_amount: i128,
corridor_id: String,
compliance_proof: Bytes,
) -> Result<RemittanceId, RemittanceError>
// Execute pending remittance
pub fn execute_remittance(
env: Env,
remittance_id: RemittanceId,
) -> Result<(), RemittanceError>
// Get remittance status
pub fn get_remittance(
env: Env,
remittance_id: RemittanceId,
) -> Result<RemittanceData, RemittanceError>// Verify zero-knowledge compliance proof
pub fn verify_compliance(
env: Env,
user_address: Address,
corridor_id: String,
zk_proof: ZkProofData,
) -> bool
// Submit KYC verification (for providers)
pub fn submit_kyc_verification(
env: Env,
user_address: Address,
kyc_level: u32,
risk_score: u32,
sanctions_clear: bool,
verifier: Address,
validity_period: u64,
)# Run Rust contract tests
cargo test
# Run frontend tests
cd frontend && npm test# Deploy to testnet and run full flow
./scripts/test.sh
# Tests include:
# β
Contract deployment
# β
Remittance creation
# β
Compliance verification
# β
Pathfinding optimization
# β
Frontend integration# Run security audit checks
cargo audit
# Static analysis
cargo clippy -- -D warnings
# Fuzzing (requires cargo-fuzz)
cargo install cargo-fuzz
cargo fuzz run remittance_fuzz| Corridor | Send Asset | Dest Asset | Avg Fee | Est Time |
|---|---|---|---|---|
| πΊπΈβπ³π¬ | USDC | NGN | 0.1% | 2-5 min |
| πΊπΈβπ¬π | USDC | GHS | 0.1% | 3-7 min |
| πΊπΈβπ°πͺ | USDC | KES | 0.1% | 2-5 min |
| πΊπΈβπΏπ¦ | USDC | ZAR | 0.1% | 2-5 min |
| πͺπΊβπ³π¬ | EURC | NGN | 0.15% | 3-8 min |
| π¬π§βπ¬π | GBPT | GHS | 0.15% | 5-10 min |
More corridors added regularly based on community demand
- β Reentrancy Protection: Safe external calls
- β Integer Overflow: Safe math operations
- β Access Controls: Role-based permissions
- β Input Validation: Comprehensive sanitization
- β Circuit Breakers: Automatic pausing mechanisms
- β Audit Trail: Complete event logging
- β Groth16 Proofs: Industry-standard zk-SNARKs
- β BN254 Curves: Soroban's native cryptographic primitives
- β Nullifier System: Prevents proof replay attacks
- β Selective Disclosure: Minimal data revelation
- β Circuit Auditing: Verified proof systems
- β CSP Headers: Content Security Policy
- β Input Sanitization: XSS prevention
- β Wallet Integration: Secure Freighter connection
- β Network Validation: Testnet/mainnet protection
- β Error Handling: No sensitive data leakage
- Stellar Network: 1000+ TPS capacity
- Contract Optimization: Gas-efficient operations
- Batch Processing: Multiple remittances per transaction
- Caching Layer: Reduced RPC calls
- Contract Deployment: ~1 XLM per contract
- Remittance Creation: ~0.001 XLM + platform fee
- Compliance Verification: ~0.0001 XLM
- Path Calculation: Free (off-chain computation)
- African Coverage: 45+ countries supported
- Anchor Network: 100+ integrated partners
- CDN Distribution: Sub-100ms frontend loading
- Mobile Optimization: Works on 3G networks
We welcome contributions to AfriStar Pay V2! This project is designed to be a high-quality example for the Stellar ecosystem.
# Fork and clone the repository
git clone https://github.com/yourusername/afristar-pay-v2.git
# Create development branch
git checkout -b feature/your-feature-name
# Setup development environment
./scripts/setup-dev.sh
# Make your changes and test
cargo test
cd frontend && npm test
# Submit pull request- β Code Quality: Follow Rust and TypeScript best practices
- β Testing: Add tests for all new functionality
- β Documentation: Update docs for API changes
- β Security: Consider security implications
- β Performance: Optimize for gas efficiency
- π§ New Corridors: Add support for additional African countries
- π Privacy Features: Enhance zero-knowledge implementations
- π± Mobile UX: Improve mobile user experience
- π Anchor Integration: Connect new fiat gateways
- π Analytics: Add transaction monitoring and reporting
- π‘οΈ Security: Audit and improve security measures
- Core Soroban contracts
- Zero-knowledge compliance framework
- Next.js frontend with Freighter integration
- Basic corridor support (Nigeria, Ghana, Kenya, South Africa)
- Comprehensive testing suite
- Advanced pathfinding algorithms
- Mobile native apps (React Native)
- Additional African corridors
- Enterprise multi-signature support
- Real-time transaction monitoring
- Mainnet deployment
- Institutional partnerships
- Regulatory compliance automation
- Cross-chain bridge integration
- AI-powered fraud detection
- Third-party API for developers
- White-label solutions for fintech
- Central bank digital currency (CBDC) support
- Merchant payment processing
- Decentralized governance (DAO)
This project is licensed under the MIT License - see the LICENSE file for details.
- Stellar Development Foundation - For the amazing Stellar network and Soroban platform
- African Fintech Community - For insights into real-world remittance challenges
- Zero-Knowledge Research - For advancing privacy-preserving technologies
- Open Source Contributors - For building the tools that make this possible
- Website: https://afristarpay.com
- Email: support@afristarpay.com
- Twitter: @AfriStarPay
- Discord: AfriStar Pay Community
- GitHub: Issues & Discussions
If you find AfriStar Pay V2 useful, please β star the repository to show your support!
Built with β€οΈ for Africa, powered by Stellar π