From b3920f76b4f8adde785de785153b49e92be75f35 Mon Sep 17 00:00:00 2001 From: Pablo Fernandez
Date: Wed, 18 Oct 2023 14:57:30 +0300
Subject: [PATCH] wip
---
41.md | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
create mode 100644 41.md
diff --git a/41.md b/41.md
new file mode 100644
index 0000000..7ab54c7
--- /dev/null
+++ b/41.md
@@ -0,0 +1,88 @@
+# NIP-41
+## Identity rotation
+`draft` `optional` `author:pablof7z`
+
+This NIP introduces a simple way in which a pubkey can migrate to by whitelisting a new pubkey ahead of time.
+
+# Basic concepts
+* `kind:1776` whitelists a pubkey.
+* `kind:1777` migrates to a previously whitelisted pubkey.
+* `kind:1776` and `kind:1777` MUST be opentimestamped [NIP-03](https://github.com/nostr-protocol/nips/blob/master/03.md).
+* When a migration event is published, a 30-day period starts in which a user can publish a competing migration event pointing to an earlier `kind:1776` event. After this period, clients SHOULD automatically update the user's follow list to the new pubkey.
+* Relays SHOULD NOT delete `kind:1040` nor `kind:1776` events from their database upon receiving a `kind:5` event.
+
+# Flow
+## Whitelisting a pubkey
+The user's active pubkey (e.g. *pubkey A*) signs an event `kind:1776` whitelisting a pubkey that can be used to migrate an identity to.
+
+This should be done ahead of time, perhaps after a user has used Nostr enough for a few days. Clients can choose to prompt the user to "save a recovery kit" or different UXs when they see the user doesn't currently have a `kind:1776` published.
+
+The implementation can be done directly on regular clients or microapps to handle this type of thing could be implemented as well.
+
+```json
+{
+ "pubkey": "pubkey-A",
+ "kind": 1776,
+ "content": "",
+ "tags": [
+ [ "p", "pubkey-B" ],
+ [ "alt", "pubkey whitelisting event" ]
+ ]
+}
+```
+
+* `.content` SHOULD be ignored. Users might choose to use it to leave a base64 symmetrically-encrypted message of where they left the new key or anything else.
+* The event MUST have a single `p` tag listing the whitelisted pubkey.
+
+Multiple `kind:1776` events can exist. All `kind:1776` MUST be opentimestamped following [NIP-3](https://github.com/nostr-protocol/nips/blob/master/03.md).
+
+Relays SHOULD NOT delete `kind:1040` nor `kind:1776` events upon receiving a `kind:5` event.
+
+## Migrating to a pubkey
+When the user needs to change keys they sign an event `kind:1777` with the new key and creates a NIP-03 attestation.
+
+```json
+{
+ "pubkey": "pubkey-B",
+ "kind": 1777,
+ "content": "",
+ "tags": [
+ [ "p", "pubkey-A" ],
+ [ "e", "