Backend service for Coretilla – the Bitcoin Neobank, built with NestJS.
This backend powers Coretilla's features, including wallet creation, gasless BTC transactions, staking, lending, borrowing, and portfolio tracking.
🔗 Swagger API Docs: https://core-backend-production-0965.up.railway.app/api#/
Coretilla Backend provides RESTful APIs for the Coretilla Neobank platform.
It handles:
- Authentication (Wallet signature, Account Abstraction)
- User management
- Payments & deposits
- Finance operations (buy BTC, stake, lending, borrowing)
- Transaction history
Built for CoreDAO Testnet 2 and fully integrated with our smart contracts.
- Wallet Auth – Sign in using wallet signature
- Account Abstraction – Gmail-based wallet creation
- Gasless Payments – No gas fees for deposits & BTC swaps
- Stripe Integration – USD deposits directly into Bitcoin
- Bitcoin DeFi Tools – Staking, lending, borrowing
- User Dashboard API – Profile & portfolio tracking
git clone https://github.com/coretilla/backend-coretilla.git
cd backend-coretilla
pnpm install
pnpm run start
pnpm run start:dev
pnpm run start:prod
# Unit tests
pnpm run test
# E2E tests
pnpm run test:e2e
# Coverage
pnpm run test:cov
GET /auth
– Health check for auth serviceGET /auth/nonce
– Generate nonce for wallet authenticationPOST /auth/signin
– Sign in with wallet signature
GET /users/me
– Get current user profilePATCH /users/me
– Update profileGET /users/me/transactions
– Get transaction history
POST /payments/deposits
– Create new depositGET /payments/deposits
– Get user depositsPOST /payments/deposits/confirm
– Confirm depositGET /payments/deposits/{id}
– Get deposit by ID
GET /finance/btc-price
– Get current BTC pricePOST /finance/swap
– Swap USD to BTC (gasless)GET /finance/stake-history
– Get staking historyGET /finance/collateral-deposit-history
– Get collateral deposit historyGET /finance/loan-history
– Get loan history
📌 Full API documentation available on Swagger:
https://core-backend-production-0965.up.railway.app/api#/
- Future Scalability Notes - Reminder notes for performance and scalability improvements
- Stripe Deposit System - Frontend implementation guide for payments
Important: To improve query performance and reduce RPC load, consider implementing a blockchain indexer. Expected improvement: 80-90% faster (from 2-5 seconds to 200-500ms).
Current Limitation: Synchronous processing limits throughput to ~10 swaps/minute
Suggested Improvement: Async processing with job queues, multiple price sources, and batch processing. Expected improvement: 50x throughput (500+ swaps/minute).
See Future Scalability Notes for full details.
MIT License – You are free to use, modify, and distribute this code.