Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f1a93ba
Merge branch 'dev'
JJ12880 Sep 23, 2025
33f8cb1
Qt: Add dark theme system and modernize overview dashboard
kirklandsig Feb 26, 2026
e58fb97
Qt: Complete Phase 2 visual overhaul, sidebar nav, and security fixes
kirklandsig Feb 26, 2026
d56cba3
Qt: Phase 3 dashboard layout improvements and comprehensive UI polish
kirklandsig Feb 26, 2026
7fa0c03
Qt: Add Backup Wizard and Network Peer Map visualization
kirklandsig Feb 26, 2026
5a1cadf
Qt: Enhance system tray and notifications for better UX
kirklandsig Feb 26, 2026
e1d02be
Qt: Comprehensive dark theme polish for all pages and branding fixes
kirklandsig Feb 26, 2026
ad42fc5
docs: Add codebase upgrade research reports for JJ
kirklandsig Feb 26, 2026
ad748a8
Qt: Complete Bitcoin -> Validity branding across all UI strings
kirklandsig Feb 26, 2026
0540963
Qt: Complete Bitcoin -> Validity branding in all UI form files
kirklandsig Feb 26, 2026
c5fad79
Qt: Add light theme, drag-drop card reordering, and update handoff docs
kirklandsig Feb 26, 2026
cabcfa8
Qt: Draggable/resizable cards, fix dark theme nav icons, include exe
kirklandsig Feb 26, 2026
0089c31
Remove exe from git tree (will use GitHub Releases instead)
kirklandsig Feb 26, 2026
94d2074
Qt: Splitter grid layout, fix all icons (menus + toolbar)
kirklandsig Feb 26, 2026
552058f
Qt: Performance optimizations — QSS dedup, chart caching, list speedup
kirklandsig Feb 26, 2026
097d974
Qt: Defer initial stats load so UI renders instantly
kirklandsig Feb 26, 2026
d3ff74b
Qt: 2-column drag-and-drop dashboard grid with cache validation
kirklandsig Feb 26, 2026
c753ab5
Qt: Security audit fixes, peer map IPv6 support, splash copyright
kirklandsig Feb 26, 2026
aae2ecb
Qt: Lazy page construction for faster splash-to-dashboard
kirklandsig Feb 26, 2026
0d100e2
Qt: Fix startup performance — deferred transaction model loading
kirklandsig Feb 26, 2026
1585842
Qt: Defer ALL transaction model creation for instant dashboard
kirklandsig Feb 26, 2026
477d01e
Qt: Background thread transaction loading for 36K+ tx wallets
kirklandsig Feb 27, 2026
7d6b417
Qt: Fix lock contention — chunked bg loading + non-blocking UI locks
kirklandsig Feb 27, 2026
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
137 changes: 137 additions & 0 deletions HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Validity Wallet - Agent Handoff Document

**Last Updated:** 2026-02-26 (All phases complete)
**Author:** Claude Code (Opus 4.6)
**Project:** Validity PoS Cryptocurrency Wallet (Qt5/C++11, forked from Bitcoin Core 0.13.2)
**Repo:** https://github.com/kirklandsig/Validity (fork of RadiumCore/Validity)
**PR:** https://github.com/RadiumCore/Validity/pull/11 (OPEN)
**Branch:** `feature/dark-theme-dashboard`
**Hard Constraint:** NO consensus/blockchain changes. UI/client-side ONLY. Zero fork risk.

---

## Current Status: All Phases Complete

**Build status:** PASSING (all changes compiled successfully)
**Binary:** `~/Validity-build/src/qt/validity-qt.exe`

### Git History (most recent first)
1. (pending) — Light theme + drag-drop card reordering + branding completion
2. `054096399` — Complete Bitcoin -> Validity branding in all UI form files
3. `ad748a8c9` — Complete Bitcoin -> Validity branding across all UI strings
4. `ad42fc5e9` — Research reports for JJ (codebase upgrade feasibility)
5. `e1d02be82` — Comprehensive dark theme polish (526 lines QSS) + branding fixes
6. `5a1cadf4e` — System tray enhancements + notification improvements
7. `7fa0c0308` — Backup Wizard + Network Peer Map visualization
8. `d56cba331` — Phase 3 dashboard layout + UI polish
9. `e58fb9734` — Phase 2 visual overhaul, sidebar nav, security fixes
10. `33f8cb1c0` — Phase 1 dark theme system + overview dashboard

