noscl
noscl copied to clipboard
Bug in Private Key Encoding/Decoding handling
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](https://user-images.githubusercontent.com/19322630/232956590-9b0d0c9a-47dc-443a-89bf-f3faec2ab516.png)
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:
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.