Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support descriptor based commands & infer coin type #72

Open
Sjors opened this issue Nov 30, 2018 · 0 comments
Open

Support descriptor based commands & infer coin type #72

Sjors opened this issue Nov 30, 2018 · 0 comments

Comments

@Sjors
Copy link
Member

Sjors commented Nov 30, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants