RSS3 v0.1.0
Latest editor's draft:
Editors:
- DIYgod (NaturalSelectionLabs)
- Joshua (NaturalSelectionLabs)
- Atlas (NaturalSelectionLabs)
Reviewers
- Zui (NaturalSelectionLabs)
- Usagi (NaturalSelectionLabs)
Participate:
1. Abstract
Derived from the best out of RSS, RSS3 is an open protocol designed for content and social networks in the Web 3.0 era.
This document describes the interfaces of RSS3 files.
2. Status of This Document
The proposal is being incubated in the NaturalSelectionLabs.
GitHub issues and discussions are preferred for discussion of this specification.
3. Future Compatibility
This version is a pre-release version, so it is not guaranteed to be compatible with subsequent versions, but breaking updates will be kept to a minimum.
4. Concepts
- Persona - a user, either as an individual or as a group
- Item - An item published by a persona
- Context - One type of interactive content for an item
- Link - One type of relationship to other personas from current persona
- Backlink - A link from other personas to current persona
5. Interfaces
5.1 Interfaces in TypeScript
type RSS3ID = string;
type RSS3ItemID = string;
type RSS3ItemsID = string;
type RSS3ListID = string;
type ThirdPartyAddress = string[];
// Common attributes for each files
interface RSS3Base {
id: RSS3ID | RSS3ItemsID | RSS3ListID;
"@version": 'rss3.io/version/v0.1.0-rc.0';
date_created: string;
date_updated: string;
signature?: string;
}
// Entrance, RSS3 file
interface RSS3 extends RSS3Base {
id: RSS3ID;
profile: {
name?: string;
avatar?: ThirdPartyAddress;
bio?: string;
tags?: string[];
signature?: string;
};
items: RSS3Item[];
items_next?: RSS3ItemsID;
links?: {
type: string;
tags?: string[];
list: RSS3ID[];
list_next?: RSS3ListID;
signature?: string;
}[];
"@backlinks"?: {
type: string;
list: RSS3ID[];
list_next?: RSS3ListID;
}[];
assets?: {
type: string;
tags?: string[];
content: string;
}[];
}
// RSS3Items file
interface RSS3Items extends RSS3Base {
id: RSS3ItemsID;
items: RSS3Item[];
items_next?: RSS3ItemsID;
}
// RSS3List file
interface RSS3List extends RSS3Base {
id: RSS3ListID;
list: RSS3ID[] | RSS3ItemID[];
list_next?: RSS3ListID;
}
interface RSS3Item {
id: RSS3ItemID;
authors?: RSS3ID[];
title?: string;
summary?: string;
tags?: string[];
date_published?: string;
date_modified?: string;
type?: string;
upstream?: RSS3ItemID;
contents?: {
address: ThirdPartyAddress;
mime_type: string;
name?: string;
tags?: string[];
size_in_bytes?: string;
duration_in_seconds?: string;
}[];
"@contexts"?: {
type?: string;
list: RSS3ItemID[];
list_next?: RSS3ListID;
}[];
signature?: string;
}
5.2 Examples
A persona 0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944
with a published item Hello World
and a comment to it
{
"id": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944",
"@version": "rss3.io/version/v0.1.0-rc.0",
"date_created": "2009-05-01T00:00:00.000Z",
"date_updated": "2021-05-08T16:56:35.529Z",
"profile": {
"name": "DIYgod",
"avatar": ["dweb://diygod.jpg", "https://example.com/diygod.jpg"],
"bio": "ๅไปฃ็ ๆฏ็ญ็ฑ๏ผๅๅฐไธ็ๅ
ๆปก็ฑ๏ผ",
"tags": ["demo", "lovely", "technology"]
},
"items": [{
"id": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-item-1",
"authors": ["0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944"],
"summary": "Yes!!",
"date_published": "2021-05-09T16:56:35.529Z",
"date_modified": "2021-05-09T16:56:35.529Z",
"type": "comment",
"upstream": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-item-0"
}, {
"id": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-item-0",
"authors": ["0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944"],
"title": "Hello World",
"summary": "Hello, this is the first item of RSS3.",
"date_published": "2021-05-08T16:56:35.529Z",
"date_modified": "2021-05-08T16:56:35.529Z",
"contents": [{
"file": ["dweb://never.html", "https://example.com/never.html"],
"mime_type": "text/html"
}, {
"file": ["dweb://never.jpg"],
"mime_type": "image/jpeg"
}],
"@contexts": [{
"type": "comment",
"list": ["0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-item-1"]
}, {
"type": "like",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}]
}],
"items_next": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-items-0",
"links": [{
"type": "follow",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}, {
"type": "superfollow",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}],
"@backlinks": [{
"type": "follow",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}],
"assets": [{
"type": "some experience point",
"content": "100"
}]
}
5.3 Fields
5.3.1 General
Fields starting with @
characters
- Entirely the responsibility of the hosting program
- May be modified by the hosting program at any time
- Not allowed to be modified by the persona
The signature
field
- Signed by persona's private key
- The signature content is the Keccak-256 hash of the object to which the field belongs and excluding fields starting with
@
characters and thesignature
field itself - Useful for the object integration verification for both server side and persona side
- If the server side is trusted, then this field is optional
- This field can appear anywhere in RSS3, the position in the interfaces is recommended
Extensions
Custom objects can be used in RSS3. Names must start with an _
character followed by a letter. Custom objects can appear anywhere in RSS3.
Empty contents
It is strongly recommended to delete fields with empty contents, including empty strings, empty arrays, empty objects
5.3.2 RSS3Base
Common attributes for each file
id
: Unique indicate for current file and public key for current persona@version
: Proposal version for current file. It should be likerss3.io/version/v1.0.0
date_created
: Specifies the created date in RFC 3339 formatdate_updated
: Specifies the updated date in RFC 3339 formatsignature
: Refer to General
5.3.3 RSS3
RSS3 file, indicating a persona
profile
: Profile of current personaname
: Name of current personaavatar
: Avatar of current persona. It is one or multiple third party addresses that link to an identical filebio
: Bio of current personatags
: Tags of current personasignature
: Refer to General
items
: Partial items published by current personaitems_next
: Next page ofitems
. See RSS3Items for more detailslinks
: Links for this personatype
: Link type, for example: follow superfollowtags
: Tags of current linklist
: Personas who belong to this linklist_next
: Next page of linklist
. See RSS3List for more detailssignature
: Refer to General
@backlinks
: Backlinks for this persona, for example: follow type of backlink means followers.type
: Ibidlist
: Ibidlist_next
: Ibid
assets
: Assets for current persona.type
: Asset type, for example: some experience pointtags
: Tags of current assetscontent
: Content of current assets
5.3.4 RSS3Items
RSS3Items file, used for pagination of RSS3 files
id
: Unique indicate for current file. Its value should be${RSS3ID}-items-${index}
items
: List of itemsitems_next
: Next page ofitems
5.3.5 RSS3List
RSS3List file, used for pagination of links and contexts
id
: Unique indicate for current file. Its value should be${RSS3ID}-list-${field}-${type}
list
: Listlist_next
: Next page oflist
5.3.6 RSS3Item
Indicating a content posted by a persona or a context
id
: Unique ID of current item. Its value should be${RSS3ID}-item-${index}
authors
: Authors of current item. It is a list ofRSSOtherPersona
title
: Title of current itemsummary
: Content summary of current itemtags
: Tags of current itemdate_published
: Specifies the published date in RFC 3339 formatdate_modified
: Specifies the modified date in RFC 3339 formattype
: Item type for the not original item, for example: comment likeupstream
: Upstream of the not original itemcontents
: Contents of current item, possibly multiple different types of contentaddress
: Content address. It is one or multiple third party addresses that link to an identical filemime_type
: MIME type of current contentname
: Name of current contenttags
: Tags of current contentsize_in_bytes
: Size of current content in bytesduration_in_seconds
: Duration of current content in seconds. Mainly for audio and video use
@contexts
: Interactive items from other personas.type
: Same as type abovelist
: Items that belong to this contextlist_next
: Next page of contextlist
. See RSS3List for more details
signature
: Refer to General