All pushed to `origin/feature/dark-theme-dashboard`.

---

## What Was Done

### Phase 1 (Committed: 33f8cb1c0)
- Dark theme system (ThemeManager) with Dark/Light toggle
- Card-based dashboard redesign (Balance, Staking Chart, Network, Transactions)
- 30-day staking rewards chart (custom QPainter bar chart)
- QSS theme files (dark.qss, light.qss)
- Build system updates (Makefile.qt.include, bitcoin.qrc)

### Phase 2 (Committed: e58fb9734)
- Full visual overhaul: sidebar navigation, splash screen, modal overlay
- Deep navy/purple gradients matching validitytech.com
- Security: CExtKey buffer overflow fix, AskPassphraseDialog fall-through fix
- 18 files modified total

### Phase 3 (Committed: d56cba331)
- Staking chart summary: 8-column layout with pipe separators
- Layout swap: Transactions full-width middle, Network compact bottom
- NUM_ITEMS 5->7, division-by-zero guards, pwalletMain null check
- Removed ~860 lines of hardcoded palette XML from sendcoinsentry.ui
- Fee warning color fix for dark theme readability

### Phase 4 Features (Committed: 7fa0c0308)
- **Backup Wizard**: QDialog + QStackedWidget, 4 pages, File > Backup Wizard
- New files: `backupwizard.h`, `backupwizard.cpp`
- **Network Peer Map**: Custom QPainter world map, peer dots by latency, hover tooltips
- New files: `peermapwidget.h`, `peermapwidget.cpp`, `geoip.h`, `geoip.cpp`
- New tab "Peer Map" in RPC Console

### Tray + Notifications (Committed: 5a1cadf4e)
- Expanded tray menu: Overview, Transactions, Backup Wizard, Lock/Unlock
- Staking reward notifications with "Staking Reward!" title
- Richer tray tooltip: weight, network weight, connections
- Branding: "Bitcoin network" -> "Validity network"

### Comprehensive UI Polish (Committed: e1d02be82)
- 526 new lines of QSS covering all remaining pages
- Send/Receive: fee section, coin control, buttons, validation states
- Transaction history: filter bar, table hover/select, context menu
- Address book: button styling, table hover effects
- Coin control dialog: tree widget, checkboxes, select all button
- Options dialog: tab pane, theme combo, status label
- Global: disabled states, focus indicators, tooltip styling, slider
- Fixed "Invalid Bitcoin address" -> "Invalid Validity address"
- Fixed Windows startup shortcut names: Bitcoin -> Validity

### Complete Branding Cleanup (Committed: ad748a8c9, 054096399)
- All user-facing "Bitcoin" references replaced with "Validity" across:
- 6 .cpp files: addressbookpage, bitcoin, bitcoingui, editaddressdialog, guiutil, paymentserver
- 6 .ui files: optionsdialog, overviewpage, intro, receivecoinsdialog, sendcoinsentry, signverifymessagedialog
- IPC server name: "BitcoinQt" -> "ValidityQt"
- Windows startup shortcuts: "Bitcoin.lnk" -> "Validity.lnk"

