repurpose NIP-02 and add NIP authorship.
embed the functionalities added by https://github.com/fiatjaf/nostr/pull/16 into NIP-02, which can now be used for petnames, contact sharing and follow-list backups.
This commit is contained in:
parent
dcd8cc38bb
commit
9ee3a0259e
|
@ -4,7 +4,7 @@ NIP-01
|
|||
Basic protocol flow description
|
||||
-------------------------------
|
||||
|
||||
`draft` `mandatory`
|
||||
`draft` `mandatory` `author:fiatjaf`
|
||||
|
||||
This NIP defines the basic protocol that should be implemented by everybody. New NIPs may add new optional (or mandatory) fields and messages and features to the structures and flows described here.
|
||||
|
||||
|
@ -21,7 +21,7 @@ The single object type that exists is the `event`, which has the following forma
|
|||
kind: <integer>,
|
||||
tags: [
|
||||
["e", <32-bytes hex of the id of another event>, <recommended relay URL>],
|
||||
["p", <32-bytes hex of the id of another event>, <recommended relay URL>],
|
||||
["p", <32-bytes hex of the key>, <recommended relay URL>],
|
||||
... // other kinds of tags may be included later
|
||||
]
|
||||
content: <arbitrary string>,
|
||||
|
|
50
nips/02.md
50
nips/02.md
|
@ -1,32 +1,54 @@
|
|||
NIP-02
|
||||
======
|
||||
|
||||
Petname sharing through a special event `3`: "contact list"
|
||||
-----------------------------------------------------------
|
||||
Contact List and Petnames
|
||||
-------------------------
|
||||
|
||||
`draft` `optional`
|
||||
`draft` `optional` `author:fiatjaf` `author:arcbtc`
|
||||
|
||||
A special event with kind `3`, meaning "contact list" is defined as having a `content` equal to a JSON string (yes, encoded JSON inside a JSON string) that decodes to the a list of tuples of `<pubkey>` (32 bytes hex) and `<name>` (arbitrary UTF-8 name, maximum 32 characters), as the following example:
|
||||
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.
|
||||
|
||||
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 `null` or a invalid string if not needed), and a local name (or "petname") for that profile (can also be set to `null`), i.e., `["p", <32-bytes hex key>, <main relay URL>, <petname>]`. The `content` can be anything and should be ignored.
|
||||
|
||||
For example:
|
||||
|
||||
```json
|
||||
[
|
||||
["91cf9c4c5d9b675c00afd68db164e5ca", "alice"],
|
||||
["14aeb4daf2045e469f2dff496f48dad4", "bob"],
|
||||
["612ae030a3856e463a363390250e610f", "carol"]
|
||||
]
|
||||
{
|
||||
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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
This can be published by anyone and used by clients to construct local ["petname"](http://www.skyhunter.com/marcs/petnames/IntroPetNames.html) tables derived from other people's contact lists.
|
||||
## Uses
|
||||
|
||||
## Example
|
||||
### Contact list backup
|
||||
|
||||
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 contact lists of other people one might be following or browsing; or show the data in other contexts.
|
||||
|
||||
### Relay sharing
|
||||
|
||||
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-resistant.
|
||||
|
||||
### Petname scheme
|
||||
|
||||
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:
|
||||
|
||||
A user has an internal contact list that says
|
||||
|
||||
```json
|
||||
[
|
||||
["21df6d143fb96c2ec9d63726bf9edc71", "erin"]
|
||||
["p", "21df6d143fb96c2ec9d63726bf9edc71", null, "erin"]
|
||||
]
|
||||
```
|
||||
|
||||
|
@ -34,7 +56,7 @@ And receives two contact lists, one from `21df6d143fb96c2ec9d63726bf9edc71` that
|
|||
|
||||
```json
|
||||
[
|
||||
["a8bb3d884d5d90b413d9891fe4c4e46d", "david"]
|
||||
["p", "a8bb3d884d5d90b413d9891fe4c4e46d", null, "david"]
|
||||
]
|
||||
```
|
||||
|
||||
|
@ -42,7 +64,7 @@ and another from `a8bb3d884d5d90b413d9891fe4c4e46d` that says
|
|||
|
||||
```json
|
||||
[
|
||||
["f57f54057d2a7af0efecc8b0b66f5708", "frank"]
|
||||
["p", "f57f54057d2a7af0efecc8b0b66f5708", null, "frank"]
|
||||
]
|
||||
```
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ NIP-03
|
|||
OpenTimestamps Attestations for Events
|
||||
--------------------------------------
|
||||
|
||||
`draft` `optional`
|
||||
`draft` `optional` `author:fiatjaf`
|
||||
|
||||
When there is an OTS available it MAY be included in the existing event body under the `ots` key:
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ NIP-04
|
|||
Encrypted Direct Message
|
||||
------------------------
|
||||
|
||||
`draft` `optional`
|
||||
`draft` `optional` `author:arcbtc`
|
||||
|
||||
A special event with kind `4`, meaning "encrypted direct message". It is supposed to have the following attributes:
|
||||
|
||||
|
|
Loading…
Reference in New Issue