-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-62: Curated Publications #1600
Open
limina1
wants to merge
5
commits into
nostr-protocol:master
Choose a base branch
from
limina1:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+106
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
NIP-62 | ||
====== | ||
|
||
Curated Publication | ||
---------- | ||
|
||
`draft` `optional` | ||
|
||
This NIP defines the minimum specification for curated publication - ordered, optionally-hierarchical assemblies of nostr events. Collections provide a standard way to organize and present related content, similar to how books organize chapters or journals organize articles. | ||
|
||
## Event Kinds | ||
|
||
This NIP defines two primary event kinds: | ||
|
||
- `30040`: Publication Index | ||
- `30041`: Publication Content | ||
|
||
## kind 30040: Publication Index | ||
|
||
A publication index defines the structure and metadata of a collection. It serves as a table of contents that references the actual content sections. | ||
|
||
### Requirements | ||
|
||
- The `content` field MUST be empty | ||
- MUST include a `title` tag containing the full title of the collection | ||
- MUST be uniquely identifiable by the combination of: | ||
- `d` tag | ||
- `pubkey` | ||
- `kind` | ||
- MUST include `e` tags listing the events in desired display order | ||
- Referenced events SHOULD be kind 30041 sections or nested kind 30040 indices | ||
- Additional event kinds MAY be supported | ||
- For derivative works: | ||
- MUST include a `p` tag identifying the original author | ||
- MUST include an `E` tag referencing the original event immediately after the `p` tag | ||
|
||
### Example Index | ||
|
||
```json | ||
{ | ||
"id": "<event_id>", | ||
"pubkey": "<event_originator_pubkey>", | ||
"created_at": 1725087283, | ||
"kind": 30040, | ||
"tags": [ | ||
["d", "aesop's-fables-by-aesop"], | ||
["title", "Aesop's Fables"], | ||
["author", "Aesop"], | ||
["i", "isbn:9780765382030"], | ||
["t", "fables"], | ||
["t", "classical"], | ||
["t", "literature"], | ||
["published_on", "2003-05-03"], | ||
["published_by", "public domain"], | ||
["image", "https://imageserver.com/piclink.jpg"], | ||
["summary", "Collection of selected fables from the ancient Greek philosopher, known as Aesop."], | ||
["e", "<id>", "<relay_url>", "<pubkey>"], | ||
["e", "<id>", "<relay_url>", "<pubkey>"], | ||
["p", "<pubkey_0>"], | ||
["E", "<original_event_id>", "<relay_url>", "<pubkey>"] | ||
], | ||
"sig": "<event_signature>" | ||
} | ||
``` | ||
|
||
## 30041: Publication Content | ||
|
||
Also known as sections, zettels, episodes, or chapters contain the actual content that makes up a collection. | ||
|
||
### Requirements | ||
|
||
- MUST include a `d` tag | ||
- MUST include a `title` tag describing the section (e.g., "Introduction", "Chapter 1", etc.) | ||
- The `content` field: | ||
- MUST contain text meant for display to the end user | ||
- MAY contain AsciiDoc markup | ||
- MAY contain wikilinks (denoted by double brackets) | ||
|
||
### Example Section | ||
|
||
```json | ||
{ | ||
"id": "<event_id>", | ||
"pubkey": "8ae74c618a4713f32129...", | ||
"created_at": 1708083476, | ||
"kind": 30041, | ||
"tags": [ | ||
["title", "The Farmer and The Snake"], | ||
["d", "aesop's-fables-by-aesop-the-farmer-and-the-snake"], | ||
["wikilink", "fable", "ad9dad8c4006d781d94ae001884b6987caa2a6852f3f43a571ca6838d0ced3af", "wss://thecitadel.nostr1.com"] | ||
], | ||
"content": "== The Farmer and The Snake\nA [[fable]], by Aesop.\nONE WINTER a Farmer found a Snake stiff and frozen with cold. He had compassion on it, and taking it up, placed it in his bosom. The Snake was quickly revived by the warmth, and resuming its natural instincts, bit its benefactor, inflicting on him a mortal wound. 'Oh,' cried the Farmer with his last breath, 'I am rightly served for pitying a scoundrel.'\nThe greatest kindness will not bind the ungrateful.", | ||
"sig": "49cab8c75fb35cec71d07258..." | ||
} | ||
``` | ||
|
||
## Extensions | ||
|
||
Collections are flexible and can be extended for different types of content. Examples include: | ||
|
||
- Books | ||
- Academic journals | ||
- Course materials | ||
- Documentation | ||
|
||
Additional tags relevant to the specific content type MAY be included in both index and section events. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIP-23 uses "published_at" for the timestamp the article was first published, and uses UNIX timestamp format-it might make sense to re-use that tag here, instead of defining a new one with a new format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally had that, but UNIX timestamps only go back to 1970, and we are publishing old books.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's true. Having to use negative timestamps for old books would be bad.
In that case, it would make sense to document the date format explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally specified ISO 8601.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, European and American dates would differ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. So just YYYY-MM-DD? i doubt this needs any of the extended formats, timezone suffixes, year-week format etc from ISO-8601.
(though for a book, "year of publication" is generally all the information available, also allowing like
YYYY
orYYYY-MM
might make sense, though it complicates sorting)