EL
← All projectsElectrum

Electrum

Long-running lightweight Bitcoin wallet for desktop and mobile platforms.

BitcoinSoftware walletsActive incident
Repository coverage

1361 commits in the local evidence base

Every captured commit receives deterministic security triage and a separate communication-quality score. Security candidates and broader second-pass signals receive full-patch Ollama analysis.

108security candidates322second-pass queue1084AI analyses
89commits · 30 days
196commits · 60 days
570commits · 180 days
1124commits · 365 days
Backfill bands
Aug 5 → Feb 6470 seen11 candidatesComplete
Feb 6 → Jun 6346 seen10 candidatesComplete
Jun 6 → Jul 653 seen2 candidatesComplete
Jul 6 → Aug 554 seen3 candidatesComplete
Commit communication

Does the history explain itself?

Message quality measures whether a commit identifies its scope, purpose, rationale, testing, and supporting references. It does not change the security-severity score.

66/100 average clarity
252Strong · 80–100
675Adequate · 60–79
388Thin · 40–59
46Opaque · 0–39
2security candidates with opaque commit messaging
Read the scoring rubric →
Developer activity

Who is changing the project?

Public Git author strings; identities are not independently verified.

DeveloperCommitsCandidatesAnalyzedHigh riskMessage avg.
SomberNight42533373163
ThomasV16511104163
ghost4376626170
f321x44128400070
Sander van Grieken12412112057
Felix54720070
user323062
ekzyis222053
accumulator28111072
Roman Zeyde515053
Sasha Zykov515075
Aaron Fiore414068
Analysis record

Published AI watches

Last scanned 32 minutes ago

Informational 19 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11172 from accumulator/qml_crash_reporter_threading

This is a small bug-fix patch for Electrum's QML (mobile-style) graphical interface. The crash reporter was not correctly handling exceptions that come from Python's threading system, which could cause the crash reporter itself to misbehav…

Fixes incorrect exception argument handling in crash reporterPrevents potential secondary failure in error-reporting pathNo security boundary crossed; no input from untrusted source is processed
45ad42f7by Felix+4−11 file
No security note in commit
Informational 19 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

qml: crash reporter: handle threading.excepthook arguments

This commit fixes a bug in Electrum's mobile-style QML crash reporter. When an uncaught exception occurred inside a background thread, the crash reporter itself would break because it expected three pieces of information but received one b…

Crash reporter failure could hide or obscure real runtime errors in background threadsNo input validation, privilege boundary, or cryptographic issue presentFix improves diagnostic fidelity but does not close an attack vector
2e7fe460by Sander van Grieken+4−11 file
No security note in commit
Low 40 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11154 from spesmilo/make_unsigned_tx_with_base_tx

This commit changes how Electrum creates unsigned Bitcoin transactions when an existing 'base transaction' is provided. Previously, the wallet wrongly demanded spendable coins even when the caller supplied a base transaction that already c…

Relaxation of input-source preconditionAddition of consensus-level invariant assertion (at least one input)Addition of empty-input guard before PartialTransaction construction
ff273162by ThomasV+4−11 file
No security note in commit
Low 29 AI analysisMessage 68 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

wallet: make_unsigned_tx: follow-up prev

This commit fixes a crash in Electrum's transaction builder. If a user had only one on-chain coin (UTXO) that was just enough to meet a reserve requirement, clicking 'Max' in the send tab would hit an internal assertion and fail instead of…

Denial-of-service-like crash path triggered by user action in normal wallet stateAssertion failure reachable through GUI send flowFix converts assertion crash into handled NotEnoughFunds exception
462f631dby SomberNight+2−01 file
No security note in commit
Low 28 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11097 from SomberNight/202610_bump_deps

This is a routine maintenance commit that updates many of Electrum's software building blocks (dependencies) and raises the minimum required Python version from 3.10 to 3.11. It also refreshes the Linux distribution snapshots used to build…

Dependency version bumps for security-sensitive libraries (cryptography, cffi, libffi, sqlite)Removal of an embedded PGP public key and switch to hash verification for Windows Python installer downloadsBase image refresh from EOL/near-EOL Debian bullseye to bookworm for AppImage builds
84345fdcby ghost43+934−103048 files
No security note in commit
Informational 15 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11139 from accumulator/consolidate_platform_checks

