diff options
Diffstat (limited to '02.md')
| -rw-r--r-- | 02.md | 28 |
1 files changed, 16 insertions, 12 deletions
| @@ -1,14 +1,16 @@ | |||
| 1 | NIP-02 | 1 | NIP-02 |
| 2 | ====== | 2 | ====== |
| 3 | 3 | ||
| 4 | Contact List and Petnames | 4 | Follow List |
| 5 | ------------------------- | 5 | ----------- |
| 6 | 6 | ||
| 7 | `final` `optional` `author:fiatjaf` `author:arcbtc` | 7 | `final` `optional` |
| 8 | 8 | ||
| 9 | A special event with kind `3`, meaning "contact list" is defined as having a list of `p` tags, one for each of the followed/known profiles one is following. | 9 | A special event with kind `3`, meaning "follow list" is defined as having a list of `p` tags, one for each of the followed/known profiles one is following. |
| 10 | 10 | ||
| 11 | Each tag entry should contain the key for the profile, a relay URL where events from that key can be found (can be set to an empty string if not needed), and a local name (or "petname") for that profile (can also be set to an empty string or not provided), i.e., `["p", <32-bytes hex key>, <main relay URL>, <petname>]`. The `content` can be anything and should be ignored. | 11 | Each tag entry should contain the key for the profile, a relay URL where events from that key can be found (can be set to an empty string if not needed), and a local name (or "petname") for that profile (can also be set to an empty string or not provided), i.e., `["p", <32-bytes hex key>, <main relay URL>, <petname>]`. |
| 12 | |||
| 13 | The `.content` is not used. | ||
| 12 | 14 | ||
| 13 | For example: | 15 | For example: |
| 14 | 16 | ||
| @@ -25,27 +27,29 @@ For example: | |||
| 25 | } | 27 | } |
| 26 | ``` | 28 | ``` |
| 27 | 29 | ||
| 28 | Every new contact list that gets published overwrites the past ones, so it should contain all entries. Relays and clients SHOULD delete past contact lists as soon as they receive a new one. | 30 | Every new following list that gets published overwrites the past ones, so it should contain all entries. Relays and clients SHOULD delete past following lists as soon as they receive a new one. |
| 31 | |||
| 32 | Whenever new follows are added to an existing list, clients SHOULD append them to the end of the list, so they are stored in chronological order. | ||
| 29 | 33 | ||
| 30 | ## Uses | 34 | ## Uses |
| 31 | 35 | ||
| 32 | ### Contact list backup | 36 | ### Follow list backup |
| 33 | 37 | ||
| 34 | If one believes a relay will store their events for sufficient time, they can use this kind-3 event to backup their following list and recover on a different device. | 38 | If one believes a relay will store their events for sufficient time, they can use this kind-3 event to backup their following list and recover on a different device. |
| 35 | 39 | ||
| 36 | ### Profile discovery and context augmentation | 40 | ### Profile discovery and context augmentation |
| 37 | 41 | ||
| 38 | A client may rely on the kind-3 event to display a list of followed people by profiles one is browsing; make lists of suggestions on who to follow based on the contact lists of other people one might be following or browsing; or show the data in other contexts. | 42 | A client may rely on the kind-3 event to display a list of followed people by profiles one is browsing; make lists of suggestions on who to follow based on the follow lists of other people one might be following or browsing; or show the data in other contexts. |
| 39 | 43 | ||
| 40 | ### Relay sharing | 44 | ### Relay sharing |
| 41 | 45 | ||
| 42 | A client may publish a full list of contacts with good relays for each of their contacts so other clients may use these to update their internal relay lists if needed, increasing censorship-resistance. | 46 | A client may publish a follow list with good relays for each of their follows so other clients may use these to update their internal relay lists if needed, increasing censorship-resistance. |
| 43 | 47 | ||
| 44 | ### Petname scheme | 48 | ### Petname scheme |
| 45 | 49 | ||
| 46 | The data from these contact lists can be used by clients to construct local ["petname"](http://www.skyhunter.com/marcs/petnames/IntroPetNames.html) tables derived from other people's contact lists. This alleviates the need for global human-readable names. For example: | 50 | The data from these follow lists can be used by clients to construct local ["petname"](http://www.skyhunter.com/marcs/petnames/IntroPetNames.html) tables derived from other people's follow lists. This alleviates the need for global human-readable names. For example: |
| 47 | 51 | ||
| 48 | A user has an internal contact list that says | 52 | A user has an internal follow list that says |
| 49 | 53 | ||
| 50 | ```json | 54 | ```json |
| 51 | [ | 55 | [ |
| @@ -53,7 +57,7 @@ A user has an internal contact list that says | |||
| 53 | ] | 57 | ] |
| 54 | ``` | 58 | ``` |
| 55 | 59 | ||
| 56 | And receives two contact lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that says | 60 | And receives two follow lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that says |
| 57 | 61 | ||
| 58 | ```json | 62 | ```json |
| 59 | [ | 63 | [ |