### Light Theme + Drag-Drop Card Reordering (Latest)
- **Light theme** complete rewrite: 51 lines -> 700+ lines matching dark theme coverage
- Palette: white (#ffffff), surface (#f0f2f5), green (#2d8f5e), danger (#d04040)
- Covers all pages: cards, sidebar, tabs, tables, dialogs, scrollbars, inputs
- **Drag-and-drop card reordering**: Event filter approach for dashboard cards
- New files: `carddragdrop.h`, `carddragdrop.cpp`
- Registered cards: transactionsCard, networkCard (top row fixed at top)
- Drop indicator, QSettings persistence ("OverviewCardOrder"), order restore on startup

---

## Architecture Notes

### Key Files
- `src/qt/bitcoingui.cpp` — Main window, toolbar, menu. ThemeManager lives here.
- `src/qt/overviewpage.cpp` — Dashboard. StakingChartWidget + CardDragDropManager live here.
- `src/qt/thememanager.cpp` — Loads QSS from resources, applies via `qApp->setStyleSheet()`.
- `src/qt/stakingchartwidget.cpp` — Custom QPainter widget. 30 bars with hover.
- `src/qt/carddragdrop.cpp` — Event filter drag-drop reordering for dashboard cards.
- `src/qt/backupwizard.cpp` — Backup wizard dialog (QDialog + QStackedWidget).
- `src/qt/peermapwidget.cpp` — Peer map world visualization.
- `src/qt/geoip.cpp` — IP-to-coordinate lookup via first-octet heuristic.
- `src/qt/res/themes/dark.qss` — 1500+ lines of comprehensive dark theme styling.
- `src/qt/res/themes/light.qss` — 700+ lines comprehensive light theme.

### Build Workflow
1. Edit files on Windows: `C:\Users\yanal\OneDrive\Desktop\Claude\Projects\Validity\`
2. Sync: `cp ... && dos2unix ...` (or use sync_to_wsl.sh for batch)
3. Build: `cd ~/Validity-build && PATH=/usr/local/sbin:...:/bin make -j$(nproc)`
4. Binary: `src/qt/validity-qt.exe`

### WSL Build Environment
- WSL2 Ubuntu on Windows 11
- Build directory: `~/Validity-build/` (native Linux filesystem)
- Windows source: `/mnt/c/Users/yanal/OneDrive/Desktop/Claude/Projects/Validity/`

---

## Remaining Work

All major features and polish items are complete. Potential future work:
- Test on live network with real wallet
- Additional icon/graphic updates if validitytech.com branding changes
- Accessibility improvements (screen reader, high contrast)
- Translations update (qt/locale/ files still reference Bitcoin in some strings)

### JJ's Research Request: Codebase Upgrade
Research completed via 3 agents. Full reports saved in `docs/plans/`:
- `2026-02-26-bitcoin-core-port-feasibility.md` — Bitcoin Core 30.0 direct port (12-24 months, extreme risk)
- `2026-02-26-blackcoin-rebase-feasibility.md` — **RECOMMENDED:** BlackCoin More 26.x rebase (1-3 months)
- `2026-02-26-pos-consensus-inventory.md` — Complete PoS consensus code inventory (~1,670 lines across 12 files)
46 changes: 46 additions & 0 deletions docs/plans/2026-02-25-dark-theme-dashboard-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Validity Wallet: Dark Theme + Dashboard Modernization

**Date:** 2026-02-25
**Status:** Approved
**Constraint:** No consensus/fork changes — UI/UX only

## Theme System

ThemeManager class loads QSS stylesheets at runtime. Two themes: Light (preserves current) and Dark (new). Preference persisted via QSettings. Toggle in Options dialog.

### Dark Palette (Validity-branded)
- Background: #1e1e2e
- Card/Surface: #2a2a3d
- Card Border: #3a3a4d
- Primary Accent: #43b581 (existing Validity green)
- Text Primary: #e0e0e0
- Text Secondary: #a0a0b0
- Negative: #e05555
- Warning: #f0b060

## Dashboard Cards (Overview Page)

Replace flat grid with 4 cards:
1. **Balance Card** (top-left) — Available, Pending, Immature, Stake, Total
2. **Staking Rewards Card** (top-right) — 30-day bar chart + summary stats
3. **Network Stats Card** (bottom-left) — Supply, network weight, your weight %, daily reward
4. **Recent Transactions Card** (bottom-right) — Last 5 transactions

## Staking Chart Widget

Custom QPainter widget: 30 vertical bars (one per day), x-axis dates, y-axis amounts. Uses PrepareRangeForStakeReport() data. Validity green bars, hover tooltips.

## New Files
- src/qt/res/themes/dark.qss
- src/qt/res/themes/light.qss
- src/qt/thememanager.h/.cpp
- src/qt/stakingchartwidget.h/.cpp

## Modified Files
- src/qt/forms/overviewpage.ui
- src/qt/overviewpage.cpp/.h
- src/qt/bitcoingui.cpp/.h
- src/qt/optionsdialog.cpp/.ui
- src/qt/guiconstants.h
- src/qt/bitcoin.qrc
- src/qt/Makefile.qt.include
151 changes: 151 additions & 0 deletions docs/plans/2026-02-26-bitcoin-core-port-feasibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Feasibility Study: Porting Validity (Bitcoin Core 0.13.2 Fork) to Latest Bitcoin Core

> **Research conducted by:** Claude Code (Opus 4.6) — February 26, 2026
> **Conclusion:** Technically feasible but represents 12-24 months of work with 2-3 experienced C++ developers. Not recommended as primary path.

---

## 1. Current State of Bitcoin Core

**Latest version: Bitcoin Core 30.0** (released late October 2025, with patches 30.1 and 30.2). This represents approximately **9 years and 18+ major releases** since Bitcoin Core 0.13.2 (January 2017).

Version numbering changed: 0.13 -> 0.14 -> ... -> 0.21 -> 22.0 (dropped leading zero) -> 23 -> ... -> 30.

---

## 2. MAJOR Architectural Changes Between 0.13.2 and 30.0

### 2.1 The main.cpp Dissolution (CRITICAL)
Validity currently has `src/main.cpp` and `src/main.h` as its monolithic validation/networking file — this is where the vast majority of PoS consensus hooks live. In modern Bitcoin Core:

- **`main.cpp` no longer exists.** Split into:
- `src/validation.cpp` / `src/validation.h` — block and transaction validation
- `src/net_processing.cpp` / `src/net_processing.h` — P2P message handling
- `src/node/blockstorage.cpp` — block storage management
- `src/txmempool.cpp` was significantly refactored

This is the single biggest obstacle — Validity's PoS logic is scattered across ~30+ locations in `main.cpp`.

### 2.2 ChainstateManager and CChainState (CRITICAL)
- **`ChainstateManager`** introduced (PR #17737) to manage one or two chainstates (for AssumeUTXO)
- Global `mapBlockIndex` is gone; replaced by `BlockManager` through `ChainstateManager`
- All Validity PoS code accessing `mapBlockIndex` as a global would need rewriting

### 2.3 libbitcoinkernel Consensus Extraction (CRITICAL)
Bitcoin Core is extracting its consensus engine into `src/kernel/`. Adding PoS to this would mean extending a library specifically designed around PoW.

### 2.4 Process Separation / Multiprocess Architecture
- `src/interfaces/` defines abstract interfaces: `interfaces::Chain`, `interfaces::Node`, `interfaces::Wallet`
- Wallet code can no longer freely call into validation code
- The staking miner (`ThreadStakeMiner`) directly accesses wallet and chain state — this tight coupling would need decomposition

### 2.5 Build System: Autotools to CMake (CRITICAL)
- Bitcoin Core 29+ uses **CMake** exclusively (Autotools deleted entirely)
- Validity's entire build system would need rewriting

### 2.6 C++ Standard: C++11 to C++20 (CRITICAL)
- Validity uses **C++11**; Bitcoin Core 27+ requires **C++20**
- Modern features used extensively: `std::optional`, `std::variant`, `std::filesystem`, concepts, ranges
- OpenSSL entirely removed; replaced with native crypto

### 2.7 SegWit
- Completely changes transaction serialization (witness data)
- `CTransaction` now has witness fields; `GetHash()` vs `GetWitnessHash()` distinction
- Validity's `CTransaction` has a **`nTime` field** (PoS) and `IsCoinStake()` — must coexist with SegWit

### 2.8 Taproot/Schnorr (BIP 340/341/342)
- SegWit v1 with Schnorr signatures
- Major script verification engine changes
- Validity uses older `secp256k1` with custom Schnorr module

### 2.9 Descriptor Wallets
- Legacy wallets (Berkeley DB) deprecated and being removed
- New wallets use **SQLite** with output descriptors
- BDB dependency being phased out

### 2.10 Serialization Framework Rewrite
- Old `ADD_SERIALIZE_METHODS` / `SerializationOp` with `nType`/`nVersion` replaced by `SERIALIZE_METHODS` macro
- Every serializable class would need updating

### 2.11 P2P Protocol Changes
- BIP155 (addrv2): Tor v3 and other address types
- BIP324 (v2 P2P transport): Encrypted connections
- Compact Block Relay improvements
- Package Relay

### 2.12 CCoins vs Coin
- 0.13.2 uses `CCoins` (all outputs of a transaction)
- Modern uses `Coin` (individual UTXO entries)
- Validity's PoS code directly creates `CCoins` objects — all UTXO access patterns change

---

## 3. Validity's PoS Code That Must Be Ported

| File | Purpose | Porting Complexity |
|------|---------|-------------------|
| `src/pos.cpp` (~257 lines) | Stake kernel hash, proof verification, stake cache | Very High |
| `src/pos.h` (~45 lines) | PoS interface declarations | High |
| `src/pow.cpp` / `src/pow.h` | Modified for dual PoW/PoS difficulty | Very High |
| `src/miner.cpp` | `ThreadStakeMiner`, PoS block assembly | Very High |
| `src/primitives/block.h` | `vchBlockSig`, `IsProofOfStake()` | Very High |
| `src/primitives/transaction.h` | `nTime` field, `IsCoinStake()` | Very High |
| `src/chain.h` | `nStakeModifier`, `BLOCK_PROOF_OF_STAKE` | Very High |
| `src/consensus/params.h` | PoS parameters, protocol versions | High |
| `src/main.cpp` | ~30+ PoS integration points | EXTREME |
| `src/chainparams.cpp` | PoS chain parameters | High |

---

## 4. Estimated Scope

### Phase 1: Foundation (3-6 months, 1-2 devs)
1. Fork Bitcoin Core 30.0
2. Add `nTime` to `CTransaction`, `vchBlockSig` to `CBlock`
3. Add `nStakeModifier` to `CBlockIndex`
4. Extend `Consensus::Params` with PoS parameters
5. Port Scrypt hashing, set up CMake, update to C++20

### Phase 2: Consensus Engine (4-8 months)
1. Port `pos.cpp` to use `Coin` and `ChainstateManager`
2. Modify `validation.cpp` with all ~30+ PoS integration points
3. Modify `node/miner.cpp` for PoS block assembly
4. Integrate with `libbitcoinkernel`

### Phase 3: Wallet and RPC (2-4 months)
1. Staking wallet integration with descriptor wallets
2. Port staking RPCs
3. Update `interfaces::Chain` for PoS

### Phase 4: Testing (3-6 months)
1. Regression testing against existing blockchain
2. Network protocol compatibility or migration plan

**Total estimated files: ~55-90 | New PoS code: 2,000-4,000 lines | Total delta: 10,000-20,000 lines**

---

## 5. Biggest Risks

1. **Consensus Divergence** — Every historical block must validate identically under new code
2. **Serialization Compatibility** — Custom fields must remain backward-compatible
3. **SegWit/Taproot + PoS Interaction** — Uncharted territory for coinstake transactions
4. **Global State Elimination** — All PoS functions need context objects instead of globals
5. **Maintainability** — Future Bitcoin Core releases would require careful merging

---

## 6. Alternative Approaches

| Option | Effort | Risk | Benefit |
|--------|--------|------|---------|
| **A: Full Rebase to 30.0** | 12-24 months | Extreme | Modern everything |
| **B: Incremental (0.13→0.15→...→30)** | 18-36 months | High per step | Lower risk per step |
| **C: Cherry-pick security fixes** | 2-4 months | Low | Fast, minimal risk |
| **D: Rebase onto BlackCoin More 26.x** | 1-3 months | Medium | Best effort/reward ratio |

---

## 7. Bottom Line

**Porting to Bitcoin Core 30.0 directly is roughly equivalent to building a new PoS cryptocurrency from scratch on a modern base.** The recommended path is **Option D: Rebase onto BlackCoin More 26.x** (see separate report).
Loading