This commit is a straightforward internal cleanup: it moves repeated checks like 'are we running on Windows?', 'are we on Android?', and 'are we inside an AppImage?' into a single new helper module called platform.py. The actual behavior o…

22e24580by ghost43+87−7619 files
No security note in commit
Informational 15 AI analysisMessage 45 · Thin
EL ElectrumElectrum BitcoinSoftware wallets

consolidate platform checks into platform.py

This commit is a straightforward internal cleanup: it moves repeated operating-system checks (Windows, macOS, Linux, Android, AppImage) into a single new helper module called platform.py and updates the rest of the code to use those helper…

9715f882by Sander van Grieken+87−7619 files
No security note in commit
Informational 15 AI analysisMessage 38 · Opaque
EL ElectrumElectrum BitcoinSoftware wallets

version: bump to 4.8.4

This commit only changes the software version number from 4.8.3 to 4.8.4 in a single file. It contains no security-related changes, no bug fixes, and no functional code modifications.

0c661eb8by f321x+1−11 file
No security note in commit
Low 29 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

make_unsigned_transaction: do not require coins if there is a base_tx

This commit relaxes a wallet check when creating a new Bitcoin transaction. Previously, Electrum refused to create a transaction if the user had no spendable coins and no explicit inputs. The change allows creation to continue if a 'base t…

Relaxation of input/coin availability guardAddition of post-construction input count assertionPotential workflow: Replace-By-Fee (RBF) or transaction bumping using base_tx inputs
876360deby ThomasV+2−11 file
No security note in commit
Informational 17 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11111 from accumulator/qml_bip39recovery_task_refactor

This commit is a code cleanup in Electrum's mobile-style QML wallet wizard. It replaces an older thread-based background scan for BIP39 seed accounts with a newer asyncio-based task approach, and makes the recovery dialog destroy itself wh…

Refactor of async task lifecycle and cancellation handlingDialog lifecycle cleanup with onClosed: destroy()Use of ignore_if_destroyed to avoid callbacks on destroyed QML objects
896a68d7by Felix+44−332 files
No security note in commit
Informational 12 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

qml: refactor BIP39 account scan to asyncio tasks.

This commit is a code cleanup in Electrum's mobile-style QML wallet wizard. It replaces an extra background thread with a simpler asyncio-based callback for scanning BIP39 seed accounts. There is no indication this fixes a security bug; it…

00ed883aby Sander van Grieken+44−332 files
No security note in commit
Moderate 59 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

qt: paytoedit: complete contacts to their key, not 'name <key>'

This commit fixes a bug in Electrum's Qt 'Send' tab where selecting a contact from the autocomplete dropdown could briefly leave the wrong recipient active. Previously, the payment field was set to a display name like 'Alice <alice@example…

UI state desynchronization between displayed recipient and active PaymentIdentifierStale PaymentIdentifier usable for ~1 second after recipient text changesPay/Save/Max buttons enabled while recipient is being edited
dd1b50fbby f321x+47−132 files
No security note in commit
Informational 18 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11092 from f321x/qml_address_history_labels

This commit fixes a UI bug in Electrum's QML (mobile-style) interface where transaction and address labels could become stale or fail to update after editing. It replaces a fragile manual callback system with a proper event listener so the…

No security-relevant signals in diff: no privilege escalation, injection, cryptographic, or authentication changes.Fixes a UI consistency bug (stale labels) that could mislead users but does not enable direct exploitation.Adds event-listener lifecycle management (register/unregister on destroy) to prevent dangling callbacks and potential use-after-free patterns.
9242c505by Felix+334−8412 files
No security note in commit
Low 34 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

qml: avoid potential Ok signal by tapping while dialog is closing,

This commit fixes a bug in Electrum's mobile-style QML password dialog. If a user tapped the OK/confirm button while the dialog was already closing, the app could emit an extra 'password entered' signal. That extra signal triggered a crash…

Crash in authentication-related code path (AuthMixin)Duplicate signal emission during UI state transitionUser-interaction race condition (tap while dialog closing)
00f981edby Sander van Grieken+8−01 file
No security note in commit
Informational 21 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11091 from f321x/fix_num_parents_perf_simple

This commit is a performance fix for a wallet function that traces where a transaction's funds came from. It replaces a slow, repeatedly-recursive approach with a more efficient loop and removes an old cache. The change also fixes how the …

Performance fix for wallet history traversalAddress-reuse uncle detection logic changedCache removed in favor of iterative computation
4ec70746by ThomasV+82−463 files
No security note in commit
Informational 24 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11047 from fametrano/old-seed-odd-length

This commit fixes a bug where Electrum wallets created with unusual, hand-crafted 'old-style' seed phrases could not be opened or used. These seeds decode to an odd number of hex characters, which the program previously rejected. The chang…

Input validation relaxed for legacy data (odd-length hex strings)New user-facing error path prevents seed display when mnemonic encoding is impossibleGUI exception handling narrowed: UserFacingException shown as str, other Exception as repr
fc31115eby ghost43+93−157 files
No security note in commit
Informational 19 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11096 from f321x/followup_11094

This commit is a small follow-up cleanup. It translates several user-facing error messages into different languages and makes the Qt GUI handle one specific file-read/write error (StorageReadWriteError) more gracefully, showing a warning d…

Exception-handling path changed in GUIUser-facing error messages internationalizedNo changes to encryption, wallet parsing semantics, or permissions
54c355feby Felix+9−75 files
No security note in commit
Informational 23 AI analysisMessage 73 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

Merge pull request #11094 from devdavidejesus/fix-10760-storage-not-utf8

This commit improves Electrum's error handling when a user tries to open a file that is not a valid Electrum wallet. Previously, if the file contained bytes that were not valid UTF-8 text, the program would crash with a confusing technical…

Error-handling hardeningUser-facing exception message improvedNo cryptographic or parsing logic changed
2a20256fby Felix+10−12 files
No security note in commit
Informational 20 AI analysisMessage 65 · Adequate
EL ElectrumElectrum BitcoinSoftware wallets

qt: show StorageReadWriteError to user instead of crash reporting it

This is a small user-interface fix in Electrum's Qt desktop app. Previously, if the wallet file was on a read-only folder or an unplugged drive, the app treated the resulting StorageReadWriteError as an unexpected crash and sent a crash re…

No memory safety, cryptographic, or authorization changesException handling change only; no new attack surface introducedCrash-reporting no longer triggered for expected I/O failure scenarios
5a971b11by f321x+2−11 file
No security note in commit
Low 26 AI analysisMessage 45 · Thin
EL ElectrumElectrum BitcoinSoftware wallets

keystore: follow-up prev: small clean-up

This commit is a small follow-up cleanup in Electrum's keystore code. It renames an internal helper function, makes the code accept certain unusual 'old' seed phrases that some users created by hand, improves an error message shown to user…

Refactoring of seed validation helperUser-facing error handling improvement in seed displayGrandfathering of non-standard old seed phrases
ead42d09by SomberNight+35−154 files
No security note in commit
Repository ledger

Explore captured commits

Expand any commit for its author, full message, clarity score, changed files, triage signals, analysis, and source link.

Lower-prioritytrivial follow-up: add more type-hintsby SomberNight · e5930dd5 · Aug 21, 2025 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · SomberNight

trivial follow-up: add more type-hints

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds Python type-hints and renames a loop variable from 'v' to 'sweep_info' for clarity. It does not change any program behavior, logic, or security properties.

Lower-priorityreverse swaps: in the CLI, replace 'server_mining_fee' with 'prepayment', which corresponds to the trusted part of the lightning payment.by ThomasV · 864932c7 · Aug 21, 2025 · 6 filesMessage 73 · AdequateLow 28Details
Commit message · ThomasV

reverse swaps: in the CLI, replace 'server_mining_fee' with
'prepayment', which corresponds to the trusted part of the
lightning payment.

We use 2*sm.mining_fee, where 'mining_fee' is the flat part of
the server fee. However, future protocol should probably allow
to set a value that does not depend on 'mining_fee'.
(note that LND uses a hardcoded amount).

73/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 28/100

