Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions bdk_demo/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# BDK-Dart Wallet (Flutter)

The _BDK-Dart Wallet_ is a wallet built as a reference app for the [bitcoindevkit](https://github.com/bitcoindevkit) on Flutter using [bdk-dart](https://github.com/bitcoindevkit/bdk-dart). This repository is not intended to produce a production-ready wallet, the app only works on Signet, Testnet 3, and Regtest.
The _BDK-Dart Wallet_ is a Flutter reference app for [bitcoindevkit](https://github.com/bitcoindevkit) using [bdk-dart](https://github.com/bitcoindevkit/bdk-dart). It is intentionally a demo and scaffold, not a production-ready wallet, and currently targets Signet, Testnet 3, and Regtest.

The demo app is built with the following goals in mind:
1. Be a reference application for the `bdk_dart` API on Flutter (iOS & Android).
2. Showcase the core features of the bitcoindevkit library: wallet creation, recovery, Esplora/Electrum sync, send, receive, and transaction history.
2. Sketch the wallet creation, recovery, sync, send, receive, and transaction-history flows the app can grow into over time.
3. Demonstrate a clean, testable Flutter architecture using Riverpod and GoRouter.

## Features
Expand All @@ -19,12 +19,14 @@ The demo app is built with the following goals in mind:
| Wallet balance (BTC / sats toggle) | - |
| Receive (address generation + QR) | - |
| Send (single recipient + fee rate) | - |
| Transaction history | - |
| Transaction history | Scaffolded placeholder UI |
| Transaction detail | - |
| Recovery data viewer | - |
| Theme toggle (light / dark) | - |
| In-app log viewer | - |

Today the active-wallet flow is deliberately small: it loads a wallet scaffold, shows placeholder wallet metadata, and renders placeholder transaction rows. No real wallet sync or transaction fetching is implemented yet.

## Architecture

Clean Architecture + Riverpod:
Expand All @@ -42,9 +44,9 @@ lib/
**Note:**
- **State management:** Riverpod
- **Navigation:** GoRouter
- **Domain objects:** Uses `bdk_dart` types directly
- **Secure storage:** `flutter_secure_storage` for mnemonics and descriptors
- **BDK threading:** `Isolate.run()` for heavy sync operations
- **Domain objects:** Uses app-local scaffold models with room to grow into fuller `bdk_dart` integrations
- **Secure storage:** Planned for mnemonic and descriptor handling as wallet flows land
- **Heavy sync work:** Planned to move off the UI isolate when real sync is added

## Getting Started

Expand Down
7 changes: 4 additions & 3 deletions bdk_demo/lib/core/router/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:go_router/go_router.dart';
import 'package:bdk_demo/features/shared/widgets/placeholder_page.dart';
import 'package:bdk_demo/features/wallet_setup/active_wallets_page.dart';
import 'package:bdk_demo/features/wallet_setup/transaction_detail_page.dart';
import 'package:bdk_demo/features/wallet_setup/wallet_choice_page.dart';

abstract final class AppRoutes {
Expand Down Expand Up @@ -30,8 +32,7 @@ GoRouter createRouter() => GoRouter(
GoRoute(
path: AppRoutes.activeWallets,
name: 'activeWallets',
builder: (context, state) =>
const PlaceholderPage(title: 'Active Wallets'),
builder: (context, state) => const ActiveWalletsPage(),
),
GoRoute(
path: AppRoutes.createWallet,
Expand Down Expand Up @@ -72,7 +73,7 @@ GoRouter createRouter() => GoRouter(
name: 'transactionDetail',
builder: (context, state) {
final txid = state.pathParameters['txid'] ?? '';
return PlaceholderPage(title: 'Transaction $txid');
return TransactionDetailPage(txid: txid);
},
),

Expand Down
4 changes: 2 additions & 2 deletions bdk_demo/lib/core/utils/formatters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ abstract final class Formatters {
return '$month ${dt.day} ${dt.year} $hour:$minute';
}

static String abbreviateTxid(String txid) => txid.length > 16
? '${txid.substring(0, 8)}...${txid.substring(txid.length - 8)}'
static String abbreviateTxid(String txid) => txid.length > 10
? '${txid.substring(0, 6)}...${txid.substring(txid.length - 4)}'
: txid;
}

Expand Down
Loading
Loading