HWI icon indicating copy to clipboard operation
HWI copied to clipboard

Support descriptor based commands & infer coin type

Open Sjors opened this issue 5 years ago • 0 comments

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 of tpub instead of xpub, or from the coin type 1h

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.

Sjors avatar Nov 30 '18 13:11 Sjors