-
Notifications
You must be signed in to change notification settings - Fork 602
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
Shared replaceables via Event-owned keys #1228
base: master
Are you sure you want to change the base?
Shared replaceables via Event-owned keys #1228
Conversation
I think the general idea of this NIP is fine. But I think we may have some issues with how tags are defined.
|
Yeah, I went back and forth in that as well. I don't think anyone is using the 4th element for a p-tags but who knows. We could duplicate tags with a new tag name. So, the event would val editingKeyPair = nostr.generateKeyPair()
{
"pubkey": editingKeyPair.publicKey
"kind": 3xxxx or 1xxxx,
"tags": [
["d", "<unique identifier>"]
["p", "<pubkey 1>", "<relay url>" ],
["p", "<pubkey 2>", "<relay url>" ],
["key", "<pubkey 1>", nip44Encrypt(editingKeyPair.privateKeyHex, editingKeyPair.privateKey, "<pubkey 1>") ],
["key", "<pubkey 2>", nip44Encrypt(editingKeyPair.privateKeyHex, editingKeyPair.privateKey, "<pubkey 2>") ],
],
"content": "",
"sig": signWith(editingKeyPair.privateKey)
// ...
} Initially I thought the duplication could become wasteful in cases of large groups, but maybe it's ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is best to leave this up to the individual use cases. Some use cases may have a better way to transmit the private key than encrypt it + put it publicly, and sometimes you don't want to list all editors.
@Semisol there is a proposal to use #875's kind 24 to transfer the keys inside wraps. It's a little more cumbersome and there is an issue with rotating keys (how to know which version of the replaceable should use which version of the key kind), but it's possible as well. I don't know.. I like the simplicity of putting everything in the main event as a base option and then exploring more private ways inside each NIP. |
This is the 4th proposal to solve the shared replaceable problem. IMHO this scheme is the winner.
In this one, we create private keys for each shared event and host those keys in the event itself.
Read here
This was extracted from the #1189 PR because it serves many other use cases.
Live Demo: https://sheetstr.amethyst.social/
Code: https://github.com/vitorpamplona/sheetstr
As a reminder, the three other proposals are: