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

feat: add support for private key exports #432

Merged
merged 4 commits into from
Dec 22, 2022

Conversation

zivkovicmilos
Copy link
Member

@zivkovicmilos zivkovicmilos commented Dec 15, 2022

Description

This PR adds support for exporting private keys from the key-base, using the gnokey export command.

The private key armor that is saved is encrypted using a passphrase that the user sets.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist (for contributors)

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Tested manually by invoking the command:

gnokey export --key MyKey --output-path ./mykey.asc

Additionally, a new unit test has been added for covering this functionality.

Additional comments

There should be an import command also available, that knows how to do the opposite of export.
I'll add this functionality in a separate PR.

@zivkovicmilos zivkovicmilos changed the title Add support for private key exports feat: add support for private key exports Dec 16, 2022
@moul moul removed the enhancement label Dec 16, 2022
@moul moul merged commit bf9cf16 into gnolang:master Dec 22, 2022
@zivkovicmilos zivkovicmilos deleted the feature/export-key branch December 23, 2022 09:33
@r3v4s
Copy link
Contributor

r3v4s commented Feb 21, 2023

Hello @zivkovicmilos, this is Blake from Onbloc, building Adena wallet.

We're trying to implement import/export functionality in our wallet that's compatible with gnokey (and furthermore another wallet like Keplr & Metamask)

However we notice that this pr inlcudes only encrypted export functionality, and isn't compatible with the existing wallets so it'll be inconvenient for users to import/export keys.

So my question is, do you have plan to add something like --unsafe, --unarmored-hex in gnokey like gaiad does?

@zivkovicmilos
Copy link
Member Author

Hey @r3v4-onbloc,

The only reason we kept the encrypted armor functionality is to keep up with existing keybase code (it expects to work with encrypted keys).

I honestly see no issue with adding unencrypted export / import functionality for keys (if the user asks for it explicitly) - it should be pretty straightforward to do. I'll open up a PR and link you as soon as I have it up.

Just to confirm - you need unencrypted private key armor export / import?

@r3v4s
Copy link
Contributor

r3v4s commented Feb 21, 2023

Yes we do. Thank you for your comment and future implementation.

@zivkovicmilos
Copy link
Member Author

No problem, I'll ping you once it's up and ready for viewing

@zivkovicmilos
Copy link
Member Author

@r3v4-onbloc PR is out 🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants