Is there no better way?
This post was inspired by this comment of @orthwyrm:
Can confirm this works. I'm not sure what stops the issuer from using your Mullvad token, though.
Nothing stops the issuer from using your Mullvad token. But at least they give you the option to just buy a voucher.
However, I think it's bad to even give people the option to enter their Mullvad token. This just reinforces already existing bad habits when it comes to security (online).
But this is imo very similar to how authentication on nostr clients usually works. They just straight up ask for your nsec. As if that's not the wet dream of any phishing site. Phishing sites can now just ask you to enter your private key and this wouldn't even raise suspicion. Since apparently, "that's just how things are".
But I believe there is a better way. At least for the login, you could use Challenge-Response Authentication:
In computer security, challenge–response authentication is a family of protocols in which one party presents a question ("challenge") and another party must provide a valid answer ("response") to be authenticated.The simplest example of a challenge–response protocol is password authentication, where the challenge is asking for the password and the valid response is the correct password.An adversary who can eavesdrop on a password authentication can then authenticate itself by reusing the intercepted password. One solution is to issue multiple passwords, each of them marked with an identifier. The verifier can then present an identifier, and the prover must respond with the correct password for that identifier. Assuming that the passwords are chosen independently, an adversary who intercepts one challenge–response message pair has no clues to help with a different challenge at a different time.
That's also how SN does it. We just make you sign an event (which includes a timestamp) and then verify that this event was signed by the private key belonging to the included public key. If that's the case, great, we verified that you indeed own the corresponding private key.
So I don't really understand why that's not the standard. Because there isn't an easy to use library out there? Then my question would be: Why isn't there one? Nostr is already at least one year old!
And I would consider my digital identity to be similar important as my bitcoin private keys.
Identity theft is nothing to joke about. But why does it seem like the nostr space doesn't take security or encryption serious?
I guess the answer is something along these lines:
Because it's convenient and some people might not have a nostr signer extension installed. Also, it's not only for authentication but also for creating posts and more. How would that work for people without a nostr signer extension?
Oh well then, missing adoption of nostr signer extensions is not going to change if you keep accepting nsec keys.
Sorry not sorry for the rant.