onbloc / adena-wallet

Adena is a friendly browser extension wallet for the Gnoland blockchain.
http://adena.app/
GNU General Public License v3.0
26 stars 18 forks source link

Importing an Account using a private key #489

Closed leohhhn closed 1 week ago

leohhhn commented 3 months ago

Description

Hey, I have tried importing the test1 private key to Adena, but I was unsuccessful. It seems that no matter what I try, I end up with an "invalid format" error. This is how I went about it:

  1. Exported the test1 private key locally, with the --unsafe flag, to get the unencrypted version:
    
    -----BEGIN TENDERMINT PRIVATE KEY-----

ChQvdG0uUHJpdktleVNlY3AyNTZrMRIiCiDql7n9235r9oZwkKeoGWVwR5Sfu5Rm 1hf5QFOO/YiGBQ== =wH/4 -----END TENDERMINT PRIVATE KEY-----


2. I tried copying the whole thing into Adena, including the `---BEGIN---` & `---END---` statements, and just the string inside (`ChQ....=wH/4`). I did the same thing with the encrypted private key, just as a sanity check, and it also didn't work.

How is this handled in Adena, and what is the correct way to do this?
jinoosss commented 3 months ago

@leohhhn , Thank you for opening the issue.

gnokey uses OpenPGP Armor for encryption when exporting private key. Adena does not currently handle decryption for Armor, which is likely the reason for the issue.

I think it's worth considering support for Armor encryption/decryption, but I have a couple questions.

cc @dongwon8247

zivkovicmilos commented 3 months ago

I remember either @jinoosss or @r3v4s opening up the discussion for Adena armor handling last year, but it somehow got lost in the shuffle 🙁

I'm not entirely convinced Adena (or any tool) should be able to work with encrypted armor. Why would it?

These tools already support adding raw private keys (at least tm2-js-client does, I'm 99% sure Adena does as well). I think neither supports armor input (encrypted, or decrypted).

I think, ultimately, the functionality that should be present:

r3v4s commented 3 months ago

opening up the discussion for Adena armor handling last year, but it somehow got lost in the shuffle 🙁

FYI, related pr is https://github.com/gnolang/gno/pull/537

dongwon8247 commented 1 week ago

Closing for now. Please reopen if needed.