This commit renames and doubles a fee parameter used when doing reverse submarine swaps (a way to move funds from Lightning back to on-chain Bitcoin) in the Electrum wallet. The old name suggested it was just the swap provider's mining fee; the new name, 'prepayment', reflects that the user must pay this amount upfront over Lightning and trust the provider to return it if the swap fails. The change is mostly a terminology and parameter refactor, but it also adjusts the safety check so the allowed prepayment equals twice the mining fee rather than twice the prepayment. There is no direct evidence in the commit that this fixes an active security vulnerability.

Lower-prioritytxbatcher: to_sweep_now should be a listby ThomasV · 08ea8212 · Aug 21, 2025 · 1 fileMessage 45 · ThinInformational 23Details
Commit message · ThomasV

txbatcher: to_sweep_now should be a list

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 23/100

This commit is a small internal cleanup in Electrum's transaction batching code. It changes how sweep inputs are tracked—from using string-based keys to using proper transaction-outpoint objects and lists. The change appears to prevent a potential mismatch or bug where the wrong input could be removed from a batch, but it is not a clear, exploitable security vulnerability on its own. It is more likely a correctness/robustness fix.

Lower-prioritylnworker: (trivial) get_payment_bundle to not return Noneby SomberNight · c1d2fc2b · Aug 21, 2025 · 1 fileMessage 50 · ThinLow 29Details
Commit message · SomberNight

lnworker: (trivial) get_payment_bundle to not return None

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 29/100

This is a tiny one-line fix in Electrum's Lightning code. A helper function that looks up groups of related payments now returns an empty list instead of 'None' when nothing is found. This mainly prevents other code that expects a list from mishandling the result, which could reduce bugs or minor errors but is not a clear security vulnerability on its own.

Lower-prioritycommands: use format_satoshis consistently. don't use sci-notationby SomberNight · 74cd2b4a · Aug 21, 2025 · 3 filesMessage 65 · AdequateInformational 23Details
Commit message · SomberNight

commands: use format_satoshis consistently. don't use sci-notation

old behaviour:
```
>>> from electrum.commands import format_satoshis
>>> format_satoshis(1)
'1E-8'
```

65/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
AI analysis · Informational 23/100

This commit fixes a formatting bug in Electrum's command-line output where very small bitcoin amounts were displayed in scientific notation (like '1E-8' instead of '0.00000001'). This is a usability and correctness fix that makes wallet balances and transaction values display consistently. It is not a direct security vulnerability, but scientific notation in financial outputs could theoretically confuse users or downstream scripts that parse amounts.

AI review queuedtxbatcher: add comment to _to_pay_afterby SomberNight · 6d99717d · Aug 21, 2025 · 3 filesMessage 45 · ThinInformational 15Details
Commit message · SomberNight

txbatcher: add comment to _to_pay_after

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: security-sensitive path
AI analysis · Informational 15/100

This commit is a minor code-quality change. It adds a clarifying comment to a payment-batching helper, makes a type annotation more specific, and adds a hash method to a transaction output class so outputs can be used in sets or as dictionary keys. There is no security fix or behavior change visible in the diff.

Lower-priorityswaps: stop sending whole req exception to clientby f321x · aa661da9 · Aug 21, 2025 · 1 fileMessage 45 · ThinLow 42Details
Commit message · f321x

swaps: stop sending whole req exception to client

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 42/100

This commit changes how Electrum's submarine swap server reports errors back to clients over Nostr. Previously, the server sent the first 100 characters of the actual exception message, which could leak internal details such as file paths, variable names, or other server-side information. Now it only sends the exception type (for example, 'ValueError') with a generic 'Internal Server Error' label. This is a hardening fix that reduces information disclosure but does not by itself stop an attacker from exploiting the underlying bug that caused the exception.

Lower-priorityswaps: rate limit swapserver requestsby f321x · 9086f1af · Aug 21, 2025 · 1 fileMessage 45 · ThinLow 46Details
Commit message · f321x

swaps: rate limit swapserver requests

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 46/100

This commit adds a speed bump to Electrum's submarine swap server. Previously, every incoming Nostr swap request was handled immediately in the message-reading loop, which could let an attacker flood the server with requests and potentially exhaust resources or cause errors. Now requests are placed in a small queue (max 5) and processed only once every 5 seconds, with extra requests dropped. This is a defensive rate-limiting patch, but the commit message does not call it a security fix and no external advisory is provided.

