HWI
HWI copied to clipboard
Support descriptor based commands & infer coin type
Current syntax:
./hwi.py --fingerprint=00000000 displayaddress "m/84h/1h/0h/0/0" --wpkh
Preferred (alternative) syntax:
./hwi.py displayaddress "wpkh([00000000/84h/1h/0h]tpubDDUZ..../0/0)"
-
--fingerprint
is in the descriptor -
--wpkh
is specified by the descriptor and doesn't require very fancy parsing -
--testnet
: this can be inferred from the use oftpub
instead ofxpub
, or from the coin type1h
Rationale: wallets should be able to call this command in a standardised fashion, with as few parameters as needed. E.g. Bitcoin Core could be patched to call this command after you register ../HWI/hwi.py
as a signer for 00000000
and do bitcoin-cli -rpcwallet=hww signerdisplayaddress <address>
(where address
might be the result of bitcoin-cli getnewaddress
)
In the above example tpub
is redundant and may or may not be provided. So it's probably better to rely on the coin type to infer testnet. In addition, we could / should throw if an xpub is present but doesn't actually match, because that suggests some sort of data corruption.