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.
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
- 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)
Inform the user that they need to upgrade if their firmware version is
out of date.
The previous `check_device_firmware_version()` was dead code, and the
bb02 function called inside also does not exist.
This commit adds support for the BitBox02 hardware wallet.
It supports both single and multisig for the electrum gui wallet.
To use the plugin a local installation of the BitBox02 python library is
required. It can be found on PiPy under the name 'bitbox02' and can be
installed from the bitbox02-firmware repository in the py/bitbox02
directory.
All communication to and from the BitBox02 is noise encrypted, the keys
required for this are stored in the wallet config file under the
bitbox02 key.
The BitBox02 registers a multisig configuration before allowing
transaction signing. This multisig configuration includes the threshold,
cosigner xpubs, keypath, a variable to indicate for mainnet and testnet,
and a name that the user can choose during configuration registration.
The user is asked to register the multisig configuration either during
address verification or during transaction signing.
The check the xpub of the BitBox02 for other hardware wallets, a button
is added in the wallet info dialog.
The wallet encryption key is fetched in a separate api call, requiring a
slightly tweaked override version of the wallet encryption password.
scenario1:
- 2of2 multisig wallet with trezor1 and trezor2 keystores
- only trezor2 connected
- previously we would pair first keystore with connected device and then display error.
now we will pair the device with the correct keystore on the first try
scenario2:
- standard wallet with trezor1 keystore
- trezor2 connected (different device)
- previously we would pair trezor2 with the keystore and then display error.
now we will prompt the user to select which device to pair with (out of one)
related: #5789