You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Sweep: ship deterministic-nonce fix to master + make TLS verification fail closed
Context: Follow-up to closed PR #14 (sweep nonce non-determinism + TLS hostname verification). Two standalone, low-risk changes; neither is currently in a released build.
1. Sweep signing still uses a random nonce in the released build (v0.1.0) electrumsv/gui/qt/sweep_helper.py signs sweep inputs with ecdsa.SigningKey.sign_digest(...), which falls back to an os.urandom-based nonce when no k is supplied. On a weak/broken RNG, nonce reuse across the multiple inputs a single key signs in a sweep can allow private-key recovery. Every other signing path in the wallet already uses RFC6979 (bitcoinx PrivateKey.sign → libsecp256k1); the sweep path is the only exception.
master still has this line today; v0.1.0 AppImage ships it.
Your dev branch reportedly already signs sweeps via bitcoinx/libsecp256k1 — please merge that to master and cut a (minor) release. Shipping it is what actually closes the hole for users.
2. ElectrumX fallback effectively disables server authentication create_ssl_context() sets ctx.check_hostname = False while the socket's trust store includes the full certifi CA set. With hostname checks off and every public CA trusted, a MITM who obtains any public-CA-signed certificate can impersonate an ElectrumX server with no verification failure.
Proposed alternatives that keep current servers working and fail closed:
Load only the server-specific <host>.pem (and skip certifi for these sockets) while keeping check_hostname = True; or
Pin the exact server certificate/fingerprint (TOFU), failing on mismatch. Since this path is a direct TCP/TLS fallback, a dedicated pinned context is the safer design.
Long-term: move servers to CA-issued certs with correct SAN.
Impact of the current state is bounded (a MITM can feed wrong/incomplete UTXO data → failed or partial sweeps; it cannot forge signatures or divert funds), but it's below the bar we'd set for a wallet, and worth closing.
What I'd love from you
Merge/release the deterministic-nonce sweep signing (item 1).
Pick the pinned/fail-closed TLS approach you prefer for item 2 and let us know if you want help validating it.
Issue draft — TruthMachine/ElectrumSVP
Title: Sweep: ship deterministic-nonce fix to master + make TLS verification fail closed
Context: Follow-up to closed PR #14 (sweep nonce non-determinism + TLS hostname verification). Two standalone, low-risk changes; neither is currently in a released build.
1. Sweep signing still uses a random nonce in the released build (v0.1.0)
electrumsv/gui/qt/sweep_helper.pysigns sweep inputs withecdsa.SigningKey.sign_digest(...), which falls back to anos.urandom-based nonce when nokis supplied. On a weak/broken RNG, nonce reuse across the multiple inputs a single key signs in a sweep can allow private-key recovery. Every other signing path in the wallet already uses RFC6979 (bitcoinxPrivateKey.sign→ libsecp256k1); the sweep path is the only exception.masterstill has this line today; v0.1.0 AppImage ships it.masterand cut a (minor) release. Shipping it is what actually closes the hole for users.2. ElectrumX fallback effectively disables server authentication
create_ssl_context()setsctx.check_hostname = Falsewhile the socket's trust store includes the full certifi CA set. With hostname checks off and every public CA trusted, a MITM who obtains any public-CA-signed certificate can impersonate an ElectrumX server with no verification failure.check_hostname=Trueas-is — removing the flag alone would break them, as discussed in Fix sweep nonce non-determinism and disabled TLS hostname verification #14.<host>.pem(and skip certifi for these sockets) while keepingcheck_hostname = True; orWhat I'd love from you