Lower-prioritytests: regtest: add swapserver mining fee argumentby f321x · 990a56b9 · Aug 21, 2025 · 1 fileMessage 60 · AdequateInformational 15Details
Commit message · f321x

tests: regtest: add swapserver mining fee argument

60/100 · AdequateMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only updates a test script for Electrum's regression testing. It changes how a test command calls the reverse-swap feature by adding an explicit provider mining fee argument taken from a prior dry-run. There is no change to production wallet code, no user-facing behavior change, and no security fix or vulnerability evident.

Lower-prioritytests: unittest get_submarine_swap_providers cliby f321x · 8c8d1423 · Aug 21, 2025 · 1 fileMessage 45 · ThinInformational 15Details
Commit message · f321x

tests: unittest get_submarine_swap_providers cli

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Mentions testing or verification! No meaningful explanatory body
AI analysis · Informational 15/100

This commit only adds a new automated test for an existing command in Electrum. It does not change any production code, fix a bug, or alter behavior visible to users. There is no security relevance.

Lower-prioritycommands: add command to fetch nostr swap providersby f321x · 5bb9b71b · Aug 21, 2025 · 1 fileMessage 50 · ThinInformational 19Details
Commit message · f321x

commands: add command to fetch nostr swap providers

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 19/100

This commit adds a new Electrum command that lets users discover submarine swap providers over the Nostr peer-to-peer network. It also adds safety checks so users must configure a provider before performing swaps, and replaces an indefinite wait with a 15-second timeout. There is no obvious vulnerability in the diff itself; it is a feature addition with minor hardening.

Lower-prioritytxbatcher: be careful when removing local transactionsby ThomasV · 5f30f2a0 · Aug 21, 2025 · 2 filesMessage 85 · StrongModerate 69Details
Commit message · ThomasV

txbatcher: be careful when removing local transactions

1. Do not remove local transaction in find_base_tx.

This logic was intended to cleanup claim transactions that are
never broadcast (for example, if the counterparty gets a refund)
(see 1bf1de36cbbab3ef9bd06bf5009074f11f0d456d)

However, this code is too unspecific and may result in fund loss,
because the transaction being removed may contain outgoing payments.
For example, if the electrum server is not responsive, the tx will
be seen as local and deleted. In that case, another payment will
be attempted, thus paying twice.

2. Do not remove tx after try_broadcasting returns False.

The server might be lying to us. We can only remove the local tx
if there is a base_tx, because the next tx we create will try to
spend the same output.

85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
AI analysis · Moderate 69/100

This commit fixes a bug in Electrum's transaction batching code that could accidentally delete a transaction that had already been sent to the Bitcoin network. If the Electrum server was slow, unresponsive, or dishonest, the wallet could think a payment was never broadcast, remove it from local records, and then create and send a second payment for the same thing—effectively paying twice and losing funds. The fix stops the wallet from automatically removing 'local' transactions in two risky situations and instead tries to rebroadcast them safely.

Lower-prioritylogging: add config.LOGS_MAX_TOTAL_SIZE_BYTES: to limit size on diskby SomberNight · 7046a7e7 · Aug 20, 2025 · 2 filesMessage 50 · ThinInformational 18Details
Commit message · SomberNight

logging: add config.LOGS_MAX_TOTAL_SIZE_BYTES: to limit size on disk

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 18/100

This commit adds a disk-space cap for Electrum's debug log files. It changes how old logs are cleaned up on startup and switches the active log file to a rotating handler so individual files cannot grow without bound. There is no direct security vulnerability being fixed; it is a hardening/operational improvement to prevent logs from filling up the disk.

Lower-prioritycommands: reverse_swap: don't require provider_mining_fee in dryrunby SomberNight · 2f1e3730 · Aug 20, 2025 · 1 fileMessage 50 · ThinInformational 18Details
Commit message · SomberNight

commands: reverse_swap: don't require provider_mining_fee in dryrun

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Informational 18/100

This commit fixes a small user-interface bug in Electrum's command-line reverse-swap command. It makes the provider_mining_fee argument optional during a 'dryrun' preview, and corrects a typo in an error message. There is no direct evidence this is a security vulnerability.

