A cross-platform desktop wallet application for the BSV Blockchain, built with Electron and Vite. BSV Desktop provides a complete wallet interface with support for both self-custody (local) and remote storage options.
The default configuration is for locally stored transactions and metadata, entirely self custody.
Note: This project was migrated from Tauri to Electron to enable local database storage. See PORTED.md for the full migration story.
BSV Desktop is a feature-rich Bitcoin SV wallet that runs on macOS, Windows, and Linux. It provides:
- 🔐 Self-Custody Mode - Full control with local key management and SQLite storage
- ☁️ Remote Storage Mode - WAB (Wallet Authentication Backend) integration with remote storage
- 🌐 BRC-100 Interface - HTTPS server on port 2121 for external app integration
- 📱 Identity Certificates - BRC-64/65 certificate management
- 💸 Payment Protocol - BRC-29 payment support
- 🎯 Overlay Services - App permissions, baskets, protocols, counterparties
- 🔄 Background Monitoring - Automatic transaction and proof updates
- 💾 Flexible Storage - Choose between local SQLite or remote storage providers
BSV Desktop consists of three main components:
Reusable React components and wallet logic:
WalletContext.tsx- Wallet state management and initializationUserInterface.tsx- Main router and permission handlers- Permission handlers for baskets, certificates, protocols, spending
- Dashboard pages for apps, identity, trust, settings
Native functionality and backend services:
main.ts- Window management, IPC handlershttpServer.ts- BRC-100 HTTPS server on port 2121storage.ts- SQLite storage manager with IPC proxymonitor-worker.ts- Background monitoring process
Application entry point that uses the UI library:
main.tsx- React app entry, wallet initializationonWalletReady.ts- HTTP request handler for BRC-100 interfaceelectronFunctions.ts- Native handlers (focus, downloads, dialogs)
- Node.js 18+ and npm
- Git
git clone https://github.com/bsv-blockchain/bsv-desktop.git
cd bsv-desktop
npm installRun the app in development mode with hot reload:
npm run devThis will:
- Start Vite dev server on port 5173
- Compile TypeScript for Electron backend
- Launch Electron with DevTools open
- Enable hot module replacement for React code
Dev Mode Features:
- Automatic recompilation on file changes
- React DevTools enabled
- Console logs from both main and renderer processes
- HTTPS server running on
https://localhost:2121
Build the application for production:
npm run buildThis runs:
npm run build:renderer- Vite build →dist/npm run build:electron- TypeScript build →dist-electron/
Package the app for distribution:
# Build for current platform
npm run package
# Platform-specific builds
npm run package:mac # macOS (DMG + ZIP)
npm run package:win # Windows (NSIS + Portable)
npm run package:linux # Linux (AppImage + DEB)Built packages will be in the release/ directory with versioned filenames.
bsv-desktop/
├── src/lib/ # React UI library (reusable)
│ ├── WalletContext.tsx # Wallet state and initialization
│ ├── UserContext.tsx # App metadata and native handlers
│ ├── components/ # Reusable components
│ │ ├── WalletConfig.tsx # WAB/storage configuration
│ │ ├── AmountDisplay.tsx # Currency display with rates
│ │ └── *Handler.tsx # Permission request modals
│ ├── pages/ # Dashboard pages
│ │ ├── Dashboard/ # Main dashboard and settings
│ │ └── Recovery/ # Password/phone recovery
│ └── navigation/ # Menu and routing
│
├── src/ # Electron app entry
│ ├── main.tsx # React app initialization
│ ├── onWalletReady.ts # BRC-100 HTTPS handler
│ ├── electronFunctions.ts # Native handlers (focus, downloads, dialogs)
│ └── StorageElectronIPC.ts # IPC storage proxy
│
├── electron/ # Electron backend
│ ├── main.ts # Main process, window lifecycle
│ ├── httpServer.ts # Express server (port 2121)
│ ├── storage.ts # Storage manager + IPC handlers
│ ├── monitor-worker.ts # Background monitoring process
│ ├── preload.ts # IPC bridge (context isolation)
│ └── storage-loader.cjs # Lazy-load better-sqlite3
│
├── dist/ # Vite build output
├── dist-electron/ # TypeScript build output
├── release/ # Packaged apps
│
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript config (renderer)
├── tsconfig.electron.json # TypeScript config (main)
├── vite.config.ts # Vite build config
└── electron-builder.json5 # Packaging config
Users can configure at runtime via the WalletConfig component:
- Authentication: WAB or self-custody (default: self-custody)
- Network: Mainnet or testnet
- Storage: Remote (StorageClient) or local (SQLite)
- Message Box: Enable/disable message box integration
Configuration is persisted in Version 3 snapshots (localStorage + encrypted).
- Database: SQLite via better-sqlite3 + Knex
- Location:
~/.bsv-desktop/wallet.db(mainnet) orwallet-test.db(testnet) - Features: Full offline mode, no external dependencies
- Architecture: IPC proxy from renderer → main → StorageKnex
- Provider: StorageClient (HTTP-based)
- Server: User-configured URL (e.g.,
https://storage.babbage.systems) - Features: Cloud backup, multi-device sync
- Authentication: WAB (Wallet Authentication Backend) with phone/DevConsole verification
BSV Desktop runs a separate Monitor worker process that:
- Monitors for new transactions
- Updates merkle proofs
- Tracks UTXO state changes
- Syncs certificates and outputs
Implementation:
electron/monitor-worker.ts- Separate Node.js process- SQLite WAL mode enables concurrent access
- Automatic start on wallet initialization
- Graceful shutdown on app exit
External apps can connect to the wallet via HTTPS on port 2121:
Endpoints:
POST /createAction- Create and broadcast transactionsPOST /createHmac- Generate HMAC signaturesPOST /createCertificate- Create identity certificatesGET /isAuthenticated- Check wallet authentication status- And all other BRC-100 interface methods
CORS: Enabled for all origins in dev mode
Testing:
curl https://127.0.0.1:2121/isAuthenticatedWe welcome contributions! Here's how to get started:
- Fork and clone the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make changes and test with
npm run dev - Build:
npm run buildto ensure compilation succeeds - Test packaging:
npm run packageto verify build output - Commit: Use clear commit messages
- Push and create PR: Describe changes and test coverage
- UI components go in
src/lib/components/ - Pages go in
src/lib/pages/ - Electron backend changes go in
electron/ - Shared types go in
src/lib/types/orsrc/global.d.ts
Currently no automated tests. Manual testing checklist:
- App launches and shows login screen
- WAB authentication works (with real WAB server)
- Self-custody mode works (local database)
- Balance displays correctly
- Sending transactions works
- HTTPS server responds on port 2121
- App packages without errors
Main Process (Electron backend):
# Logs appear in terminal where `npm run dev` runs
console.log('[Main]', 'Debug message')Renderer Process (React UI):
# Open DevTools (auto-opens in dev mode)
# Cmd+Option+I (macOS) or Ctrl+Shift+I (Windows/Linux)
console.log('[Renderer]', 'Debug message')HTTP Server:
# Test endpoints
curl -X POST https://127.0.0.1:2121/isAuthenticatedEdit package.json:
{
"version": "0.7.0"
}git add package.json
git commit -m "Bump version to 0.7.0"
git tag v0.7.0
git push origin master --tags# Build for all platforms (requires platform-specific machines)
npm run package:mac
npm run package:win
npm run package:linux
# Or build for current platform only
npm run package- Go to GitHub Releases
- Click "Draft a new release"
- Select tag
v0.7.0 - Upload files from
release/directory:BSV-Desktop-0.7.0.dmg(macOS)BSV-Desktop-0.7.0-mac.zip(macOS)BSV-Desktop-Setup-0.7.0.exe(Windows)BSV-Desktop-0.7.0.AppImage(Linux)bsv-desktop_0.7.0_amd64.deb(Linux)
- Write release notes highlighting changes
- Click "Publish release"
Update README.md, PORTED.md, or CHANGELOG.md as needed.
@bsv/wallet-toolbox- Wallet managers, storage, permissions@bsv/sdk- BSV blockchain primitives@bsv/message-box-client- Message box integration@bsv/uhrp-react- UHRP protocol support
electron- Desktop frameworkexpress- HTTP serverbetter-sqlite3- SQLite databaseknex- SQL query builder
react+react-dom- UI framework@mui/material+@emotion- Material-UI componentsreact-router-dom- Routing (v5)react-toastify- Toast notifications
Open BSV License
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See PORTED.md for architecture details
- wallet-toolbox - Core wallet functionality
- ts-sdk - BSV TypeScript SDK
- overlay-services - Overlay network infrastructure