From 7164f9fd6ea9f13a88ebbb4836162e9417f249a1 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Tue, 30 May 2023 23:55:21 +0200 Subject: [PATCH 1/3] bitbox02: update to 6.2.0 6.2.0 was released to put a minimum requirement on hidapi 0.14.0, which includes the fix for this issue: https://github.com/libusb/hidapi/issues/531 That bug caused hidapi on macOS 13.3 to report 0 as the interface number for all hid devices, which led to the bitbox02 multi edition being listed twice instead of once - once for the main HW wallet interface and once erroneously For the U2F interface (which should not be listed). --- contrib/requirements/requirements-hw.txt | 2 +- electrum/plugins/bitbox02/bitbox02.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/requirements/requirements-hw.txt b/contrib/requirements/requirements-hw.txt index 05cff1acc..36f310eed 100644 --- a/contrib/requirements/requirements-hw.txt +++ b/contrib/requirements/requirements-hw.txt @@ -22,7 +22,7 @@ hidapi ckcc-protocol>=0.7.7 # device plugin: bitbox02 -bitbox02>=6.0.0 +bitbox02>=6.2.0 # device plugin: jade cbor>=1.0.0,<2.0.0 diff --git a/electrum/plugins/bitbox02/bitbox02.py b/electrum/plugins/bitbox02/bitbox02.py index e07544213..1095c39da 100644 --- a/electrum/plugins/bitbox02/bitbox02.py +++ b/electrum/plugins/bitbox02/bitbox02.py @@ -631,7 +631,7 @@ class BitBox02_KeyStore(Hardware_KeyStore): class BitBox02Plugin(HW_PluginBase): keystore_class = BitBox02_KeyStore - minimum_library = (6, 0, 0) + minimum_library = (6, 2, 0) DEVICE_IDS = [(0x03EB, 0x2403)] SUPPORTED_XTYPES = ("p2wpkh-p2sh", "p2wpkh", "p2wsh", "p2wsh-p2sh") From dfed0ef54acd566cb8c375157a23c4611043bd8d Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Tue, 30 May 2023 23:56:27 +0200 Subject: [PATCH 2/3] bitbox02: display amounts in sats if Electrum's base unit is sat The BitBox02 has the ability to display all amounts in sats instead of BTC. This was introduced in v9.13.0. If Electrum is configured to show sats, we propagate this config to the BitBox02. This is backwards compatible: users with older firmware will see the values in BTC regardless of the config. --- electrum/plugins/bitbox02/bitbox02.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/electrum/plugins/bitbox02/bitbox02.py b/electrum/plugins/bitbox02/bitbox02.py index 1095c39da..320dd0e16 100644 --- a/electrum/plugins/bitbox02/bitbox02.py +++ b/electrum/plugins/bitbox02/bitbox02.py @@ -510,6 +510,12 @@ class BitBox02Client(HardwareClientBase): ) keypath_account = full_path[:-2] + + format_unit = bitbox02.btc.BTCSignInitRequest.FormatUnit.DEFAULT + # Base unit is configured to be "sat": + if self.config.get_decimal_point() == 0: + format_unit = bitbox02.btc.BTCSignInitRequest.FormatUnit.SAT + sigs = self.bitbox02_device.btc_sign( coin, [bitbox02.btc.BTCScriptConfigWithKeypath( @@ -520,6 +526,7 @@ class BitBox02Client(HardwareClientBase): outputs=outputs, locktime=tx.locktime, version=tx.version, + format_unit=format_unit, ) # Fill signatures From f284b42fa8f96e61374624f8d994a115c1cd78fa Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 30 May 2023 23:34:46 +0000 Subject: [PATCH 3/3] build: update pinned bitbox02 (partial rerun freeze_packages) --- contrib/deterministic-build/requirements-hw.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/deterministic-build/requirements-hw.txt b/contrib/deterministic-build/requirements-hw.txt index 542267c22..c7d01380e 100644 --- a/contrib/deterministic-build/requirements-hw.txt +++ b/contrib/deterministic-build/requirements-hw.txt @@ -1,9 +1,9 @@ base58==2.1.1 \ --hash=sha256:11a36f4d3ce51dfc1043f3218591ac4eb1ceb172919cebe05b52a5bcc8d245c2 \ --hash=sha256:c5d0cb3f5b6e81e8e35da5754388ddcc6d0d14b6c6a132cb93d69ed580a7278c -bitbox02==6.1.1 \ - --hash=sha256:99503409d6c61899f8e11eb11e7a29866b2754cb02c03acf34cdef99755aedd8 \ - --hash=sha256:f37f1e571f06aa0a4005441ca1948b53e68e3bef0b642963303b42810e2b1486 +bitbox02==6.2.0 \ + --hash=sha256:5a8290bd270468ccdf2e6ff7174d25ea2b2f191e19734a79aa573c2b982c266f \ + --hash=sha256:cede06e399c98ed536fed6d8a421208daa00f97b697bd8363a941ac5f33309bf btchip-python==0.1.32 \ --hash=sha256:34f5e0c161c08f65dc0d070ba2ff4c315ed21c4b7e0faa32a46862d0dc1b8f55 cbor==1.0.0 \