BlockchainCommons / keytool-cli

Cryptocurrency key & address derivation for the command line
Other
4 stars 6 forks source link

Want option for fingerprint path prefix for --address-key & --address-pub-key #13

Open ChristopherA opened 3 years ago

ChristopherA commented 3 years ago

But what I really want for --full-address-derivation-path with 48' is an option, --add-root-fingerprint or --add-parent-fingerprint with address-key and address-pub-key that adds the root or parent fingerprint and path to the front of the result, i.e. [feebfc32/48h/0h/0h/2h]xpubDERVIEDKEY. Maybe also for other options like --master-key

I think for our purposes (multisig and descriptor centric wallets) --add-root-fingerprint could even be a default.

wolfmcnally commented 3 years ago

I'm not sure this use-case shouldn't actually be done with multiple invocations of keytool.

You can derive the fingerprint of any key:

keytool --master-key xprv9s21ZrQH143K3LafD5DiV15sGHLPgjufVQfw2pbYmcQx9oqk68vKWZibByQqrsHV9D5i7CmV5JPpNRUGCco9BGuSpsBaTU5cfsdwMksm6Bt master-key-fingerprint  
c0abd02e

You can define the source fingerprint you want:

keytool --master-key-fingerprint c0abd02e full-address-derivation-path
c0abd02e/84h/0h/0h/0/0

Hm, and isn't the output-descriptor node already quite similar to what you want?

keytool --master-key xprv9s21ZrQH143K3LafD5DiV15sGHLPgjufVQfw2pbYmcQx9oqk68vKWZibByQqrsHV9D5i7CmV5JPpNRUGCco9BGuSpsBaTU5cfsdwMksm6Bt output-descriptor
wpkh([c0abd02e/84h/0h/0h]xpub6BmiS84kCKeXuJvpCVEHLG8kyo6EypJ4rDU9cWratSy3qFNpkyL5fkHhYrTNXYoacAqn9VGJpuAFV4iJ6ncCNPXJeHGsosEtEzWW3n45WN3/0/0)