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

Add getdescriptors command #137

Merged
merged 3 commits into from
Sep 6, 2019

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Mar 8, 2019

Returns all relevant descriptors for a given account, e.g.:

./hwi.py --fingerprint 00000000 getdescriptors --account 0
{
  "receive": [
    "pkh([00000000/44h/0h/0h]xpub6C.../0/*)#fn95jwmg",
    "sh(wpkh([00000000/49h/0h/0h]xpub6B..../0/*))#j4r9hntt",
    "wpkh([00000000/84h/0h/0h]xpub6C.../0/*)#qw72dxa9"
  ],
  "internal": [
    "pkh([00000000/44h/0h/0h]xpub6C.../1/*)#c8q40mts",
    "sh(wpkh([00000000/49h/0h/0h]xpub6B..../1/*))#85dn0v75",
    "wpkh([00000000/84h/0h/0h]xpub6C..../1/*)#36mtsnda"
  ]
}

@Sjors
Copy link
Member Author

Sjors commented May 1, 2019

Rebased and added an xpub cache so we don't fetch the same xpub twice from a device for internal and change descriptors.

@Sjors
Copy link
Member Author

Sjors commented Aug 3, 2019

Rebased after #135.

Works quite well in combination with experimental descriptor native wallet box, see bitcoin/bitcoin#14912 (comment)

Paging @achow101 & @instagibbs

@Sjors Sjors force-pushed the 2019/03/getdescriptors branch 3 times, most recently from df02355 to 99218bd Compare August 21, 2019 16:47
@achow101
Copy link
Member

achow101 commented Sep 6, 2019

Tested ACK b0c6cd7

achow101 added a commit that referenced this pull request Sep 6, 2019
b0c6cd7 Cache xpubs (Sjors Provoost)
70fad02 Add getdescriptors command (Sjors Provoost)
a68b585 Extract getdescriptor from getkeypool (Sjors Provoost)

Pull request description:

  Returns all relevant descriptors for a given account, e.g.:

  ```sh
  ./hwi.py --fingerprint 00000000 getdescriptors --account 0
  ```

  ```json
  {
    "receive": [
      "pkh([00000000/44h/0h/0h]xpub6C.../0/*)#fn95jwmg",
      "sh(wpkh([00000000/49h/0h/0h]xpub6B..../0/*))#j4r9hntt",
      "wpkh([00000000/84h/0h/0h]xpub6C.../0/*)#qw72dxa9"
    ],
    "internal": [
      "pkh([00000000/44h/0h/0h]xpub6C.../1/*)#c8q40mts",
      "sh(wpkh([00000000/49h/0h/0h]xpub6B..../1/*))#85dn0v75",
      "wpkh([00000000/84h/0h/0h]xpub6C..../1/*)#36mtsnda"
    ]
  }
  ```

ACKs for top commit:
  achow101:
    Tested ACK b0c6cd7

Tree-SHA512: 68569fa37aee9dd8aa67d547c564e2b455ef3fa50e1f3622f5644942878b815de2c841b29a9b4f152f859fb4780e59ec00415b9e29ff87e2e27ab00526d26c7a
@achow101 achow101 merged commit b0c6cd7 into bitcoin-core:master Sep 6, 2019
@Sjors Sjors deleted the 2019/03/getdescriptors branch September 8, 2019 08:41
@prusnak
Copy link
Collaborator

prusnak commented Dec 21, 2019

Nice!

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

Successfully merging this pull request may close these issues.

None yet

3 participants