"Stripe for crypto payments β powered by Stellar."
Lumina is an open-source, global crypto payment infrastructure that lets businesses and developers accept payments in multiple cryptocurrencies, automatically convert them to stablecoins, settle instantly on the Stellar network, and withdraw to bank accounts.
- Overview
- Architecture
- Repository Structure
- Getting Started
- Smart Contracts (Soroban)
- Backend Services
- Monitoring & Observability
- Frontend
- Environment Variables
- Running Tests
- Contributing
- License
| Feature | Description |
|---|---|
| Payment Gateway | Accept BTC, ETH, USDC, XLM; auto-convert to USDC on Stellar |
| On-Ramp | Fiat β USDC via card or bank transfer |
| Off-Ramp | USDC β bank account |
| Escrow | Smart contract escrow for freelance/marketplace use cases |
| Payment Splits | Auto-split payments to multiple addresses |
| Subscriptions | Recurring billing on-chain |
| Merchant Dashboard | Analytics, balances, API keys, withdrawals |
| Developer API/SDK | REST API + JS/Python/Go SDKs |
All payments settle as USDC on the Stellar network via Soroban smart contracts.
Users / Customers
β
βΌ
Frontend (Next.js + TypeScript)
β REST / WebSocket
βΌ
Backend Gateway (NestJS)
β
βββ Payment Service β create, track, settle payments
βββ Ramp Service β fiat on/off ramp processing
βββ Conversion Engine β BTC/ETH β USDC conversion
βββ Blockchain Listener β watch Stellar transactions
βββ Notification Service β webhooks, email, alerts
β
βΌ
Stellar Network (Testnet β Mainnet)
β
βΌ
Soroban Smart Contracts
βββ payment_registry_contract
βββ merchant_vault_contract
βββ escrow_contract
βββ payment_split_contract
βββ subscription_contract
βββ fee_manager_contract
Lumina/
β
βββ contracts/ # Soroban smart contracts (Rust)
β βββ escrow_contract/
β β βββ src/
β β β βββ lib.rs
β β β βββ types.rs
β β β βββ storage.rs
β β β βββ logic.rs
β β βββ Cargo.toml
β βββ payment_split_contract/
β βββ subscription_contract/
β βββ merchant_vault_contract/
β βββ payment_registry_contract/
β βββ fee_manager_contract/
β
βββ backend/ # NestJS backend services
β βββ api_gateway/
β βββ payment_service/
β βββ ramp_service/
β βββ blockchain_listener/
β βββ conversion_engine/
β βββ notification_service/
β
βββ frontend/ # Next.js frontend
β βββ app/
β βββ components/
β βββ dashboard/
β βββ checkout/
β βββ hooks/
β βββ services/
β
βββ docs/ # Documentation
βββ .github/
β βββ ISSUE_TEMPLATE/
β βββ workflows/
βββ CONTRIBUTING.md
βββ README.md
| Tool | Version |
|---|---|
| Node.js | >= 18 |
| Rust | Latest stable |
| Soroban CLI | Latest |
| Docker | >= 20 |
| pnpm | >= 8 |
git clone https://github.com/StellarLumina/Lumina.git
cd Luminacd frontend
npm installcd backend
npm install# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install Soroban CLI
cargo install --locked soroban-cli
# Add the WASM target
rustup target add wasm32-unknown-unknowncp .env.example .env
# Fill in values β see Environment Variables section below# Start all services with Docker Compose
docker-compose up
# Or run individually
cd frontend && pnpm dev # http://localhost:3000
cd backend && pnpm start:dev # http://localhost:4000Each contract is a standalone Rust crate. They are modular β one contract, one responsibility.
| Contract | Purpose |
|---|---|
payment_registry_contract |
Ledger of all payment records |
merchant_vault_contract |
Holds and manages merchant funds |
escrow_contract |
Holds funds until conditions are met |
payment_split_contract |
Splits a payment across multiple parties |
subscription_contract |
Manages recurring billing |
fee_manager_contract |
Calculates and collects platform fees |
cd contracts/escrow_contract
cargo build --target wasm32-unknown-unknown --releasesoroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/escrow_contract.wasm \
--source <YOUR_SECRET_KEY> \
--rpc-url https://soroban-testnet.stellar.org \
--network-passphrase "Test SDF Network ; September 2015"cd contracts/escrow_contract
cargo testThe backend is a NestJS monorepo with independent services.
| Service | Port | Responsibility |
|---|---|---|
api_gateway |
4000 | Route requests, auth, rate limiting |
payment_service |
4001 | Payment creation and tracking |
ramp_service |
4002 | Fiat on/off ramp |
blockchain_listener |
4003 | Monitor Stellar transactions |
conversion_engine |
4004 | Crypto-to-USDC conversion |
notification_service |
4005 | Webhooks and email |
POST /api/payments β create a payment
GET /api/payments/:id β get payment status
POST /api/ramp/onramp β initiate on-ramp
POST /api/ramp/offramp β initiate off-ramp
POST /api/webhooks/register β register webhook URL
GET /api/merchants/balance β get merchant balance
The backend exposes Prometheus metrics at GET /metrics (HTTP request
rate/latency/errors, database query duration, external service call latency,
queue depth/throughput, and business metrics like payment volume and success
rate β see backend/src/common/metrics).
| Directory | Purpose |
|---|---|
prometheus/ |
Scrape config, retention, alerting rules |
grafana/ |
Auto-provisioned dashboards (system, API, database, queues, business) |
alertmanager/ |
Alert routing to Slack/email/PagerDuty, grouping, on-call escalation |
Start the whole stack, including monitoring, with docker-compose up, then
open:
| Tool | URL |
|---|---|
| Prometheus | http://localhost:9090 |
| Alertmanager | http://localhost:9093 |
| Grafana | http://localhost:3001 |
Before deploying anywhere shared, populate the alert notification secrets in
alertmanager/secrets/ (see alertmanager/README.md).
Built with Next.js 14 + TypeScript + Tailwind CSS.
| Route | Description |
|---|---|
/checkout/[id] |
Customer payment checkout page |
/dashboard |
Merchant overview and analytics |
/dashboard/payments |
Payment history |
/dashboard/withdrawals |
Withdrawal management |
/dashboard/api-keys |
API key management |
/dashboard/settings |
Merchant settings |
# Stellar
STELLAR_NETWORK=testnet
STELLAR_RPC_URL=https://soroban-testnet.stellar.org
STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
STELLAR_TREASURY_ADDRESS=
# Contracts
PAYMENT_REGISTRY_CONTRACT_ID=
MERCHANT_VAULT_CONTRACT_ID=
ESCROW_CONTRACT_ID=
PAYMENT_SPLIT_CONTRACT_ID=
SUBSCRIPTION_CONTRACT_ID=
FEE_MANAGER_CONTRACT_ID=
# Database
DATABASE_URL=postgresql://localhost:5432/Lumina
# Auth
JWT_SECRET=
API_KEY_SALT=
# Exchange / Conversion
EXCHANGE_API_KEY=
PRICE_ORACLE_URL=
# Notifications
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASS=
# App
NEXT_PUBLIC_API_URL=http://localhost:4000# Smart contract tests
cd contracts/escrow_contract && cargo test
# Backend unit tests
cd backend && pnpm test
# Backend e2e tests
cd backend && pnpm test:e2e
# Frontend tests
cd frontend && pnpm testWe welcome all contributors! Please read CONTRIBUTING.md before submitting a pull request.
Key areas where you can help:
- Soroban smart contracts (Rust)
- Backend API services (TypeScript / NestJS)
- Frontend UI components (React / Next.js)
- Documentation
- Testing
| Layer | Technology |
|---|---|
| Blockchain | Stellar + Soroban |
| Smart Contracts | Rust |
| Backend | NestJS (TypeScript) |
| Frontend | Next.js 14 (TypeScript) |
| Database | PostgreSQL |
| Cache | Redis |
| Queue | BullMQ |
| Styling | Tailwind CSS |
| Testing | Vitest, Jest, cargo test |
- Project scaffolding
- Payment registry contract
- Merchant vault contract
- Payment creation API
- Stellar blockchain listener
- Checkout UI
- Merchant dashboard (basic)
- Escrow contract
- Payment split contract
- On-ramp (card payments)
- Off-ramp (bank transfer)
- Subscription contract
- Multi-chain expansion
- Mobile apps
- Advanced fraud detection
MIT Β© Lumina Contributors