-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add delegation to nip 46 #1795
base: master
Are you sure you want to change the base?
Add delegation to nip 46 #1795
Conversation
Brave of you to reuse the word "delegation" for this. 😂 I think it's a clever idea. I can picture a UI in a client that lets you delegate, which would be convenient for marketing accounts. I could picture But is it worth the added complexity? This just saves you from having to go back through the Bunker's interface to add a new connection. |
I know, it made me second guess myself.
The alternative would be much more complex. Initially I thought about adding a It also overloads I'm open to better ideas, but I don't think re-using connect improves anything. |
But why shouldn't the user go through the Bunker interface to add the new connections? Do you need it to be automatic for what you're building? |
No particular reason. I don't think it's ideal, but I also don't see why it would be an improvement, since the user has to accept the connection on their bunker anyway. |
I am with @alexgleason. I don't get the need for the extra command. You could just sign the user up with a regular NIP-46 connection. |
I feel like I addressed that question already, but let me try again: If you re-use the normal bunker flow, the delegatee can always request more privileges. This could be fine, since users have to approve those updates anyway, but privilege escalation when unnecessary is always a bad thing. Users also may be confused about what app is asking for additional privileges. Locking privileges to what is initially requested solves this, but requires signers to implement it — which they may not do if it's bolted onto the existing flow. |
Yes, I don't think that is worth the added complications of the separate command. |
But it's... less complicated. Overloading a single command with multiple semantics and security models is what's complicated! I feel like I'm taking crazy pills. |
I would also not overload or change the connect command at all. There is no need to change NIP-46 for this because user approvals already exist. And apps unexpectedly asking for new permissions already trigger the user's red flags. |
Ok, I see. I disagree, but I think that's a reasonable position. |
I think creating a new command for this is better. Some people just blindly accept any permission or configure the signer to sign everything automatically. |
This PR adds a
delegation
command to NIP 46, which allows applications that are already authorized to create new sessions with limited permissions. My use case for this is sharing a read-only session with push- or email- notification servers, which can only signkind 22242
events on behalf of the user, in order to get access to auth-gated relays.