jade: Implement register_descriptor
What changed, and why it matters
This commit adds a missing feature to the Blockstream Jade hardware wallet driver in HWI: the ability to register a Bitcoin output descriptor on the device. It is a small, straightforward implementation of an existing interface method. There is no direct evidence in the commit of a security vulnerability, bug, or malicious change. The change appears to be a normal feature addition.
No immediate security action required. Reviewers may optionally verify that `descriptor.get_bip388_template()` and `get_bip388_key_info()` produce well-formed values and that the underlying Jade firmware's `register_descriptor` API handles malformed or oversized inputs safely. Consider adding unit tests for the new method.
Security signals we found
No security-relevant signals observed in the diff
Feature addition implementing an existing interface method
No input validation changes or cryptographic operations added in Python code
Empty registration blob returned may be by design for Jade firmware
Evidence from the diff
The patch implements register_descriptor() in hwilib/devices/jade.py. It imports Descriptor and RegisteredDescriptor from the descriptor module, computes a BIP-388 descriptor template and key-info map, and calls self.jade.register_descriptor() on the Jade device. The returned RegisteredDescriptor has an empty registration byte string, which is consistent with Jade’s native descriptor registration model. The change is additive and aligns with the existing HardwareWalletClient interface.
Changed components
hwilib/devices/jade.pyBlockstream Jade hardware wallet driverInspect captured patch +12 / −1
### hwilib/devices/jade.py
@@ -20,7 +20,11 @@
Tuple,
Union
)
-from ..descriptor import MultisigDescriptor
+from ..descriptor import (
+ Descriptor,
+ MultisigDescriptor,
+ RegisteredDescriptor,
+)
from ..hwwclient import HardwareWalletClient
from ..errors import (
ActionCanceledError,
@@ -530,6 +534,13 @@ def can_sign_taproot(self) -> bool:
"""
return False
+ @jade_exception
+ def register_descriptor(self, name: str, descriptor: 'Descriptor') -> RegisteredDescriptor:
+ template = descriptor.get_bip388_template()
+ datavalues = {f"@{p.expr_index}": p.get_bip388_key_info() for p in descriptor.get_pubkey_providers()}
+ self.jade.register_descriptor(self._network(), name, template, datavalues)
+ return RegisteredDescriptor(name=name, descriptor=descriptor, device_type="jade", registration=b"")
+
def enumerate(password: Optional[str] = None, expert: bool = False, chain: Chain = Chain.MAIN, allow_emulators: bool = False) -> List[Dict[str, Any]]:
results = []Why this scored 18/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.