nips/02.md

83 lines
2.8 KiB
Markdown
Raw Normal View History

2022-05-01 06:48:57 -04:00
NIP-02
======
Follow List
-----------
2022-05-01 06:48:57 -04:00
2023-11-15 19:42:51 -05:00
`final` `optional`
2022-05-01 06:48:57 -04:00
A special event with kind `3`, meaning "follow list", is defined as having a list of `p` tags, one for each of the profiles to be followed.
2022-05-01 06:48:57 -04:00
Each "p" tag entry should be populated as follows:
- The first element is "p"
- The second element contains the pubkey string
- The third element is either an empty string, or a relay URL where events from that key can be found
- The fourth and final element is either an empty string or a string with a local name for that profile (or "petname")
2024-02-24 16:13:07 -05:00
The `.content` is not used.
2022-05-01 06:48:57 -04:00
For example:
```json
{
"kind": 3,
"tags": [
["p", "91cf9..4e5ca", "wss://alicerelay.com/", "alice"],
["p", "14aeb..8dad4", "wss://bobrelay.com/nostr", "bob"],
["p", "612ae..e610f", "ws://carolrelay.com/ws", "carol"]
],
"content": "",
...other fields
2023-03-06 13:14:45 -05:00
}
2022-05-01 06:48:57 -04:00
```
Every new following list that gets published overwrites all previous ones, so it should contain all entries. Relays and clients SHOULD delete past following lists as soon as they receive a new one.
2022-05-01 06:48:57 -04:00
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.
2022-05-01 06:48:57 -04:00
## Uses
### Follow list backup
2022-05-01 06:48:57 -04:00
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.
### Profile discovery and context augmentation
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.
2022-05-01 06:48:57 -04:00
### Relay sharing
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.
2022-05-01 06:48:57 -04:00
### Petname scheme
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:
2022-05-01 06:48:57 -04:00
A user has an internal follow list that says
2022-05-01 06:48:57 -04:00
```json
[
["p", "21df6d143fb96c2ec9d63726bf9edc71", "", "erin"]
2022-05-01 06:48:57 -04:00
]
```
And receives two follow lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that says
2022-05-01 06:48:57 -04:00
```json
[
["p", "a8bb3d884d5d90b413d9891fe4c4e46d", "", "david"]
2022-05-01 06:48:57 -04:00
]
```
and another from `a8bb3d884d5d90b413d9891fe4c4e46d` that says
```json
[
["p", "f57f54057d2a7af0efecc8b0b66f5708", "", "frank"]
2022-05-01 06:48:57 -04:00
]
```
When the user sees `21df6d143fb96c2ec9d63726bf9edc71` the client can show _erin_ instead;
When the user sees `a8bb3d884d5d90b413d9891fe4c4e46d` the client can show _david.erin_ instead;
When the user sees `f57f54057d2a7af0efecc8b0b66f5708` the client can show _frank.david.erin_ instead.