Implementation is complete; the blueprint.md file no longer exists in the
repo. Drop the dead reference, all §X section markers, the "Implementation
state" progress block, and the TODO list. General rules (role, language
policy, architecture invariants, working rules) are preserved unchanged.
Help button now shows a two-tab overlay:
- Info: existing about/version content
- Donate: donate flow to the dev address (plm1qdq3…) with free amount
input, prepare preview, and confirm-and-broadcast button
New MainWindowViewModel.Donate.cs partial: DonateAmount / DonatePreview
/ HasPendingDonate observable properties, PrepareDonateCommand (builds
the tx with hardcoded dev address via the existing TransactionFactory),
ConfirmDonateCommand (broadcasts and syncs). Donate state is reset on
overlay close. Six-language Loc keys added (help.tab.info/donate,
donate.desc/dev.address/amount/prepare/confirm).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- UniformGrid Columns="5" on TabStrip so all 5 tabs always stay on one
row on Android (Rows="1" alone did not auto-calculate columns at
measure time on the Android Avalonia renderer)
- Contacts tab header was using hardcoded FontSize=13/Width=24/Spacing=4
instead of the TabFontSize/TabIconSize/TabSpacing ViewModel bindings,
making it visually larger than the other four tabs on mobile
- ContentPresenter Margin="0,0,0,4" in Controls.axaml pushes the tab
header content above the 2 px selection indicator, which is drawn at
the absolute bottom of the template Panel and was overlapping the label
- TabItem horizontal padding 4→8 px and TabSpacing 2→4 for both
desktop and mobile to give more breathing room between tab items
Send tab: Recipient and Amount cards side-by-side on desktop using a
two-column Grid, making full use of the available window width.
Summary card and action buttons remain full-width below both columns.
Mobile retains the original vertical stack.
Receive tab: QR card on the left (auto-width), address card expands
to fill the right column on desktop — standard fintech wallet pattern.
Mobile retains QR above, address below.
Window enlarged to 1020×680 (from 900×620) and fixed with CanResize=False;
Min/Max dimensions match so the resize handle never appears.
Translate every Italian /// XML doc comment, <!-- --> XAML comment, and
// inline comment to English across all source files (Core, App, tests).
Add the language policy to CLAUDE.md (conversation Italian; all code
and docs English). Update one test assertion that checked an Italian
exception message that was also translated.
Transaction details overlay redesigned from a flat 12-row grid into a
scannable layout: a header with the net amount in focus plus SPV/status
badges, then three labeled cards (Overview, Amounts & fees, Technical
details), with inputs/outputs as carded rows. Adds a .section heading
style and tx.sect.* localization keys (6 languages).
Coinbase transactions are now explicitly identified: an amber "Coinbase"
badge in the header, and the misleading "From: —" / "coinbase —" replaced
with "Newly generated (mining)" (localized). Exposes IsCoinbase on the
details view model; no consensus/logic change, presentation only.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace raw Fluent defaults + inline hex with a semantic design system,
themed for both light/dark (follows system variant).
- Styles/Theme.axaml: semantic brushes (surface/text/border/status) per
variant via ThemeDictionaries; override Fluent SystemAccentColor to brand
blue (#2563EB) and ControlCornerRadius=8; blue->indigo balance gradient.
- Styles/Controls.axaml: reusable classes (card, balance-hero, chip, ghost),
type scale (amount with tabular figures, mono, h1, label), button/input
polish, tab selected-in-blue, list hover/selected tints, card hover-lift.
- MainView: balance shown as gradient hero card; dashboard tabs use Material
SVG Path icons (Fill tracks TabItem selection) instead of Unicode glyphs;
all hardcoded colors (LimeGreen/IndianRed/Orange/Gray/#99000000) and
generic Fluent surface brushes mapped to semantic tokens; app background,
stronger modal scrim, status bar top border.
Palette derived from the logo (blue=trust, green=money). Build clean, app
starts with no binding errors.
Speed up wallet synchronization, especially re-syncs of large wallets:
- Incremental address discovery: known indices from the previous sync
(NextReceiveIndex/NextChangeIndex) are fetched in a single parallel
burst instead of sequential gap-limit rounds, cutting round-trips from
O(used/gapLimit) to ~O(1). Receive and change chains scan in parallel.
- Merge tx download and Merkle verification into one parallel phase
(no barrier between them); the per-call semaphore is dropped in favor
of the transport-level in-flight gate.
- Persist verified block headers (SyncCache.BlockHeaders, height -> hex):
immutable once stored, so blockchain.block.header round-trips for
already-verified proofs are eliminated on later syncs.
- RetryOnBusyAsync with exponential backoff around server calls, treating
-101/-102 and "server busy"/"excessive resource usage" as transient.
Wire the new PreloadCaches/ExportCaches signatures through the desktop
view model and the CLI sync command.
Rework the ElectrumClient transport to cut latency and allocations
during sync:
- Channel-based single-reader write loop: drains the whole queue into a
single WriteAsync+FlushAsync, replacing the _writeLock that forced one
flush per message. N queued requests now travel in one TCP segment.
- PipeReader read loop parsing via Utf8JsonReader over pooled spans: no
StreamReader/ReadLineAsync and no intermediate string per response.
- TcpClient.NoDelay = true: no Nagle wait on small packets.
- Concurrency gate (SemaphoreSlim, MaxInFlight=32) in RequestAsync:
caps requests in flight to the server without serializing writes,
avoiding floods (-101/-102) and connection drops on wallets with large
history.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The last wizard step (password) now shows an optional name field.
The name becomes the filename: <name>.wallet.json in the wallets
directory. Invalid filename characters are replaced with '_'.
If left empty, the existing auto-name logic applies (default.wallet.json,
wallet-2.wallet.json, …). If the chosen name already exists the wizard
shows an error instead of overwriting.
The name field is visually separated from the encryption section by a
distinct background panel and a horizontal divider.
Three interrelated fixes for sync reliability on large wallets:
1. Prevent -101 "excessive resource usage":
ScanChainAsync uses GetHistoryAsync for discovery instead of
SubscribeScripthashAsync. Subscriptions are limited to the gap window
only (≤ 2×gapLimit addresses), so the session subscription count stays
constant regardless of wallet history size — eliminating -101 on
wallets with 1000+ historical addresses.
2. Persist and resume tx cache across sessions and disconnects:
WalletSynchronizer gains ExportCaches() and PreloadCaches(). On every
successful sync (and on partial failure) the downloaded raw tx hex and
verified Merkle heights are written to SyncCache.RawTxHex/VerifiedAt
in the wallet file. On reconnect or app restart the new synchronizer
is pre-populated from disk so only new transactions are downloaded.
_synchronizer is always nulled on reconnect (new client = new instance)
while caches survive via the wallet file.
3. Auto-connect with multi-server fallback and retry:
ConnectAndSync iterates BuildServerCandidates() (current server first,
then all KnownServers in order) and stops at the first that responds.
_autoReconnect and _syncFailed are set in OpenLoaded() so the keepalive
timer (20 s) retries automatically on any failure — connection error,
-101 mid-download, or timeout. PersistPartialTxCache() saves whatever
was downloaded so each retry resumes from its checkpoint.
Add two new import paths to the setup wizard:
- "Importa xpub / xprv": accepts any SLIP-132 key (xpub/ypub/zpub or
xprv/yprv/zprv), auto-detects script type from the version prefix,
and saves a watch-only or fully-spendable HD account accordingly.
- "Importa chiave WIF": accepts one or more WIF private keys (one per
line), goes through script-type selection, and saves an ImportedKeyAccount.
WizardFlowKind enum (New, Restore, ImportXkey, ImportWif) governs which
steps are shown; WizardBack() updated for all four flows. OpenLoaded()
updated to accept IWalletAccount and display wallet kind tags
(watch-only / imported) in the network info line.
Localization keys added for all six languages (it/en/es/fr/pt/de).
ViewModel._account changed from HdAccount? to IWalletAccount?.
Introduce IWalletAccount interface to abstract HD, imported-xprv, WIF,
and watch-only account types. HdAccount implements the interface; the
new ImportedKeyAccount handles lists of WIF keys with fixed addresses
(no gap scanning, change returns to first address).
WalletLoader gains three factory methods:
- NewFromXpub: watch-only from SLIP-132 xpub/ypub/zpub
- NewFromXprv: spendable from SLIP-132 xprv/yprv/zprv
- NewFromWif: spendable from one or more WIF private keys
WalletDocument gains optional AccountXprv and WifKeys fields; AccountPath
and AccountXpub become nullable (absent for WIF wallets). IsWatchOnly
updated to cover all non-signing wallet kinds.
TransactionFactory and CLI OpenWallet() updated to IWalletAccount.
12 new unit tests in ImportedKeyAccountTests cover factory round-trips,
address derivation, and watch-only detection.
On mobile the server settings panel now fills the entire screen
(no MaxWidth/MaxHeight/Margin constraints, no rounded corners) using
a desktop-only Border.desktop-overlay style so inline values never
fight the style system. Input font sizes increased (11→13/15px),
known-server list taller (200→300px) and server hostname larger (13→15px).
Desktop layout unchanged.
UnconfirmedText (pending/unconfirmed balance) now wraps instead of
clipping horizontally. Contact name in mobile list gets CharacterEllipsis
trimming for arbitrarily long user-defined names.
Drop the mainnet/testnet/regtest ComboBox from the wizard and fix
Net to always return NetKind.Mainnet. Core profiles and CLI --net
flag are untouched; the wallet file still records the network name.
Replace the mobile-only custom bottom Grid nav bar with a single styled
TabStrip that works the same on both platforms: icon + label headers,
gray background, UniformGrid for equal-width columns.
Also adds the 📷 scan button in the Send address field (visible on mobile,
triggers ScanQrCommand wired in the previous commit).
Camera2 + ZXing.Net 0.16.9 activity (ScannerActivity) that captures JPEG
frames at ~2.5 fps and decodes QR codes without Xamarin dependencies.
Result is returned to MainActivity via OnActivityResult/TaskCompletionSource.
PlatformServices.ScanQrAsync seam wires Android head to shared App layer;
ScanQrCommand in the Send ViewModel strips BIP21 URI scheme/query parameters.
CAMERA permission and uses-feature added to AndroidManifest.
Generate mipmap ic_launcher.png at all standard densities (mdpi→xxxhdpi)
from logo.png, cropped to bounding box and scaled to 88% of the tile on
a white background (legacy fallback for API < 26).
For API 26+ provide an adaptive icon (ic_launcher.xml / ic_launcher_round.xml)
with white background and a foreground PNG where the logo occupies 56% of
the 108dp canvas — within the safe zone, fully visible on every launcher
shape without clipping.
Avalonia's TabStrip ignores HorizontalAlignment overrides when placed at
Bottom, causing the items to cluster left. Replace it with a dedicated
Grid (ColumnDefinitions="*,*,*,*,*") that guarantees 5 equal columns
across the full width. The built-in TabStrip is hidden on mobile; buttons
in the custom bar call SelectTabCommand to drive SelectedTabIndex on the
TabControl.
Tab bar: replace plain Header strings with icon+label StackPanels
(≡ ↑ ↓ ⊙ ⊕); style TabStrip with UniformGrid so all five tabs share
the full width equally; center content and add touch padding. Icons
are visible only on mobile (IsMobile binding); desktop keeps text only.
Server settings overlay: dual layout for host/port/TLS input (vertical
on mobile: host full-width, port+TLS side by side) and for action
buttons (stacked full-width on mobile). Known-server list item shows
host on one line and tcp/ssl ports on the line below on mobile.
Connection status bar: simplify to "connesso" / "non connesso" —
remove the "a host:port" suffix from the connected state and
consolidate all disconnected/error/cert-changed states to conn.none.
Add IsMobile property and BoolToTabPlacementConverter; wire
TabStripPlacement to move tabs to the bottom on mobile (standard
Android pattern). Hide the desktop menu bar on mobile and expose
Settings/Help via a compact header row instead.
Replace fixed-width multi-column grids with dual desktop/mobile
templates in History, Addresses and Contacts lists; adapt Send,
Receive and the add-contact form for narrow screens. Remove hard-coded
Width from all five overlays (560–640 px) in favour of MaxWidth +
Margin="16" so they never overflow a 360 px screen; add ScrollViewer
to Address info, Server settings and Settings overlays.
Desktop layout is unchanged: all differences are gated on the
IsMobile/IsDesktop bool, which is a platform constant (false on desktop).
9 property tests covering:
- CoinAmount: TryParseIn/TryParseCoins never throw on arbitrary strings;
FormatIn→TryParseIn roundtrip holds for any sats in [0, MaxSupply];
parsed results always ≥ 0
- EncryptedFile: Encrypt→Decrypt roundtrip for any plaintext/password;
wrong password always raises WrongPasswordException (never other exceptions);
IsEncrypted never throws
- MerkleProof: every leaf in a randomly generated tree verifies against its root
(1–16 leaves, covers odd/even/single at every position); foreign txid never
verifies and never crashes
Covers: what the wallet protects against (AES-GCM at rest, Merkle SPV
verification, TLS TOFU pinning) and what it does not (compromised OS,
eclipse attacks, traffic analysis). Documents key/seed management,
encryption parameters, TLS pinning behaviour, backup guidance, and
known v1 limitations (no Tor, no coin control, no hardware wallet).
The password parameter accepts null, which saves the wallet in plaintext.
The XML doc comment now makes explicit that this is only acceptable when
the user has explicitly opted out of encryption with a UI warning shown.
Three improvements to WalletLock integration:
1. OpenExisting acquires the lock before decrypting the file — no point
attempting a potentially expensive PBKDF2 derivation for a wallet
already held by another instance.
2. OpenFromPath acquires the lock before CloseWallet — if the new wallet
is unavailable, the current session stays intact instead of being
silently destroyed.
3. OpenLoaded now receives an already-acquired WalletLock from the caller
instead of acquiring it internally; TryAcquireWalletLock is removed.
Callers that fail to open (wrong password, I/O error) dispose the lock
in their catch blocks.
Also fix CoinAmount.Of() to throw ArgumentException for unknown units
instead of silently falling back to PLM.
Replace the silent (long) cast with an explicit fractional check:
if value * factor has a non-zero remainder, TryParseIn/TryParseCoins
return false. The caller already shows "Importo non valido." to the
user, so no UI change is needed.
Covers TryParseIn (all units) and TryParseCoins. Adds CoinAmountTests
with valid and invalid cases including the triggering example (1.9 sat).
Introduces an exclusive file lock (FileShare.None on wallet.json.lock)
held for the duration of a wallet session. A second instance trying to
open the same file receives null from TryAcquire and sees a localized
error message; UnauthorizedAccessException (OS permission issues)
propagates separately so the UI can show a distinct message.
The .lock file is deleted on Dispose (best-effort); the real guard is
the open FileStream, which the OS releases automatically on crash.
Remove the wizard-step status messages (welcome, password info,
seed instructions, etc.) — the XAML headings for each step already
communicate context. StatusMessage is now reserved for actionable
feedback (errors, sync progress, connection state).
CLAUDE.md: reflect Desktop+Android split, net10.0, updated build/run
commands (src/App.Desktop instead of src/App), note blueprint is now
reference-only not binding.
README: update project paths, publish commands and quickstart for the
new structure.
The Avalonia UI code (App, Views, ViewModels, Localization, Assets) now
lives in src/App as a plain library (no OutputType). Two thin heads
reference it:
- src/App.Desktop/ — WinExe, Avalonia.Desktop, hosts MainView in a
MainWindow; carries Program.cs and app.manifest (moved from src/App)
- src/App.Android/ — net10.0-android, Avalonia.Android, MainActivity/
MainApplication; targets API 23+, EmbedAssembliesIntoApk=true so the
apk is self-contained for sideloading
All event handlers and TopLevel-dependent calls (file picker, clipboard,
folder picker) moved from MainWindow.axaml.cs into the new shared
MainView.axaml.cs (UserControl), using TopLevel.GetTopLevel(this) so
they work on both platforms. Esc/Back key handling is also in MainView.
MainWindow becomes a thin shell that hosts MainView.
Framework bump: all projects move to net10.0; Cli and Tests follow.
Covers what Palladium Wallet is, the tech stack, build/test/run
commands and current implementation status.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- csproj: add <Version>0.9.0</Version> as single source of truth
- AppVersion reads Major.Minor.Build from the assembly; WindowTitle
exposes "Palladium Wallet 0.9.0" bound to Window.Title
- Menu Help → in-app overlay (same pattern as settings/server overlays)
showing app name, version and a short description; backdrop tap and
Esc close it
- i18n: menu.help, help.title, help.info in all 6 languages
Double-clicking a history row opens an in-app overlay (same pattern as
address/server/settings overlays) that shows all available data for a
transaction. The overlay appears immediately with a spinner; data is
fetched from the server in the background and rendered once ready.
Backdrop tap and Esc close it; a pending fetch is cancelled.
New Core type — TransactionInspector (Core/Wallet/):
- FetchAsync() downloads the raw tx, all parent txs (parallel requests,
one round-trip instead of N sequential), and the block header
- Reconstructs inputs (amounts, addresses, is-mine), outputs, fee,
virtual size, RBF flag, block timestamp, confirmations
New App types:
- TransactionDetails record: full parsed data (fee, net, I/O lists,
counterparty addresses, coinbase detection…)
- TransactionDetailsViewModel: pre-formats all strings in the current
locale and unit (status, date, signed amounts, sat/vB rate…)
- TxIoRow record: one row in the input/output tables
- MineColorConverter: bool → brush (MediumSeaGreen for own addresses)
ViewModel changes:
- ShowTransactionDetailsAsync / CloseTransactionDetailsCommand
- BuildTransactionDetailsAsync (also public for future RBF/CPFP use)
- CancellationTokenSource so opening a new tx cancels the previous fetch
- All server work runs on Task.Run to keep the UI thread free
XAML: history rows get DoubleTapped handler, Hand cursor, hint label,
txid now uses TextTrimming instead of SelectableTextBlock.
i18n: 24 new tx.* / history.hint keys in all 6 languages.
Adds a "Copy" button next to the receive address in the Receive tab.
Uses Avalonia's Clipboard API (async, code-behind) and calls
NotifyAddressCopied() to show the existing addr.copied status message.
New i18n key receive.copy in all 6 languages.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add logo.png (source) and logo.ico (multi-size: 256/128/64/48/32/16)
generated with Pillow. Remove avalonia-logo.ico (Avalonia template
placeholder). Update MainWindow.axaml Icon and csproj ApplicationIcon
to point to the new files.
Adds QRCoder 1.8.0 and generates a PNG QR code in-memory each time
the receive address changes (OnReceiveAddressChanged). The bitmap is
displayed in the Receive tab inside a white-background border with
pixel-perfect scaling (BitmapInterpolationMode=None). Previous bitmap
is disposed to avoid memory leaks.
Multi-wallet (§8):
- AppPaths.WalletFiles(net) enumerates all *.wallet.json in the wallets
dir; WizardStartOpen shows a chooser step when more than one is found
- New StepChooseWallet + ChooseWalletCommand; Back from StepOpen returns
to chooser (or to StepStart when only one wallet)
- WalletFileEntry record for the chooser ItemsControl
Password step (Electrum style):
- ConfirmPasswordInput: password must be typed twice before creating
- EncryptWallet checkbox (default true); when unchecked, password is
null (plaintext file) with an explicit warning
- Validation: empty password with encryption on → msg.password.required;
mismatch → msg.password.mismatch
- ConfirmPasswordInput cleared on wallet open and wizard back
AppPaths:
- DefaultDataRoot() is now platform-aware: %APPDATA%\PalladiumWallet on
Windows, ~/.palladium-wallet on Linux/macOS (matches §8 convention)
- Legacy root fallback removed (no prior releases to migrate from)
i18n: wiz.choose.title, wiz.password.confirm, wiz.password.encrypt,
wiz.password.encrypt.hint, msg.choose.wallet, msg.password.required,
msg.password.mismatch — all 6 languages
- ConnectAndSync() no longer bails early when no wallet is open:
connection is established immediately after the wizard completes
(Electrum-style), sync starts only once an account is available
- KeepAlive tick no longer requires IsWalletOpen so the connection is
maintained and auto-reconnected at all times
- WalletSynchronizer is lazily created on first sync (not on connect)
to avoid a null-ref guard on _synchronizer
- Connection status indicator (dot + text) moved from wallet header to
the status bar (always visible); tapping it still opens the server
settings overlay
- Menu "Rete" removed: Discover and ResetCerts are inside the server
settings overlay; redundant top-level menu entry eliminated
- "Server" button in settings overlay is no longer gated on IsWalletOpen