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

Bitbox2 support #393

Merged
merged 8 commits into from Sep 18, 2020
Merged

Conversation

ben-kaufman
Copy link
Contributor

No description provided.

@stepansnigirev
Copy link
Collaborator

stepansnigirev commented Sep 15, 2020

Internal error: The BitBox02 does not accept a passphrase from the host. Please enable the passphrase option and enter the passphrase on the device during unlock..

This happens in hwi_rpc.py, line 72, in enumerate devcls.get_client(dev["path"], passphrase). Maybe we can overwrite get_client method in BitBox and make sure the password is not transmitted to the device.

With HWI command line interface it works.

Also getting hwi from git commit didn't quite work when I tried to update using pip in my old virtual environment, I had to make a fresh new virtual environment for this PR. Are we sure we want to have this in the release this before the HWI release?

@ben-kaufman
Copy link
Contributor Author

Can you please just check what passphrase on line 72 is (just print it out?). I'm assuming it's None, but if you can please confirm it that'd help.

I think it will be nice to have it already, HWI can take a long time for releases... though if it's causing issues we'll have to wait.

@stepansnigirev
Copy link
Collaborator

stepansnigirev commented Sep 15, 2020

Yes, it works when passphrase is an empty string "", but fails if it's None.
So changing the code in enumerate to this helped with the issue:

                if passphrase is None:
                    client = devcls.get_client(dev["path"])
                else:
                    client = devcls.get_client(dev["path"], passphrase)

Now I am getting another one:
Internal error: Input error: error code: 103, message: generic error. A keypath might be invalid. Supported keypaths are: m/49'/0'/<account'> for p2wpkh-p2sh; m/84'/0'/<account'> for p2wpkh; m/48'/0'/<account'>/2' for p2wsh multisig; account can be between 0' and 99'; For address keypaths, append /0/<address index> for a receive and /1/<change index> for a change address..

I wasn't able to get m/44h... key and none of testnet keys (m/49h/1h/0h), only works with mainnet keys for some reason.

We may need to try getting each key and keep going if it fails. Import as many keys as we can and notify the user which keys failed.

@ben-kaufman
Copy link
Contributor Author

Makes sense. I can do these changes. But I think it'd also make sense to allow setting the passphrase to None in HWI. I'll propose that in a PR there and also ask if they plan to make a release soon with the Bitbox2 in it.

But for now yes I'll just add the check for none and the try catch for key export.

@stepansnigirev
Copy link
Collaborator

stepansnigirev commented Sep 15, 2020

Ok, to get testnet keys we need to set client.is_testnet = True, and then it works.
So I assume we can drop support for m/44h keys, and change client to testnet and back when fetching keys for different networks. We are not using m/44h keys anyways.

@stepansnigirev stepansnigirev merged commit df486c8 into cryptoadvance:master Sep 18, 2020
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

2 participants