Source: docs/lotus-v2/research/addendum-designs/P1-pwa-wallet-and-Q1-qt-removal.md
Research β€” non-normative. This page records an investigation. It defines no rule; a research result enters the specification only through a decision recorded in decision history.

P1: node PWA wallet (replaces bitcoin-qt) and Q1: removing Qt

Status: design, ready to implement. Scope: commits 2–4 of lotus-v2-optimizations/docs/plans/pwa-wallet-async-notifications-and-drop-qt-plan.md. Commit 1 of that plan (the async wallet notification queue, W1) is out of scope. This design replaces that plan's commits 2–4 wherever the two disagree.

Fixed user decisions (not reopened here):


0. What was verified and what was assumed

Verified by reading source at lotus-v2-repaired-source commit 3cf1891b91. I read it with git show/git grep; nothing was checked out. Note that the branch head has since moved to 596537e978, a rebased copy with the same subject. 3cf1891b91 is not an ancestor of it.

Assumed, not verified:


1. Daemon side (eCash tier, generic)

1.1 New files and options

New directory src/walletpwa/, built as static library walletpwa, linked into server. It is always built; there is no #ifdef and no off-switch at build time.

File Content
src/walletpwa/assets.h struct EmbeddedAsset { std::string_view path; std::string_view content_type; std::string_view etag; std::string_view body; std::string_view body_gzip; } and std::span<const EmbeddedAsset> EmbeddedBundle(); std::string_view EmbeddedBundleVersion();
src/walletpwa/serve.{h,cpp} Pure functions: ServeAsset(span, path, headers) returns a {status, headers, body} value; MIME table; path normalisation; ETag matching; encoding choice. No globals, so it is unit-testable.
src/walletpwa/session.{h,cpp} Token store, session store, Origin/Host policy, cookie parsing
src/walletpwa/http.{h,cpp} Glue to HTTPRequest: StartWalletPwa(), StopWalletPwa(), bool MaybeServeWalletPwa(HTTPRequest*), std::optional<std::string> AuthorizeWalletPwaSession(HTTPRequest*) (returns authUser)
src/walletpwa/launch.{h,cpp} -gui: mint a token, build the URL, open the browser
src/walletpwa/rpc.cpp RPC getwalletpwaurl
contrib/devtools/embed_wallet_pwa.py Bundle β†’ generated C++ (stdlib only)
contrib/devtools/test_embed_wallet_pwa.py unittest; added to DEVTOOLS_TESTS_PYTHON
src/test/walletpwa_tests.cpp Unit tests (Β§1.9)
test/functional/interface_wallet_pwa.py Functional test (Β§1.9)
doc/wallet-pwa.md Operator documentation

Runtime options, registered in SetupServerArgs, category RPC:

