What changed, and why it matters
This commit only adds explanatory comments to two source files and makes a tiny, non-functional cleanup in a USB error handler (removing an unused exception variable). It also adds one line to the changelog noting a separate multisig address-format bugfix. The code changes themselves do not alter program behavior or fix any security issue.
No security action required. Treat as routine documentation/cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is documentation-only for chains.py (comments for af_to_bip44_purpose, addr_fmt_label, addr_fmt_str) and a trivial refactor in usb.py: except SpendPolicyViolation as e: becomes except SpendPolicyViolation: because e was unused, and a previously commented-out sys.print_exception(exc) is re-enabled in simulator/devmode for debugging. The changelog entry ‘Bugfix: Multisig address format handling’ is metadata about a different change and is not implemented in this commit.
Changed components
shared/chains.pyshared/usb.pyreleases/Next-ChangeLog.mdInspect captured patch +7 / −4
diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md
index 92442dd..4af423b 100644
--- a/releases/Next-ChangeLog.md
+++ b/releases/Next-ChangeLog.md
@@ -31,6 +31,7 @@ Spending policies for "Single Signers" adds new spending policy options:
- Bugfix: Fix filesystem initialization after Wife LFS or Destroy Seed.
- Bugfix: Fix MicroSD selftest code.
- Bugfix: NFC loop exporting secrets would not work after first value exported.
+- Bugfix: Multisig address format handling.
- Bugfix: Ownership check failing to find addresses near max (~760), needed to be re-run to succeed
# Mk4 Specific Changes
diff --git a/shared/chains.py b/shared/chains.py
index 8a35b1f..16fa756 100644
--- a/shared/chains.py
+++ b/shared/chains.py
@@ -463,19 +463,22 @@ def parse_addr_fmt_str(addr_fmt):
def af_to_bip44_purpose(addr_fmt):
- # single signature only
+ # Address format to BIP-44 "purpose" number
+ # - single signature only
return {AF_CLASSIC: 44,
AF_P2WPKH_P2SH: 49,
AF_P2WPKH: 84}[addr_fmt]
def addr_fmt_label(addr_fmt):
+ # Text used in menus
return {AF_CLASSIC: "Classic P2PKH",
AF_P2WPKH_P2SH: "P2SH-Segwit",
AF_P2WPKH: "Segwit P2WPKH"}[addr_fmt]
def addr_fmt_str(addr_fmt):
+ # Short string codes used for address format (industry standard)
return {AF_CLASSIC: "p2pkh",
AF_P2SH: "p2sh",
AF_P2WPKH: "p2wpkh",
diff --git a/shared/usb.py b/shared/usb.py
index e035093..3e89699 100644
--- a/shared/usb.py
+++ b/shared/usb.py
@@ -233,7 +233,7 @@ class USBHandler:
except CCBusyError:
# auth UX is doing something else
resp = b'busy'
- except SpendPolicyViolation as e:
+ except SpendPolicyViolation:
resp = b'err_Spending policy in effect'
except HSMDenied:
resp = b'err_Not allowed in HSM mode'
@@ -256,10 +256,9 @@ class USBHandler:
raise exc
except Exception as exc:
# catch bugs and fuzzing too
- # sys.print_exception(exc)
if is_simulator() or is_devmode:
print("USB request caused this: ", end='')
- # sys.print_exception(exc)
+ sys.print_exception(exc)
resp = b'err_Confused ' + problem_file_line(exc)
if not success:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.