noscl icon indicating copy to clipboard operation
noscl copied to clipboard

Bug in Private Key Encoding/Decoding handling

Open ajx42 opened this issue 1 year ago • 2 comments

It seems the following (pool.SecretKey) expects an encoded key string. Currently, we are decoding the key string before setting it here. https://github.com/fiatjaf/noscl/blob/master/nostr.go#L40-L42

image

It gets fixed with the following patch, i.e. if we set Config.PrivateKey to the raw (encoded) string. https://github.com/ajain365/noscl/commit/f10c434789ec0e0af6a5be73e98bd579263ec38e

A related problem is the following, which the above patch also fixes: showPublicKey is passing the already decoded key to getPubKey: https://github.com/fiatjaf/noscl/blob/master/key.go#L55 There is this older PR that fixes this issue at another place https://github.com/fiatjaf/noscl/pull/50

Currently we get this: image

I can go ahead and fix it if it's okay. Feel free to assign me. I am trying to learn about this codebase, so happy to help.

ajx42 avatar Apr 19 '23 02:04 ajx42