diff options
Diffstat (limited to '02.md')
| -rw-r--r-- | 02.md | 24 |
1 files changed, 13 insertions, 11 deletions
| @@ -1,12 +1,12 @@ | |||
| 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>]`. The `content` can be anything and should be ignored. |
| 12 | 12 | ||
| @@ -25,27 +25,29 @@ For example: | |||
| 25 | } | 25 | } |
| 26 | ``` | 26 | ``` |
| 27 | 27 | ||
| 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. | 28 | 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. |
| 29 | |||
| 30 | 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 | 31 | ||
| 30 | ## Uses | 32 | ## Uses |
| 31 | 33 | ||
| 32 | ### Contact list backup | 34 | ### Follow list backup |
| 33 | 35 | ||
| 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. | 36 | 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 | 37 | ||
| 36 | ### Profile discovery and context augmentation | 38 | ### Profile discovery and context augmentation |
| 37 | 39 | ||
| 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. | 40 | 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 | 41 | ||
| 40 | ### Relay sharing | 42 | ### Relay sharing |
| 41 | 43 | ||
| 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. | 44 | 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 | 45 | ||
| 44 | ### Petname scheme | 46 | ### Petname scheme |
| 45 | 47 | ||
| 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: | 48 | 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 | 49 | ||
| 48 | A user has an internal contact list that says | 50 | A user has an internal follow list that says |
| 49 | 51 | ||
| 50 | ```json | 52 | ```json |
| 51 | [ | 53 | [ |
| @@ -53,7 +55,7 @@ A user has an internal contact list that says | |||
| 53 | ] | 55 | ] |
| 54 | ``` | 56 | ``` |
| 55 | 57 | ||
| 56 | And receives two contact lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that says | 58 | And receives two follow lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that says |
| 57 | 59 | ||
| 58 | ```json | 60 | ```json |
| 59 | [ | 61 | [ |