on the second flight I finished writing the implementation (and modifications to NIP-46) to make the following possible: 1. Alice goes to App A (e.g. Coracle) -- she clicks "create account" and gets a NIP-05 "alice@somesite.com". She uses Coracle as she normally would. 2. Alice goes to App B (e.g. Primal) -- she clicks "login" and types in "alice@somesite.com". A popup comes up and asks Alice if she wants to authorize this application to access her account. In an advanced setting She can scope down what the application can do (e.g. only create short notes but don't change the profile data) At no point is there any mention of nsec, npub, keys, NIP-07, nsecbunker. Nothing. It just works. cc @HoloKat @miljan @rabble

Replies (103)

how does it work without giving away your nsec or requiring a complex key delegation system and database?
I’m reluctant to say this in a thread of nostr big brains but… If everyone adopted this aren’t we then relying too much on ICANN … and doesn’t that become a bit of a weak point in terms of censorship?
Nip 46 and each app gets its own local key. The first app that generates the user’s key gets auto approved, subsequent ones need user approval. When the user wants to off board from whoever is running the nsecBunker backend they can NIP-41 rotate the key away if the nsecBunker becomes malicious. The cool thing is that downloading a “recovery kit” is already a very normal flow from apps that have important data; and this could provide a “Recovery kit” that includes everything the user needs, including a NIP-41 identity migration scheme. This work was largely inspired by @rabble ‘s talk (I watched it on the flight): we need nostr for normies.
Nah, we can easily move to a different namespace if that becomes anywhere near problematic. This is. It relying on anything special, it’s just “copy an npub” is more scary than “this is your nostr username”
i doubt he's going to like the requirement of caching people's nsec's or forcing a key derivation delegation scheme that complicates everything.
HoloKat's avatar
HoloKat 2 years ago
We may need to explain that this login works on other apps. Or call it a unified credentials or something. Not sure exactly what that would look like yet.
HoloKat's avatar
HoloKat 2 years ago
We’ve come full circle ⭕️
maybe have Coracle have a separate authenticator app with pop-ups, doesn’t take up as many resources in the background
It’s a nice idea and a great flow, but it suffers from some problems: Low entropy You are still giving your nsec to a million apps (here only one party has it) No possibility of “password recovery” here recovery can be achieved
Nah, that would defeat the purpose; this will be infra that I’m guessing clients will happily subsidize. Running a bunker has a marginal cost of basically zero. We’ll find another way of preventing abuse like some PoW on the browser or something like that.
It’ll be an nsecBunker that serves the original client but is accessible beyond that client (it’s just relays!) With NIP-89 users could even choose an nsecBunker provider but that would probably make the flow have more friction. This is all stuff to explore.
Not that much; NDK supports NIP-46 very easily. I wrote a “5 minute guide to supporting NIP-46” a few months ago. Certainly is a bit more complex but very very slight, I just need to write more docs about it, but I think unlocking a normie-friendly experience warrants it x1000000 Your talk was very inspiring, @rabble. Thank you.
Niel Liesmons's avatar
Niel Liesmons 2 years ago
Neat! Damn that solves a looooot for the normies. Time to start editing some signup flows 👌
Coracle creates a key on some nsecBunker someone runs (they could choose providers via NIP-89) Then coracle, because it’s calling the “create_or_auth_key” with a new identifier would get its local key automatically approved to all scopes (sign anything, encrypt, decrypt, etc)
Remember, the more friction, the more churn. “Install this thing in your browser” is a VERY weird UX people are not used to. Add to it relays, interoperability, and a bunch of bitcoiners yelling at you and you shut off a large chunk of potential users. And remember, in both cases you are trusting the third party (nsecBunker operator or NIP-07 implementation) is not malicious.
Got it. NIP-07 is the end of key management UX and civilization has reached its conclusion. Have we arrived to the end of history?
If the initializing bunker is malicious then the nip41 rotation can't be trusted either? Also where is the popup? Does every app that enrolls new users also need a keyring interface?
it doesn't require app A open. Is the same UX as using anything else on the internet, no weirdness. Just like a "Login with Twitter" opens an oauth window that doesn't require a previous version of twitter open running somewhere.
yeah, correct. But a malicious bunker would flag itself as malicious very easily. The popup is of the nsecBunker operator the user is using. It requires almost nothing more than supporting NIP-46, just a couple very simple modifications to the current spec.
just nip-46, yeah, on some nostr-connected server, so the user just yells on relays "I need a signature for this event" and whoever can fulfill that gives it a signature
No, really anything in nostr that has an API feel to it can be implemented in nostr as data-addressable. No endpoints, just pubkeys, so this kind of stuff will always feel a bit magical
The Wookie on Xitter just called nostr a deliberate failure (and me a coco but dumber) for not having key rotation or DID. I kind of prefer the can-do attitude here 🫂
No, the first client never sees the nsec. You’re only trusting the nsecBunker backend operator you use and with NIP-41 even if the bunker becomes malicious you’d have a way forward. Also, bunkers are economical actors and becoming malicious requires them signaling they are malicious. Keep in mind where people are coming from now, normal operations is you never can control your account nor have a recourse if the operator censors/revokes your access. This is a way for normies to compete with that state of affairs.
I meant the bunker. Just trying to understand from the perspective “trusting a 3rd party is a security threat as a default”. They need not to be adversarial but just get hacked. We need easy-to-use solutions, and almost anything is better than centralised silos 😁 Farcaster’s Passkey was a nice implementation to make it easier for regular users, and also allowing to pay with Apple the reg&storage fees.
So it's like the web apps are running the chrome extension without actually needing the chrome extension? 🙂 What is the security model - how does one app not steal everything?
When Bob steals all the sats, he becomes Robert! We shouldn't use friendly name for someone that steals sats 😅
This is perfect. It's less technical and the user experience would be much better as we're not asking users to download install various seemingly unrelated apps.
I thought about this for some days. It's basically the open Id connect standard. Problem remains: If app B doesn't have the PK, app B cannot sign events. To achieve this, we need the relays to act as authorisation servers like in oauth2.
I was imagining that... Was thinking lately that wordpress can be a good companion for nostr, since it is easy to have your own instance, and it can serve as a nip05 server, use for media hosting together with nip98, for delegation or bunker, etc
OAuth via nostr using nbunker? Nice. Do you envision it for business contexts or for casual users too?
But with nip98, we can only authenticate a pubkey, not authorise on the fly. Need the permissioning system of the host system, like WordPress, to do authorisation. DM me if I can be of any help. Have many years experience in programming oauth2 stuff and CMSs.
Was talking to @bumi about this at the conf, the security model is heckin' tricky for thin clients due to session hijacking based on a public client id. He said to look into OpenID Connect, which solves dynamic registration of trusted apps
This looks very promising @PABLOF7z. Something like this would need to be deployed with a fully functional key rotation system. If somesite.com gets owned we are in a world of pain. But overall, I think you might be onto something big here for the normie onboarding use case. Of course the advanced option where people hold their keys directly always needs to be present.
Perhaps there is a way to decentralized from anysite dot com to this site dot com? Enabling semi-trusted brands to compete for users of their domain, provide value to users who do, and enable self-hosting Nip 05s easily for those that the many that already have domains.
Blame it on NIP-05; that’s the only reason to use that, just a way to map a string to an npub
I agree with some people here who are a little skeptical about the proposal. It introduces a new trusted third party, which is opposed to Nostr's spirit. Have you guys also considered an approach in which the user generates a key pair (account) in every new app and maps the accounts together as belonging to one identity? Losing one key can be handled by making it invalid through a voting process achieving a certain quorum. In a similar manner, the user can add new accounts to his identity by voting for it with existing accounts and reaching the required quorum. I imagine the new protocol can define events of new kinds for account mapping requests, approvals, and rejections. There are some open issues with this approach, for sure. How we can minimize attack vectors and handle the fuzzy state inherent to Nostr? But I think it is worth exploring such an approach too. With this approach even browser extensions aren't needed, replacing trusted third parties through a consensus protocol. Do I miss something fundamentally wrong here? I'm looking forward to your thoughts on this.