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

[CLI] Force display mode if we fail to get an xpub w/ ledger #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pythcoiner
Copy link
Contributor

I hit an issue while trying to get an xpub w/ a not 'standard' derivation path w/ the CLI:

~/rust/escrow nostr *5 ❯ hwi xpub get --path "m/1465269028'/547967380'/703278800'/311392014'"
Error: Device("Device {\n    command: 0,\n    status: NotSupported,\n}")

Ledger devices have a 'security' features, if we want to get an xpub for a not 'standard' derivation path, we should use the display mode where the user add to ACK.

Approach taken here is : if we fail to get an xpub w/ a ledger, we retry one more time w/ display mode activated.

@@ -72,7 +72,7 @@ pub trait HWI: Debug {
/// Get master fingerprint.
async fn get_master_fingerprint(&self) -> Result<Fingerprint, Error>;
/// Get the xpub with the given derivation path.
async fn get_extended_pubkey(&self, path: &DerivationPath) -> Result<Xpub, Error>;
async fn get_extended_pubkey(&self, path: &DerivationPath, display_mode: bool) -> Result<Xpub, Error>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that we do not modify the interface.
I think the possible fix is to add --display to the cli args for the Xpub command, and do
ledger.display_xpub(true) at the listing of devices.

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.

2 participants