1
0
Commit Graph

288 Commits

Author SHA1 Message Date
SomberNight
83750a861f ledger: bump min btchip-python (0.1.30->0.1.32)
So that it has https://github.com/LedgerHQ/btchip-python/pull/42

fixes #6928
2021-02-12 05:28:01 +01:00
SomberNight
b56fe237cd ledger: give clear error that old HW.1 cannot send to bech32 address
maybe related #7022
2021-02-12 04:47:53 +01:00
Gordan Nekić
9c4807644b Fix ledger sign message (#7004)
there was an around ~1/128 chance of creating an invalid signature when signing a message with a ledger
2021-02-06 05:16:52 +00:00
ThomasV
641968fcf8 Wizard: do not ask seed type, default to segwit
segwit addresses are widely supported today.
2021-01-12 11:03:21 +01:00
SomberNight
2eb02931ae hw plugins: log exception at import time (but only if interesting)
related: https://github.com/spesmilo/electrum/issues/6928
2021-01-11 00:05:23 +01:00
Peter D. Gray
e829f2a0bc plugins/coldcard/coldcard.py: include derivation path for each part of multisig (for v3.2.1 of firmware) 2021-01-08 13:16:54 -05:00
Peter D. Gray
a810bc50be plugins/coldcard/README.md: updates and cleanup 2021-01-08 13:16:13 -05:00
SomberNight
b28b3994c7 qt: move window.get{Open,Save}FileName to util
Sometimes we want its "remember path" behaviour but it does not make sense to
parent the dialog from main window. When so, caller code no longer needs to
get a reference to a main window.

Also rm last usages of get_parent_main_window().
2020-12-20 15:25:35 +01:00
SomberNight
096d853482 qt: rm some usages of get_parent_main_window
instead, pass around the main window or config (whichever is actually needed)

fixes #6342
2020-12-20 15:25:31 +01:00
SomberNight
d1302d3384 mnemonic: tighten seed_type check for old "2fa" type seeds
Seeds in the set difference could already not be restored: they raised
an exception in the wizard; now these are not recognised as valid seeds
anymore (so e.g. OK button in wizard will be disabled).
Also see comments in code.
2020-12-10 14:36:31 +01:00
SomberNight
1851ec962f trustedcoin: fix two-step wallet creation (offline->online)
got broken in c46fbf08a5
2020-12-09 18:31:08 +01:00
SomberNight
95b08e9961 plugins: remove 'on_new_window' hook 2020-12-08 10:33:43 +01:00
SomberNight
933d8861ce mnemonic.make_seed: de-duplicate num_bits default magic number 2020-12-08 10:00:34 +01:00
ThomasV
427779350f Trustedcoin: call wizard.terminate with aborted set to True in various failure conditions (see #4496) 2020-11-29 11:43:33 +01:00
Marko Bencun
b78b077606 bitbox02: more robust account keypath
In multisig, we plan to allow other kinds of keypaths that are not
exactly 4 elements long. This change allows parsing the account
keypath for any kind of keypath, assuming the last two element are /change/address.
2020-11-23 14:32:04 +01:00
SomberNight
b78cbcffd1 ledger: fix enumerating ledger devices with new bitcoin app (1.5.1)
see https://github.com/bitcoin-core/HWI/issues/402
2020-11-18 15:36:11 +01:00
SomberNight
f3c1313a4f coldcard: avoid creating keystore with testnet/mainnet mixed up
fixes #6722
2020-11-18 00:47:20 +01:00
SomberNight
c616c3bfad plugins/labels: better error message when using imported wallets
see #6703
2020-11-05 01:59:19 +01:00
ghost43
8e9d6a4c91 Merge pull request #6685 from SomberNight/202010_bitcoin_script
bitcoin/transaction: construct_script, and clean-ups
2020-10-24 23:06:55 +00:00
SomberNight
200f547a07 ledger: fix compat with hw.1 - signing flow deadlocked
broke in 8a1b46d839ac24f77bfa5e3a1eed0cb7284b59eac5b685854c517f224c98dc44
2020-10-24 23:32:18 +02:00
SomberNight
eefb68c82b transaction: change Transaction.is_segwit_input(txin) to txin.is_segwit() 2020-10-24 08:03:13 +02:00
Marko Bencun
a8f8175674 plugins/bitbox02: add support for signing a message 2020-10-14 20:33:54 +02:00
Marko Bencun
8fa019f65b plugins/bitbox02: add support for p2wsh-p2sh multisig 2020-10-14 20:33:54 +02:00
Marko Bencun
2c0ae4abdd contrib/requirements/requirements-hw.txt: bump bitbox02 dep to 5.0.0
Adds the api functions to sign a message and use p2wsh-p2sh legacy
segwit multisig.
2020-10-14 20:33:54 +02:00
SomberNight
4b6c86ecbe wallet: make labels private, and access to need lock
e.g. labels plugin iterated over wallet.labels on asyncio thread while user could trigger an edit from Qt thread
2020-10-13 18:57:55 +02:00
SomberNight
e60aede77e ledger: workaround to avoid on-device warning for unusual der path
related: #6512
2020-10-06 17:55:29 +02:00
ghost43
21c3572600 hardware devices: run all device communication on dedicated thread (#6561)
hidapi/libusb etc are not thread-safe.

related: #6554
2020-09-08 15:52:53 +00:00
SomberNight
a7199696d3 json_db: exempt keystore from StoredDict conversion
The keystore logic would need to be significantly changed to nicely
interoperate with StoredDict/json_db logic.
(just see KeyStore.__init__() and KeyStore.dump())
For now we exempt the keystore from the recursive StoredDict conversion, as
it is a smaller change that is also easier to review for correctness.

fixes #6066
fixes #6401

also reverts 2d3c2eeea9 (which was an even hackier workaround for #6066)
2020-09-04 16:11:01 +02:00
SomberNight
f36cc5b6e0 trezor: cache whether TrezorBridge is available to speedup scan_devices
If the Bridge is unavailable, on my machine it takes 2 seconds to timeout.
i.e. call_bridge("enumerate") and BridgeTransport.enumerate() both take 2 seconds each.
With this change, if the Bridge is unavailable, DeviceMgr.scan_devices() takes 4 seconds less.
In below log, with 6 different hw devices connected, scan time was originally ~7.5 seconds;
with this change it became ~3.5 seconds.

Now the time is dominated by WebUsbTransport.enumerate(), called by Trezor,
KeepKey, SafeT, ~1.1 seconds each.

-----

I | plugin.DeviceMgr | scan_devices() entered. 1598666278.6756
I | plugin.DeviceMgr | scan_devices(). _scan_devices_with_hid() DONE. 1598666278.7583
I | plugin.DeviceMgr | scan_devices(). starting custom enumeration loop. 1598666278.7593
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method SafeTPlugin.enumerate of <electrum.plugins.safe_t.qt.Plugin object at 0x000001F60060A730>>. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration entered. 1598666279.9345
I | plugins.trezor.qt.Plugin | trezor custom enumeration. call_bridge('enumerate') DONE. 1598666281.9385
>> trezorlib enumerating <class 'trezorlib.transport.bridge.BridgeTransport'> DONE at 1598666283.9500.
>> trezorlib enumerating <class 'trezorlib.transport.webusb.WebUsbTransport'> DONE at 1598666285.0427.
>> trezorlib enumerating <class 'trezorlib.transport.hid.HidTransport'> DONE at 1598666285.1198.
>> trezorlib enumerating <class 'trezorlib.transport.udp.UdpTransport'> DONE at 1598666285.1237.
I | plugins.trezor.qt.Plugin | trezor custom enumeration. trezorlib.transport.enumerate_devices() DONE. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method TrezorPlugin.enumerate of <electrum.plugins.trezor.qt.Plugin object at 0x000001F60C16F4C0>>. 1598666285.1257
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method KeepKeyPlugin.enumerate of <electrum.plugins.keepkey.qt.Plugin object at 0x000001F60BADF130>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration iter DONE, for <bound method ColdcardPlugin.detect_simulator of <electrum.plugins.coldcard.qt.Plugin object at 0x000001F60BAA5AC0>>. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). custom enumeration loop DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). find out what was disconnected DONE. 1598666286.2251
I | plugin.DeviceMgr | scan_devices(). Unpair disconnected devices DONE. 1598666286.2251
2020-08-29 04:22:55 +02:00
SomberNight
c313c702fd qt wallet>info: use QStackedWidget, one stack item for each keystore
Instead of single mpk_text widget for each ks and changing the contents
when switching, create an mpk_text widget for each ks and switch between those.
This allows putting the "show xpub on device" button inside mpk_text.
2020-08-28 20:10:58 +02:00
matejcik
a669c6b765 trezor: use init_device instead of ping to check connection (fixes #6457) (#6471) 2020-08-25 14:34:42 +00:00
aaronisme
3ed5f32c6c fix the coldcard multi-sig show address issue 2020-08-18 15:42:39 +08:00
Marko Bencun
061305cd97 bitbox02: add fingerprint to label
See comment in commit.
2020-07-15 15:41:27 +02:00
Marko Bencun
c0ad40b562 bitbox02: implement label()
So the device can be identified more easily in dialogs.
2020-07-15 15:41:27 +02:00
Marko Bencun
5457abfab5 bitbox02: drop unused wizard argument 2020-07-15 15:41:25 +02:00
Marko Bencun
106688ea54 bitbox02: implement get_soft_device_id so multisig runs more smoothly
Without it, if you have say a 1-of-2 multisig with two BitBox02s, you
would run into trouble if the first keystore would try to match to the
wrong inserted BitBox02 (wrong order, or the first one is not
inserted, etc. ).

With the soft device id, the device manager can figure it on its own
which keystore belongs to which connected bb02.
2020-07-15 15:41:09 +02:00
ghost43
4aed1df0e8 Merge pull request #6293 from btchip/ledger_segwit_trustedinputs
Ledger : Remove warning on Segwit inputs and newer Bitcoin application, use generic signing for P2SH inputs
2020-07-02 10:47:32 +00:00
SomberNight
b042c4118f ledger: speed-up sign_transaction
really slow to scan usb devices for e.g. every tx input...
if user disconnects mid-signing, we would fail anyway.
2020-07-02 12:45:42 +02:00
SomberNight
48993118ad ledger: bump min btchip-python version
and minor simplification
2020-07-02 12:45:38 +02:00
ghost43
db063517ec Merge pull request #6309 from benma/bitbox02
plugins/bitbox02: fix compatibility with bitbox02-4.0.0
2020-07-01 16:49:03 +00:00
Marko Bencun
b1e756ac96 plugins/bitbox02: fix compatibility with bitbox02-4.0.0 2020-07-01 17:49:53 +02:00
zebra-lucky
949b247b19 fix raise UserCacnelled calls (#6304) 2020-07-01 15:37:31 +00:00
SomberNight
7a6ec23b6e cosigner pool: use single thread to send messages
ServerProxy does not seem to be thread-safe.
For e.g. a 2of3 multisig wallet, which would send two messages,
one msg would get sent but the other might error out. See trace:

E | plugins.cosigner_pool.qt.Plugin | on_failure
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\util.py", line 832, in run
    result = task.task()
  File "...\electrum\electrum\plugins\cosigner_pool\qt.py", line 199, in <lambda>
    task = lambda: server.put(_hash, message)
  File "...\Python38\lib\xmlrpc\client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "...\Python38\lib\xmlrpc\client.py", line 1450, in __request
    response = self.__transport.request(
  File "...\Python38\lib\xmlrpc\client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "...\Python38\lib\xmlrpc\client.py", line 1165, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
  File "...\Python38\lib\xmlrpc\client.py", line 1271, in send_request
    connection.putrequest("POST", handler, skip_accept_encoding=True)
  File "...\Python38\lib\http\client.py", line 1088, in putrequest
    raise CannotSendRequest(self.__state)
http.client.CannotSendRequest: Request-sent
2020-06-29 02:19:03 +02:00
SomberNight
1a9e6a434f cosigner pool: user certifi instead of system ssl cert store
related: https://github.com/spesmilo/electrum/issues/5678#issuecomment-650837465
2020-06-29 02:15:01 +02:00
BTChip github
c1101ee258 Remove warning on Segwit inputs and newer Bitcoin application, use generic signing for P2SH inputs 2020-06-27 18:26:54 +02:00
SomberNight
eb39aa143b try fixing email plugin 2020-06-13 19:12:22 +02:00
SomberNight
0b224ba685 invoices: minor clean-up (type hints, mark broken things)
also rm some dead code
2020-06-13 18:54:22 +02:00
ghost43
8e12b43b5d Merge pull request #6199 from benma/bb02
plugins/bitbox02: fix compatibility with bitbox02-3.0.0
2020-06-04 17:43:11 +00:00
SomberNight
db5cf22ff4 bitbox02: get prev tx from psbt instead of wallet db
- for symmetry with other plugins
- and because this is a superset. txin.utxo gets populated from the wallet db (or network);
  but the wallet db does not import txs from txin.utxo (so if a psbt already had an
  unknown tx there, it will not get imported)
2020-06-04 19:41:34 +02:00
SomberNight
dc6dbe5bfb HW_PluginBase: small clean-up for 'maximum_library' 2020-06-04 18:52:08 +02:00