VeloPay is a fully-fledged blockchain-based payment system built on Substrate, enabling secure digital payments with fiat on/off ramp capabilities through mint and burn operations.
- Peer-to-Peer Transfers: Send and receive VCS instantly
- Transaction History: Complete audit trail of all transactions
- Multi-signature Support: Enhanced security for high-value transactions
- Mint Operations: Convert fiat to VCS through verified bank transfers
- Burn Operations: Convert VCS back to fiat currency
- Compliance Framework: Built-in KYC/AML verification system
- KYC Verification: Identity verification for regulatory compliance
- Admin Controls: Centralized oversight for mint/burn approvals
- JWT Authentication: Secure API access with coin-based auth
- Rate Limiting: DDoS protection and abuse prevention
- Substrate Framework: Built on Polkadot's battle-tested blockchain framework
- RESTful API: Comprehensive HTTP API for easy integration
- PostgreSQL Database: Robust data persistence layer
- Real-time Updates: WebSocket support for live transaction monitoring
velopay/
βββ velo-chain/ # Substrate blockchain node
β βββ pallets/
β β βββ velopay/ # VeloPay pallet (core logic)
β βββ runtime/ # Chain runtime configuration
β βββ node/ # Node implementation
β
βββ velopay-api/ # REST API Gateway (Actix-web + Rust)
β βββ src/
β β βββ chain/ # Blockchain client integration
β β βββ db/ # Database repositories
β β βββ middleware/ # Auth & admin middleware
β β βββ models/ # Data models
β β βββ routes/ # API endpoints
β β βββ services/ # Business logic
β βββ migrations/ # Database migrations
β
βββ velopay-web/ # Frontend (SvelteKit)
βββ src/
β βββ lib/ # Shared components & utilities
β βββ routes/ # Application pages
βββ static/ # Static assets
- Framework: Substrate 4.0
- Language: Rust
- Consensus: Aura (Block Production) + GRANDPA (Finality)
- Runtime: Custom VeloPay pallet with mint/burn logic
- Framework: Actix-web 4.x
- Language: Rust
- Database: PostgreSQL 16
- Authentication: JWT (jsonwebcoin)
- Rate Limiting: Governor middleware
- Client: Subxt for blockchain interaction
- Framework: SvelteKit
- Language: TypeScript
- Styling: TailwindCSS
- Build Tool: Vite
- State Management: Svelte stores
- Operating System: Windows 10/11, Linux, or macOS
- RAM: Minimum 8GB (16GB recommended)
- Disk Space: 20GB+ for blockchain data
- Rust: 1.70 or higher
- Node.js: 18.x or higher
- PostgreSQL: 14.x or higher
- Git: Latest version
- Cargo: Rust package manager (comes with Rust)
- npm/pnpm: Node package manager
- psql: PostgreSQL client
git clone https://github.com/ChronoCoders/velopay.git
cd velopaycd velo-chain
# Build the node (first time only)
cargo build --release
# Start Alice node (development)
./target/release/velo-chain --dev --tmpAlternative: Use provided batch scripts:
# Windows
start-local.bat
# Linux/Mac
./start-local.sh# Create database
psql -U postgres
CREATE DATABASE velopay_db;
CREATE USER velopay_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE velopay_db TO velopay_user;
\q
# Run migrations
cd velopay-api
sqlx migrate runCreate .env file in velopay-api/:
# Database
DATABASE_URL=postgresql://velopay_user:your_password@localhost:5432/velopay_db
# Server
HOST=127.0.0.1
PORT=8080
# JWT
JWT_SECRET=your-super-secret-jwt-key-min-48-chars
JWT_EXPIRATION=86400
# Admin
ADMIN_API_KEY=your-admin-api-key
ADMIN_SEED=//Alice
# Chain
CHAIN_ENDPOINT=ws://127.0.0.1:9944
# CORS
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000cd velopay-api
cargo run --releaseAPI will be available at: http://localhost:8080
cd velopay-web
npm install
npm run devFrontend will be available at: http://localhost:5173
POST /api/v1/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "SecurePass123!",
"wallet_address": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
}POST /api/v1/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "SecurePass123!"
}POST /api/v1/payments
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"from_address": "5GrwvaEF...",
"to_address": "5FHneW46...",
"amount": "100.50"
}GET /api/v1/payments/history/{wallet_address}?limit=10&offset=0
Authorization: Bearer <JWT_TOKEN>POST /api/v1/mint
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"wallet_address": "5GrwvaEF...",
"amount": "1000.00",
"bank_reference": "BANK-REF-12345"
}POST /api/v1/burn
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"wallet_address": "5GrwvaEF...",
"amount": "500.00",
"bank_account": "TR330006100519786457841326"
}POST /api/v1/kyc
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"document_hash": "0xabcdef1234567890",
"full_name": "John Doe",
"date_of_birth": "1990-01-01",
"country": "US",
"wallet_address": "5GrwvaEF..."
}GET /admin/v1/mint/pending
X-Admin-API-Key: <ADMIN_API_KEY>POST /admin/v1/mint/{request_id}/approve
X-Admin-API-Key: <ADMIN_API_KEY>
Content-Type: application/json
{
"admin_id": "uuid-here",
"chain_request_id": 0
}cd velopay-api
# Run test suite
test-api.bat
# Or manually test endpoints
curl http://localhost:8080/healthcd velo-chain
cargo test --releasecd velopay-web
npm run testUser β Frontend (SvelteKit) β API Gateway (Actix) β PostgreSQL
β
Blockchain Node (Substrate)
- VeloPay Pallet: Core blockchain logic for coin operations
- API Gateway: RESTful interface for user interactions
- Database: Off-chain data persistence for fast queries
- Frontend: User-friendly web interface
- JWT Authentication: Secure API access
- Admin API Keys: Privileged operations require admin key
- Rate Limiting: Protection against abuse
- KYC/AML: Regulatory compliance built-in
Edit velo-chain/node/src/chain_spec.rs:
- Genesis accounts
- Initial balances
- Validator set
All configuration via .env file:
- Database connection
- JWT settings
- CORS policies
- Rate limits
Edit velopay-web/svelte.config.js:
- API endpoint URLs
- Build settings
- Adapters
- Use Strong Secrets: Generate secure keys for production
- Enable HTTPS: Use SSL certificates for API and frontend
- Database Backups: Regular PostgreSQL backups
- Monitoring: Set up logging and alerts
- Rate Limiting: Adjust based on expected load
docker-compose up -dWe welcome contributions! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Substrate/Polkadot: For the amazing blockchain framework
- Actix-web: For the performant Rust web framework
- SvelteKit: For the elegant frontend framework
- Issues: GitHub Issues
- Email: support@velopay.com
- Telegram: @velopay_community
- Core blockchain functionality
- REST API implementation
- Database integration
- Authentication system
- Admin panel endpoints
- Frontend UI completion
- Mobile application
- Multi-chain support
- Staking mechanism
- Governance module
Built with β€οΈ by ChronoCoders Team