i already had a private key from elsewhere, so went to "profile" and copy&pasted it, erasing the pubkey:
but the app says "public-key corresponds to private-key". i would've expected it to auto-compute the pubkey from my manual private input using getPublicKey.
i already had a private key from elsewhere, so went to "profile" and copy&pasted it, erasing the pubkey:
![image](/attachments/26ee6d55-895c-4a7a-adb9-8e83dfc99b5e)
but the app says "public-key corresponds to private-key". i would've expected it to auto-compute the pubkey from my manual private input using [getPublicKey](https://github.com/jb55/nostr-js#getpublickeyprivkey).
@offbyn wdyt?
it could also generate and update the pubkey input when user changes private key input field.
on the other hand: if a user copies a pubkey and then the private key and they for some reason don't correspond, I would expect an error and no automatic generation.
the pubkey input field is currently only set:
- when user generates a new key
- onload taken from localstorage
it could also generate and update the pubkey input when user changes private key input field.
on the other hand: if a user copies a pubkey and then the private key and they for some reason don't correspond, I would expect an error and no automatic generation.
it could also generate and update the pubkey input when user changes private key input field.
exactly!
on the other hand: if a user copies a pubkey and then the private key and they for some reason don't correspond, I would expect an error and no automatic generation.
how about generating and setting the pubkey the moment "save" button is clicked, only if the private key input is set and pubkey is empty?
but the save button is disabled if the keys don't match 🤔
or how about it turning pubkey input into a div or span, i.e. no user input? then you'd always have to input or generate the private key.
> it could also generate and update the pubkey input when user changes private key input field.
exactly!
> on the other hand: if a user copies a pubkey and then the private key and they for some reason don't correspond, I would expect an error and no automatic generation.
how about generating and setting the pubkey the moment "save" button is clicked, only if the private key input is set and pubkey is empty?
but the save button is disabled if the keys don't match 🤔
or how about it turning pubkey input into a div or span, i.e. no user input? then you'd always have to input or generate the private key.
or how about it turning pubkey input into a div or span, i.e. no user input? then you'd always have to input or generate the private key.
I thought by using pubkey only one could use nostrweb as watch-only client. I'll need to play around a bit more.
> or how about it turning pubkey input into a div or span, i.e. no user input? then you'd always have to input or generate the private key.
I thought by using pubkey only one could use nostrweb as watch-only client. I'll need to play around a bit more.
right. here's another idea: have 2 modes. watch-only or normal, something where a user can flip a switch.
in watch-only, the private key input disappears completely. in normal mode, pubkey is a div/span, not an input.
right. here's another idea: have 2 modes. watch-only or normal, something where a user can flip a switch.
in watch-only, the private key input disappears completely. in normal mode, pubkey is a div/span, not an input.
here is a more conservative approach to "generate and update the pubkey input when user changes private key input field." in #24 it only updates the pubkey field if it was empty and currently only on paste event.
I think on paste might be enough.
another alternative is to have a small button similar to "show private key" to activelly calculate the pubkey at any time.
yep a setting for watch only makse sense..
here is a more conservative approach to "generate and update the pubkey input when user changes private key input field." in https://git.qcode.ch/nostr/nostrweb/pulls/24 it only updates the pubkey field if it was empty and currently only on paste event.
I think on paste might be enough.
another alternative is to have a small button similar to "show private key" to activelly calculate the pubkey at any time.
i already had a private key from elsewhere, so went to "profile" and copy&pasted it, erasing the pubkey:
but the app says "public-key corresponds to private-key". i would've expected it to auto-compute the pubkey from my manual private input using getPublicKey.
@offbyn wdyt?
oh, shouldn't this text:
actually say something like "pubkey does NOT correspond to private key"?
good catch, it should definetly not show "public-key corresponds to private-key" lol.
opened a pr to fix the validation part.
the pubkey input field is currently only set:
it could also generate and update the pubkey input when user changes private key input field.
on the other hand: if a user copies a pubkey and then the private key and they for some reason don't correspond, I would expect an error and no automatic generation.
exactly!
how about generating and setting the pubkey the moment "save" button is clicked, only if the private key input is set and pubkey is empty?
but the save button is disabled if the keys don't match 🤔
or how about it turning pubkey input into a div or span, i.e. no user input? then you'd always have to input or generate the private key.
I thought by using pubkey only one could use nostrweb as watch-only client. I'll need to play around a bit more.
right. here's another idea: have 2 modes. watch-only or normal, something where a user can flip a switch.
in watch-only, the private key input disappears completely. in normal mode, pubkey is a div/span, not an input.
yep a setting for watch only makse sense..
here is a more conservative approach to "generate and update the pubkey input when user changes private key input field." in #24 it only updates the pubkey field if it was empty and currently only on paste event.
I think on paste might be enough.
another alternative is to have a small button similar to "show private key" to activelly calculate the pubkey at any time.
i think it's done for now. let's iterate and improve later.