Option Default Meaning
-walletpwa 1 Serve /wallet/ and /auth/*. 0 returns 404 there, and browser sessions are refused.
-walletpwadir=<dir> unset Serve /wallet/* from this directory instead of the embedded bundle (development).
-walletpwaorigin=<origin> none Repeatable. Extra allowed browser origins, e.g. https://node.example.org (behind a proxy or a DNS name). The value must be scheme://host[:port] with no path.
-gui 0 After the HTTP server starts, open the wallet in the default browser with a one-time login token. Implies -server=1 (soft set in InitParameterInteraction). It is a startup error with -walletpwa=0, or with no embedded bundle and no -walletpwadir.

New RPC (category util): getwalletpwaurl ( "base" ).

1.2 Routes

Every route is subject to the existing -rpcallowip check and is never served on -publicbind listeners. Both already hold, because both checks happen before dispatch.

Method and path Handler Response
GET /wallet walletpwa (exact) 308 Location: /wallet/
GET /wallet/ walletpwa index.html
GET /wallet/<path> walletpwa The asset, or 404. There is no SPA fallback: the app uses hash routing.
HEAD, PUT, OPTIONS on /wallet/* unchanged Existing RPC handler behaviour (405)
POST /wallet/<name> RPC (unchanged) Multi-wallet JSON-RPC, now also accepting session auth
POST / RPC (unchanged) JSON-RPC, now also accepting session auth
GET /auth/session walletpwa (exact) Session status (Β§1.5)
POST /auth/session walletpwa (exact) Log in: token or password
POST /auth/logout walletpwa (exact) Log out

The method split is wired into StartHTTPRPC, which is the only edit to httprpc.cpp routing:

// in the "/" and "/wallet/" lambdas, before DelegateHTTPRequestAsync:
if (walletpwa::MaybeServeWalletPwa(req)) co_return true;   // GET under /wallet/ only

Path rules for <path>:

1.3 Assets: embedded bundle, development directory, headers

Bundle format (the contract between wallets/node-pwa and the daemon), node-pwa-bundle/1:

Embedding (CMake, in src/walletpwa/CMakeLists.txt):

set(WALLET_PWA_BUNDLE "" CACHE FILEPATH "Prebuilt node-pwa-*.tar.gz to embed (empty: none)")
set(WALLET_PWA_BUNDLE_SHA256 "" CACHE STRING "Required sha256 of WALLET_PWA_BUNDLE")
if(WALLET_PWA_BUNDLE)
  if(NOT WALLET_PWA_BUNDLE_SHA256 MATCHES "^[0-9a-f]{64}$")
    message(FATAL_ERROR "WALLET_PWA_BUNDLE_SHA256 must be 64 lowercase hex")
  endif()
  file(SHA256 "${WALLET_PWA_BUNDLE}" _h)
  if(NOT _h STREQUAL WALLET_PWA_BUNDLE_SHA256)
    message(FATAL_ERROR "WALLET_PWA_BUNDLE sha256 ${_h} != ${WALLET_PWA_BUNDLE_SHA256}")
  endif()
endif()
set(_gen "${CMAKE_CURRENT_BINARY_DIR}/wallet_pwa_bundle.cpp")
add_custom_command(OUTPUT "${_gen}"
  COMMAND "${Python_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/contrib/devtools/embed_wallet_pwa.py"
          --bundle "${WALLET_PWA_BUNDLE}" --sha256 "${WALLET_PWA_BUNDLE_SHA256}" --out "${_gen}"
  DEPENDS "${CMAKE_SOURCE_DIR}/contrib/devtools/embed_wallet_pwa.py" ${WALLET_PWA_BUNDLE}
  VERBATIM)
add_library(walletpwa serve.cpp session.cpp http.cpp launch.cpp rpc.cpp "${_gen}")
target_link_libraries(walletpwa PUBLIC util univalue)

src/CMakeLists.txt gets add_subdirectory(walletpwa) and target_link_libraries(server walletpwa).

embed_wallet_pwa.py (stdlib: argparse, tarfile, gzip, hashlib, json):

Serving rules (ServeAsset):

Extension Content-Type
.html text/html; charset=utf-8
.js, .mjs text/javascript; charset=utf-8
.css text/css; charset=utf-8
.json application/json
.webmanifest application/manifest+json
.svg image/svg+xml
.png image/png
.ico image/x-icon
.woff2 font/woff2
.wasm application/wasm
.txt text/plain; charset=utf-8
anything else 404
  Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:;
      connect-src 'self'; manifest-src 'self'; worker-src 'self'; font-src 'self'; media-src 'self';
      form-action 'none'; frame-ancestors 'none'; base-uri 'none'
  X-Content-Type-Options: nosniff
  Referrer-Policy: no-referrer
  X-Frame-Options: DENY
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Resource-Policy: same-origin
  Permissions-Policy: camera=(self), microphone=(), geolocation=(), usb=(), hid=()

Phase 3 QR scanning uses camera. WebHID, if added later, changes hid= in a later patch.

1.4 Small httpserver additions

These go on top of hand-off 0029. They are the only httpserver.{h,cpp} edits:

Everything else uses the existing API. GetPeer() is already the resolved client under 0029.

1.5 Browser authentication

Login methods. All three produce the same session.

  1. One-time token. Minted by -gui or by getwalletpwaurl.
  2. 32 random bytes from GetStrongRandBytes, as 64 hex characters.
  3. Stored as SHA256(token) with an expiry of 120 s and the minting authUser (__cookie__ for -gui; the caller's authUser for the RPC).
  4. At most 16 outstanding; minting a new one evicts the oldest.
  5. Single use. Compared in constant time against the stored hashes.
  6. It travels in the URL fragment (#/login/<token>), so it never reaches the server in a request line, logs or Referer. The PWA POSTs it to /auth/session.
  7. Password. The login form takes user and password: rpcuser/rpcpassword, an -rpcauth user, or the cookie file's __cookie__:<hex> (the form accepts the pasted cookie line and splits it at the first :).
  8. Checked with the existing RPCAuthorized on the reconstructed Basic value. The function is reused and made non-static in httprpc.{h,cpp} as bool CheckRPCCredentials(const std::string& user_colon_pass, std::string& authUser).
  9. Failures sleep 250 ms, like RPC does.
  10. Remote clients that are not browsers keep using Authorization: Basic, unchanged.

POST /auth/session request rules:

On success:

  Set-Cookie: <name>=<id hex>; Path=/; HttpOnly; SameSite=Strict; Max-Age=2592000[; Secure]
  Cache-Control: no-store
  {"csrf":"<hex>","user":"<authUser>","expires":<unix>}

Other /auth/* endpoints:

Session auth on JSON-RPC (POST /, POST /wallet/<name>). In ProcessHTTPRequest[Async], where it now replies 401 for a missing Authorization:

if (!authHeader.first) {
    if (auto user = walletpwa::AuthorizeWalletPwaSession(req)) { jreq.authUser = *user; /* continue as authorised */ }
    else { /* existing 401 path */ }
}

