howardwu / wagyu

A Rust library for generating cryptocurrency wallets
https://wagyu.dev
Apache License 2.0
608 stars 108 forks source link

Allow showing bech32 keys for imported wallet #277

Open staktrace opened 2 years ago

staktrace commented 2 years ago

I'd like to be able to do something like wagyu bitcoin import-hd -m "..." -d "m/84'/0'/0'/0/0" -f bech32 such that it prints out the address in bech32 format instead of P2PKH. Currently there doesn't appear to be any way to do this without code modification.

I'm happy to write a PR for this, but is this something you'd be interested in?

staktrace commented 2 years ago

After poking around the code some more the structure of the CLI seems quite confusing. For example it's possible to run a command like wagyu bitcoin -f bech32 import-hd "cloud soup script pool hammer cage embrace permit remember uncover weather end" because the bitcoin command takes a -f argument even though the import-hd subcommand does nothing with it.

Also the wording for -f in wagyu bitcoin import -h is confusing, it says "Imports a wallet with a specified format" but the format has nothing to do with the import; it's all about how the address is outputted.