Lower-priorityswaps: add sanity check to reverse swap mining feeby f321x · 71c71a96 · Aug 20, 2025 · 4 filesMessage 50 · ThinModerate 59Details
Commit message · f321x

swaps: add sanity check to reverse swap mining fee

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Moderate 59/100

This commit tightens how Electrum handles reverse submarine swaps (a way to move funds from Lightning back to on-chain Bitcoin). Previously, the swap code relied on the current provider fee stored in memory, which could change between the moment the user saw a quote and the moment the swap was executed. The patch makes the GUI and command-line pass the exact mining fee the user was shown into the swap logic, and adds a sanity check that the provider cannot charge more than twice that shown fee. This reduces the risk of a malicious or misconfigured swap provider surprising the user with unexpectedly high fees right before the swap completes.

Lower-priorityswaps: add sanity-check for total swap costsby SomberNight · bb39ca55 · Aug 20, 2025 · 2 filesMessage 45 · ThinLow 49Details
Commit message · SomberNight

swaps: add sanity-check for total swap costs

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 49/100

This commit adds a safety guard for Electrum's submarine swaps. Before finalizing a swap, the wallet now checks whether the fees/costs look wildly unreasonable (for example, losing more than 25% of the amount, or over 1 million satoshi in absolute terms). If the costs look insane, the wallet stops and shows the user an error instead of proceeding. The change is defensive and does not appear to fix a known exploited bug, but it reduces the risk of a malicious or misconfigured swap server causing the user to lose funds.

Lower-priorityswaps: improve prepayment invoice handlingby f321x · 04b0aca8 · Aug 20, 2025 · 1 fileMessage 45 · ThinLow 47Details
Commit message · f321x

swaps: improve prepayment invoice handling

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 47/100

This commit tightens how Electrum handles upfront 'prepayment' invoices for submarine swaps (a way to exchange on-chain and Lightning bitcoin). Previously the client calculated the prepayment using a local transaction-batcher fee estimate and had no check on what the swap server actually charged in its fee invoice. The patch switches the prepayment calculation to a known 'mining_fee' value and, crucially, rejects the swap if the server's fee invoice exceeds twice that announced mining fee. This closes a path where a malicious or buggy swap server could demand a larger prepayment than the user expected.

Lower-prioritylnworker: limit max number of incoming channel-less peersby SomberNight · df96f87e · Aug 19, 2025 · 1 fileMessage 50 · ThinModerate 62Details
Commit message · SomberNight

lnworker: limit max number of incoming channel-less peers

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Moderate 62/100

This commit adds a cap on how many incoming Lightning Network peers without channels can connect to an Electrum node at once. Before this change, an attacker could potentially open unlimited incoming peer connections, consuming memory, CPU, and network resources and possibly disrupting normal operation. The fix limits such peers to 100 and closes new connections once that limit is reached. It also fixes a related bug where an existing initialized peer connection was not being closed when a duplicate arrived.

AI review queuedlnpeer: rate-limit ordered_message_queuesby SomberNight · 1380ed4b · Aug 19, 2025 · 1 fileMessage 35 · OpaqueModerate 63Details
Commit message · SomberNight

lnpeer: rate-limit ordered_message_queues

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Moderate 63/100

This commit tightens how Electrum's Lightning peer handler accepts and queues certain ordered messages. It caps per-channel message queues at 10 entries, rejects ordered messages for unknown channels, and limits a temporary-channel tracking dictionary that previously grew without cleanup. These changes reduce the risk that a malicious or misbehaving peer could exhaust memory or fill queues to disrupt the node.

AI review queuedlnpeer: rate-limit reply_channel_rangeby SomberNight · b8d989e1 · Aug 19, 2025 · 1 fileMessage 35 · OpaqueLow 46Details
Commit message · SomberNight

lnpeer: rate-limit reply_channel_range

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
second-pass: opaque commit message
AI analysis · Low 46/100

This commit adds a rate limit to how many unsolicited or rapid 'reply_channel_range' messages Electrum will accept from a Lightning peer. Previously, the queue that stores these replies was always created when the peer object was set up, so a remote peer could keep sending replies even when Electrum never asked for them, potentially filling memory or causing the program to fall behind. Now the queue is only created while Electrum is actively waiting for a reply, and if too many replies pile up the code slows the peer down. This looks like a hardening fix against a denial-of-service or memory-pressure issue, but the commit message does not call it a security fix.