AuthorizeWalletPwaSession succeeds only if all of these hold:

On success the reply also carries Cache-Control: no-store. A request that has Authorization behaves exactly as today.

Origin policy, the same for every /auth/* and session-authenticated request:

  1. Host must be:
  2. a loopback literal (127.0.0.0/8, [::1]) or localhost, with any port. Any port allows ssh -L and other port forwards;
  3. or the host:port of some -walletpwaorigin.

Anything else is rejected. This is the DNS-rebinding defence.

  1. When Origin is present (always for POST), it must equal GetScheme() + "://" + Host, after lower-casing and dropping a default port. With -walletpwaorigin, it must also be in that list or satisfy rule 1.

Exact match means a page on http://127.0.0.1:3000, which is same-site, is refused for :12604.

  1. Violations reply 403 and log at BCLog::HTTP debug level without values.

Which RPCs a session may call. Exactly what its authUser may call. -rpcwhitelist applies unchanged; jreq.authUser is set, so the existing whitelist code runs for singletons and batches. There is no separate allowlist:

doc/wallet-pwa.md documents this, including that backupwallet, dumpwallet, importwallet and loadwallet paths refer to the node's filesystem.

Remote access over TLS. Use the existing single port with TLS detection (-tlscert/-tlskey), -rpcbind, -rpcallowip and -walletpwaorigin=https://name:port.

Behind -trustedproxy.

Never logged: tokens, session ids, cookie values or CSRF tokens. Log lines name the authUser and the client address only.

1.6 -gui

Called right after StartHTTPServer() in AppInitServers, when -gui:

  1. Mint a token for __cookie__, or for -rpcuser when a password is configured. The token stores the user name and never needs the password.
  2. Build the URL http://<host>:<rpcport>/wallet/#/login/<token>:
  3. <host> is 127.0.0.1, unless every -rpcbind is non-loopback and not a wildcard. Then it is the first -rpcbind host, bracketed if IPv6.
  4. Always http. The listener detects TLS and also serves plain HTTP, and loopback is a secure context.
  5. Print Wallet: <url> to stdout, only when stdout is a TTY and not -daemon. Never write it to debug.log. Log "Opening the wallet UI in the default browser".
  6. Open the browser, without a shell:
  7. macOS: posix_spawnp of open <url>.
  8. Linux and BSD: posix_spawnp of xdg-open <url>, only if DISPLAY or WAYLAND_DISPLAY is set. Otherwise log "no desktop session; open the URL above or run lotus-cli getwalletpwaurl".
  9. Windows: ShellExecuteW(nullptr, L"open", wide_url, nullptr, nullptr, SW_SHOWNORMAL).
  10. The child is not waited for synchronously: reap it with waitpid(..., WNOHANG) from a detached thread. A spawn failure is a log line, not a startup error.
  11. The PWA shows the RPC warm-up message (-28) until the node is ready, which replaces Qt's splash screen.

-gui with -daemon works: the forked child opens the browser.

1.7 Threat model

1.8 Where the patches land (eCash tier)

Order inside the eCash tier:

… 0001–0028 (already in the stack: …, 6987165a5f public fallback, 40fc3cc8fa args, fe649023c3 doc)
… generic 0029–0034 (trusted proxy/health, test WS transport, async dials, TLS read, wakeup, doc)
… Lane 3 (metrics/logging), Lane 4 (client cert reload), Lane 7 (TLS identity): whatever has been integrated
β†’ E-PWA-1  http: serve the wallet PWA under /wallet/ with browser sessions and -gui
β†’ E-PWA-2  depends: pin the node PWA bundle and embed it in depends builds

E-PWA-1 must come after 0029 (it uses the resolved client and IsTrustedProxy). Put it after all in-flight HTTP lanes, so it is the one that rebases, not them. Its httpserver.cpp diff is about 20 lines (Β§1.4), and its httprpc.cpp diff is about 40 lines (Β§1.2, Β§1.5). It is independent of W1.

E-PWA-2:

Guix builds go through depends, so they download the bundle outside the container with the normal sha256 check and embed it reproducibly. Bumping the PWA is a one-line, one-patch change.

Native release builds (monorepo daemon/scripts/build.sh) download the same URL, check the same sha256, and pass -DWALLET_PWA_BUNDLE=… -DWALLET_PWA_BUNDLE_SHA256=…. The pin is read from a new file, daemon/wallet-pwa-version (version sha256). This is a monorepo change, not a daemon patch.

1.9 Daemon tests

src/test/walletpwa_tests.cpp:

test/functional/interface_wallet_pwa.py uses raw http.client, with no browser:

test_embed_wallet_pwa.py:


2. The app: wallets/node-pwa/ (monorepo)

2.1 Technology (minimal, and why)

2.2 Layout

wallets/node-pwa/
  README.md                 dev loop, pack, test, release
  package.json              scripts: test, lint, pack, smoke; "private": true
  package-lock.json
  src/
    index.html              <link rel=manifest>, <script type=module src=main.js>, no inline script/style
    app.css
    main.js                 boot: session β†’ profile β†’ router β†’ poller
    sw.js                   service worker (Β§2.6)
    manifest.webmanifest
    icons/icon.svg icon-192.png icon-512.png maskable-512.png
    vendor/…                (Β§2.1)
    lib/
      rpc.js                JSON-RPC client (Β§2.3)
      json.js               lossless JSON parse (Decimal for non-safe numbers)
      session.js            /auth/* calls, login/logout, 401 handling
      poller.js             refresh loop + waitfornewblock long-poll (Β§2.4)
      profile.js            network/profile detection (Β§2.5)
      amount.js             BigInt fixed-point parse/format from getcurrencyinfo
      xpiaddr.js            xpi1 encode/decode per xpiaddr.md
      uri.js                ecash:/xpi: BIP21 parse/build
      consoleparse.js       console command-line parser
      store.js              tiny observable app state (no library)
      storage.js            localStorage/IndexedDB wrappers (try/catch, per-origin)
      csv.js                CSV export
    ui/                     shared components: Layout, Sidebar, StatusBar, Modal, AmountInput, AddressInput, Table, Toast, QR
    views/                  one module per screen: overview, send, receive, transactions, txdetail,
                            peers, console, nodeinfo, wallets, login, offline
  test/
    unit/*.test.js          node --test
    smoke/smoke.spec.js     Playwright against a regtest node
    fixtures/xpiaddr_v2_vectors.json   copied from the daemon's vector file
  tools/
    pack.mjs                deterministic bundle (Β§2.7)
    lint.mjs                bans innerHTML/insertAdjacentHTML/eval/new Function/inline handlers

Routing is hash-based (#/overview, #/send, #/receive, #/transactions, #/tx/<txid>, #/peers, #/console, #/node, #/wallets, #/login[/<token>]). The selected wallet is a query on the hash (?w=<name>) and is remembered in localStorage.

Layout: left sidebar navigation; top bar with the wallet picker, lock state, mask-values toggle (phase 2) and network badge; main pane; bottom status bar with sync progress, connection count, a network-active toggle and the node version.

2.3 RPC client

2.4 Refresh and notifications

Phase 1 uses polling plus a long-poll; there is no new daemon endpoint.

2.5 Network and profile detection

On login and after each reconnect:

  1. getblockchaininfo.chain gives main | test | regtest.
  2. getcurrencyinfo gives ticker and decimals, used everywhere. Nothing is hard-coded.
  3. getblockheader <bestblockhash> false: header hex length 160 (80 bytes) β†’ profile ecash; 268 (134 bytes) β†’ profile lotus-v2; anything else β†’ generic, which behaves like ecash for addresses.
  4. Address format:
  5. ecash: cashaddr, validated only by validateaddress (debounced 300 ms).
  6. lotus-v2: encode a probe address for the chain's hrp (xpi/txpi/rxpi, root = 32 zero bytes) with xpiaddr.js and call validateaddress on it. isvalid: true β†’ format xpi; otherwise cashaddr (a node from before L4).
  7. Under the xpi format:
  8. client-side decoding with the spec's exact rejection reasons gives instant typo feedback;
  9. wrong network is reported when the hrp differs from the chain;
  10. validateaddress remains authoritative.

What the profile switches on (V2 views):

2.6 Service worker and installability

It is chain-neutral because the same bundle serves eCash and Lotus. The window title shows <client> Β· <chain> at runtime. Each node origin (host:port) is a separate installable app with separate storage.

2.7 Packaging and release

2.8 Tests

2.9 bitcoin-qt parity checklist

Phase definitions:

bitcoin-qt (file) PWA Phase RPCs
Overview: balances, recent transactions (overviewpage) Overview P1 getbalances (incl. watch-only), listtransactions "*" 10
Send (sendcoinsdialog, sendcoinsentry): several recipients, label, amount, subtract fee, clear, confirm Send P1 validateaddress, walletcreatefundedpsbt (fee preview only, if it errors show "fee calculated when sent"), sendmany, gettransaction for the actual fee
Send: unlock prompt (askpassphrasedialog, unlock mode) Modal before send P1 walletpassphrase <p> 60, walletlock after
Send: paste or open a payment URI Send field accepts URIs P1 β€” (uri.js)
Send: fee options (custom fee) Send "fee rate" field P2 settxfee, estimatefee, sendmany options
Coin control (coincontroldialog) Send β†’ Inputs drawer P2 listunspent, lockunspent, listlockunspent, send with inputs/change_address
Receive form and history (receivecoinsdialog, recentrequeststablemodel) Receive P1 getnewaddress <label>; request history in IndexedDB per origin and wallet; listreceivedbyaddress 0 true
Payment request with QR, copy URI/address, save image (receiverequestdialog, qrimagewidget) Receive modal P1 β€” (qrcodegen SVG, download SVG/PNG)
Transactions list, filters, search (transactionview) Transactions P1 listtransactions "*" 100 <skip> true, paged
Transaction details (transactiondescdialog) Tx modal P1 gettransaction <txid> true true
Abandon transaction (context menu) Tx modal action P1 abandontransaction
Export CSV (csvmodelwriter) Transactions β†’ Export P2 β€” (csv.js blob download)
Edit label (context menu, editaddressdialog) Tx modal and address book P2 setlabel
Bump fee not ported: ABC has no RBF β€” β€”
Sending/receiving address books (addressbookpage, addresstablemodel) Address book view P2 listlabels, getaddressesbylabel, setlabel, getaddressinfo
Debug window β†’ Information (debugwindow, clientmodel) Node view P1 getnetworkinfo, getblockchaininfo, getmempoolinfo, uptime, getmemoryinfo; datadir shown via getrpcinfo.logpath
Debug window β†’ Console (rpcconsole) Console P1 Any RPC; wallet selector; history (localStorage, 100 entries); clear; font size; Qt's warning banner about scams
Debug window β†’ Network traffic (trafficgraphwidget) Node view graph (canvas) P2 getnettotals
Debug window β†’ Peers, banned peers (peertablemodel, bantablemodel) Peers P1 getpeerinfo, listbanned, disconnectnode, setban add (1 h/1 d/1 w/1 y), setban remove, clearbanned
Status bar: sync progress, connections, network active (bitcoingui, modaloverlay) Status bar and sync overlay P1 getblockchaininfo, getnetworkinfo, setnetworkactive
Status bar: HD and encryption icons Top bar badges P1 getwalletinfo
File β†’ Create/Open/Close wallet (createwalletdialog, walletcontroller) Wallets view and picker P1 createwallet (name, encrypt passphrase, disable private keys, blank, descriptors), listwalletdir, loadwallet, unloadwallet, listwallets
File β†’ Close all wallets Wallets view P2 unloadwallet Γ— n
File β†’ Backup wallet Wallets view, path on the node host P2 backupwallet <path>, with a warning that the path is on the node's filesystem
File β†’ Sign/Verify message (signverifymessagedialog) Sign/Verify view P2 signmessage, verifymessage
File β†’ Load PSBT PSBT view (paste or upload base64) P2 decodepsbt, analyzepsbt, walletprocesspsbt, finalizepsbt, sendrawtransaction
File β†’ Open URI (openuridialog) Send view field P1 β€”
Settings β†’ Encrypt wallet, change passphrase (askpassphrasedialog) Wallets view P2 encryptwallet, walletpassphrasechange
Settings β†’ Mask values Top bar toggle (Ctrl+Shift+M) P2 β€”
Settings β†’ Options: display unit (bitcoinunits) Settings: ticker or base units P2 getcurrencyinfo
Options: third-party transaction URLs Settings, local per origin P3-required β€”
Options: language (translations) i18n with English only P3 β€”
Options: coin control on/off, spend unconfirmed change Settings (local; the latter via -spendzeroconfchange) P3-required (coin control toggle only) β€”
Options: prune, dbcache, script threads, proxy, Tor, NAT-PMP, listen, "reset options", "open config file" not ported: read-only display of current values in Node view (getnetworkinfo proxies and local addresses); changes via lotusd.conf (documented) P3-required (read-only display) getnetworkinfo, getblockchaininfo.pruned
Options: start on login, tray, minimize on close (Window tab) not ported: OS or browser features (install app; service managers) β€” β€”
Intro/datadir chooser (intro), splash (splashscreen) not ported: the node is already running; -gui plus the warm-up screen replace the splash β€” β€”
Notifications for incoming transactions (notificator, DBus) Web Notifications on new incoming wallet transactions (from the poller) P2 β€”
Help β†’ About, command-line options (utilitydialog, helpmessagedialog) About view P3-required getnetworkinfo; help
File β†’ Exit "Stop node" with confirmation P2 stop
BIP70 payment requests (paymentserver, paymentrequestplus) not ported: deprecated; plain URIs only β€” β€”
URI protocol handler (paymentserver) protocol_handlers in the manifest for web+xpi/web+ecash (the bare schemes cannot be registered by web apps) P3 β€”
QR scan (not in Qt) Camera scan via BarcodeDetector where available P3 β€”
Lotus V2 tokens and 3-branch outputs V2-only view P3 (needs V2 wallet RPCs that don't exist yet) β€”
Hardware wallets (WebHID), WebGPU miner Out of scope for parity; later, separate design β€” β€”

3. Qt removal (Q1) in the V2 tier

3.1 Placement and order

3.2 Exact changes

Delete:

Edit:

Passing -DBUILD_QT=OFF afterwards only produces CMake's "unused variable" warning, so the monorepo's daemon/scripts/build.sh, components.json and guix-daemon.yml keep working unchanged. Clean them up in a separate monorepo commit.

The Lotus monorepo overlay daemon/candidates/guix/000-lotus-guix-linux.patch passes NO_QT=1 NO_QR=1 to make; unknown make variables are harmless.

Validation for Q1:

3.3 Later Qt removal from the eCash tier (criteria)

Delete Qt from the eCash tier, with the same patch content re-based onto that tier, only when all of these hold:

  1. Every P1, P2 and P3-required row in Β§2.9 is implemented, and every "not ported" row is documented in doc/wallet-pwa.md.
  2. The smoke test (Β§2.8) is extended to the P2 flows (coin control, encrypt/unlock, sign/verify, PSBT, address book, backup) and passes against an eCash-tier build. It runs in CI for at least one tagged eCash-tier release that embeds the bundle through E-PWA-2.
  3. Guix builds of that eCash-tier release are reproducible with the bundle embedded.
  4. No open bug against the PWA is marked as blocking parity.
  5. The user signs off explicitly.

When those hold, the eCash-tier Qt deletion goes after E-PWA-2. V2's Q1 then shrinks to nothing on rebase and is dropped.


4. Patch-by-patch plan

# Tier / location Title Files Depends on
E-PWA-1 eCash, after hand-off 0029–0034 and any integrated Lane 3/4/7 HTTP patches http: serve the wallet PWA under /wallet/ with browser sessions and -gui new src/walletpwa/*, contrib/devtools/embed_wallet_pwa.py and its test, contrib/devtools/CMakeLists.txt, src/CMakeLists.txt (subdirectory and link), src/httpserver.{h,cpp} (Β§1.4), src/httprpc.{h,cpp} (Β§1.2, Β§1.5), src/init.cpp (arguments, -gui interaction, StartWalletPwa, launch), src/rpc/register.h (register getwalletpwaurl), src/test/walletpwa_tests.cpp and test CMakeLists.txt, test/functional/interface_wallet_pwa.py and test-runner list, doc/wallet-pwa.md 0029
E-PWA-2 eCash, right after E-PWA-1 depends: pin the node PWA bundle and embed it in depends builds depends/packages/wallet_pwa.mk, depends/packages/packages.mk, depends/Makefile, depends/README.md, depends/toolchain.cmake.in E-PWA-1, a published node-pwa-v0.1.0
Q1 V2, at the V2 tip, after L1–L3 and before L4/L5 build(v2): remove bitcoin-qt Β§3.2 β€” (independent of E-PWA)
M-1 monorepo ~/repos/lotus wallets/node-pwa: phase 1 app wallets/node-pwa/**, .github/workflows/node-pwa.yml E-PWA-1, to run against
M-2 monorepo daemon: embed the pinned node PWA in native release builds daemon/wallet-pwa-version, daemon/scripts/build.sh; clean up stale -DBUILD_QT=OFF in components.json, guix-daemon.yml and build.sh (V2 only) E-PWA-1, a published bundle
M-3… monorepo Phase 2, then phase 3 rows of Β§2.9, one view per commit wallets/node-pwa/** M-1
later eCash wallet: stream wallet events over WebSocket (optional; replaces polling) src/walletpwa/events.cpp W1, E-PWA-1
later eCash Qt removal (Β§3.3) as Β§3.2 on the eCash tier parity

Release order: E-PWA-1 β†’ M-1 β†’ tag node-pwa-v0.1.0 β†’ E-PWA-2 and M-2. Q1 can land at any time.

5. Open questions (few, explicit)

  1. Bundle hosting URL. E-PWA-2 assumes GitHub release assets on givelotus/lotus with tag node-pwa-vX.Y.Z. Confirm, or name another host.
  2. Session lifetime (7 days idle, 30 days absolute, in memory only, so a node restart logs everyone out). Confirm, or ask for persisted sessions (a 0600 file in the datadir holding only session hashes).

Decisions (user, 2026-10-20)

  1. Bundle hosting: GitHub releases of the monorepo, pinned by sha256. No release is to be made yet.
  2. Sessions are in memory only: a node restart logs the browser out. The PWA keeps no wallet state of its own; the node holds everything. Browser storage is used only for per-browser conveniences (console history, theme, receive-request notes).