Skip to content

Commit

Permalink
Reserve kind and add example
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfranca committed Sep 21, 2023
1 parent 1966477 commit 7ae597f
Showing 1 changed file with 61 additions and 3 deletions.
64 changes: 61 additions & 3 deletions 61.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ NIP-61
Unbounded List
--------------

`draft` `optional` `author:arthurfranca`

An unbounded list is a group of events with the same pubkey and `n` (name) tag.
An event can have many `n` tags, thus being member of many unbounded lists.

Expand All @@ -12,18 +14,74 @@ or by an `nunb` [NIP-19](19.md) entity using [NIP-21](21.md) URI.

## Use Cases

Unbounded lists are an option to hold a big number of items. In contrast, NIP-51 lists
Unbounded lists are an option to hold a big number of items. In contrast, [NIP-51](51.md) lists
have a limit on the number of items depending on relay's event size restrictions.

In fact, an unbounded list can be made of different NIP-51 lists from the same author.

For example, the NIP-51 lists may be "Close Friends" and "Family" but all sharing the same `n` tag,
For example, the NIP-51 lists may be "close_friends" and "family" and both sharing the same `n` tag,
effectively making an unbounded list combining both sets of `p` tags.

## Referencing

An unbounded list is referenced by an `u` tag. It references a set of events instead of a single one:
An unbounded list is referenced by an `u` tag.
It references a set of events from an author instead of a single one:

`["u", "<32-bytes lowercase hex of a pubkey>:<n tag value>", "<recommended relay URL, optional>"]`

One may also use an `nunb` entity URI: `nostr:nunb1qqstn...794234d`.

## Unbounded List Event Kinds

Any event kind can be part of an unbounded list by just adding an `n` tag. Nevertheless,
there are reserved kinds for specific usage:

| kind | list type |
| ------ | ----------|
| 33118 | People |

Tags other than `d` and `n` may be encrypted with [NIP-44](#44.md) similar to NIP-51 lists.

### Unbounded People List

An event with kind `33118` is defined as a parameterized replaceable unbounded list event for people.
The `n` tag(s) holds the list name(s) the event is currently part of.
The `p` tags included in these lists MUST follow the format of kind 3 events as defined in [NIP-02 - Contact List and Petnames](02.md).

## Event Examples

```js
{
"kind": 33118,
"tags": [
["d", "random6467362966154779"]
// this is enough to mark it as a "subscribers" unbounded list
["n", "subscribers"],
// This also adds this event to other unbounded list (e.g.: meant
// to holl all pubkeys who can access the
// 5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36 event)
// made of the "subscribers" unbounded list events
// and other events such as NIP-51 Categorized People lists
["n", "private:5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"],
],
"content": "<NIP-44 encrypted Stringified TAG-List([
["p", "91cf9..4e5ca", "wss://alicerelay.com/"]
])>",
...other fields
}
```
```js
{
"kind": 30000,
"tags": [
["d", "close_friends"]
["n", "private:5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"],
],
"content": "<NIP-44 encrypted Stringified TAG-List([
["p", "14aeb..8dad4", "wss://bobrelay.com/nostr"],
["p", "612ae..e610f", "ws://carolrelay.com/ws"]
])>",
...other fields
}
```

0 comments on commit 7ae597f

Please sign in to comment.