Lower-prioritylnpeer: slow down peers sending too much gossipby SomberNight · 65d04dfb · Aug 19, 2025 · 1 fileMessage 45 · ThinModerate 55Details
Commit message · SomberNight

lnpeer: slow down peers sending too much gossip

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Moderate 55/100

This commit adds a speed limit and queue cap for Lightning network gossip messages received from peers. Before the change, a malicious or misconfigured peer could flood an Electrum node with unbounded gossip traffic, potentially consuming memory and CPU and slowing or crashing the program. The patch bounds the queue size, slows processing when the queue grows, and disconnects peers that overflow it. It also clarifies whether gossip was requested by us versus sent unsolicited by the peer.

Lower-priorityswaps: nostr: add sanity checks for repliesby SomberNight · 93e0e8a7 · Aug 19, 2025 · 1 fileMessage 45 · ThinModerate 57Details
Commit message · SomberNight

swaps: nostr: add sanity checks for replies

45/100 · ThinMessage clarity
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Moderate 57/100

This commit tightens how Electrum's submarine-swap client matches Nostr direct-message replies to the requests it sent out. Previously, the client keyed pending replies only by the original event ID. That could let a malicious or misconfigured relay/peer inject a reply from a different swap server and have it accepted. The patch now also checks the reply author's public key, so replies are only accepted from the server that was actually asked. It is a defensive hardening fix rather than a complete exploit chain.

Lower-prioritysubmarine_swaps: use dict instead of defaultdict for dm_repliesby ThomasV · eae6ddd7 · Aug 19, 2025 · 1 fileMessage 50 · ThinLow 40Details
Commit message · ThomasV

submarine_swaps: use dict instead of defaultdict for dm_replies

50/100 · ThinMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
AI analysis · Low 40/100

This commit changes how Electrum's submarine swap feature tracks expected direct-message replies from Nostr relays. Previously, accessing any unknown reply ID would automatically create a placeholder 'Future' object. Now, only the client creates a Future for a specific request it sent, and only the client resolves replies, with checks that the reply ID is known. This prevents a potential issue where a malicious or buggy relay/server could create or manipulate placeholder reply entries by sending crafted messages.

AI review queuedswaps: more robust parsingby SomberNight · 81be0554 · Aug 19, 2025 · 3 filesMessage 35 · OpaqueModerate 58Details
Commit message · SomberNight

swaps: more robust parsing

35/100 · OpaqueMessage clarity
✓ Descriptive subject! No meaningful explanatory body
Why it was queued
signing or wallet pathsecond-pass: opaque commit messagesecond-pass: security-sensitive path
AI analysis · Moderate 58/100

This commit hardens how Electrum parses data received from external swap servers and Nostr direct messages. It adds type checks so that fields that should be dictionaries, integers, or valid Bitcoin addresses are rejected if malformed. Without these checks, a malicious or compromised swap server could send unexpected data types (for example, a string where a number is expected, or a non-address string as a lockup address) that might cause crashes, incorrect transaction construction, or potentially trick the wallet into sending funds to the wrong place. The commit does not fix a single known exploit; it is a broad defensive-hardening patch.

Lower-priorityswaps: handle timeouts in send_direct_messageby f321x · 37614e90 · Aug 19, 2025 · 1 fileMessage 68 · AdequateLow 32Details
Commit message · f321x

swaps: handle timeouts in send_direct_message

Adds logic to retry sending a direct message in
`NostrTransport.send_direct_message()` on `TimeoutError`.
Handles `TimeoutError` exception more gracefully by catching it and
returning `None`.

68/100 · AdequateMessage clarity
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
AI analysis · Low 32/100

This commit improves how Electrum's submarine-swap feature handles network timeouts when sending direct messages over Nostr. Previously, a timeout while publishing a swap offer or sending an encrypted request could crash or hang the process. Now the code catches the timeout, logs a warning, optionally retries, and returns None if it still fails. Callers are updated to raise a proper SwapServerError instead of hanging. This is a robustness fix rather than a fix for a clear exploitable vulnerability.