RSS3 v0.2.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 beta 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 {
"@version": 'rss3.io/version/v0.2.0'; // Proposal version for current file. It should be like `rss3.io/version/v1.0.0`
id: RSS3ID | RSS3ItemsID | RSS3ListID; // Unique indicate for current file and public key for current persona
date_created: string; // Specifies the created date in RFC 3339 format
date_updated: string; // Specifies the updated date in RFC 3339 format
}
// Entrance, RSS3 file, indicating a persona
interface RSS3 extends RSS3Base {
id: RSS3ID;
signature?: string; // Signed by persona's private key; The signature content is the Keccak-256 hash of the array of object sorted by alphabetical and excluding fields starting with `@` characters and the `signature` field itself, for example {"@a": "1", c: "2", b: {d: "3"}} -> [["b", ["d", "3"]], ["c", "2"]] or `Hi, RSS3. I'm your agent ${agent_id}` if using agent signature; Useful for the object integration verification for both server side and persona side; If the server side is trusted, then this field is optional
agent_id?: string; // A random ed25519 public key generated by the client
agent_signature?: string; // A signature signed by `agent_id`'s private key, its content is the same as `signature`
owers?: RSS3ID[]; // Additional owner of the file other than id
profile?: {
name?: string;
avatar?: ThirdPartyAddress;
bio?: string;
tags?: string[];
};
items?: RSS3Item[]; // Items published by current persona
items_next?: RSS3ItemsID; // Next page of items
links?: { // Next page of `items`. See **RSS3Items** for more details
type: string; // Link type, for example: follow superfollow
tags?: string[];
list?: RSS3ID[]; // Personas who belong to this link
}[];
"@backlinks"?: { // Backlinks for this persona, for example: follow type of backlink means followers.
type: string; // The same as links.type
list?: RSS3ListID; // File ID of backlink list that belong to this type. See **RSS3List** for more details
}[];
accounts?: {
platform: string; // Platform name, for example: EVM+ or Twitter
identity: string; // Platform identity, for example: 0x1234567890123456789012345678901234567890 or @username
signature?: string; // Signature of [["address": id], ["identity": account.identity], ["platform", account.platform]], optional for no public-key cryptography platform
tags?: string[];
}[];
"@assets"?: {
platform: string; // Corresponding to accounts.platform
identity: string; // Corresponding to accounts.identity
id: string; // Unique asset ID
type?: string; // Asset type, for example: Ethereum-NFT xDai-POAP
}[];
}
// RSS3Items file, used for pagination of RSS3 files
interface RSS3Items extends RSS3Base {
id: RSS3ItemsID; // Unique indicate for current file. Its value should be `${RSS3ID}-items-${index}`
signature?: string;
agent_id?: string;
agent_signature?: string;
items: RSS3Item[]; // List of items
items_next?: RSS3ItemsID; // Next page of items
}
// RSS3List file, used for pagination of links and contexts
interface RSS3List extends RSS3Base {
id: RSS3ListID; // Unique indicate for current file. Its value should be `${RSS3ID}-list-${field}-${type}`
list?: RSS3ID[] | RSS3ItemID[];
list_next?: RSS3ListID;
}
// Indicating a content posted by a persona or a context
interface RSS3Item {
id: RSS3ItemID; // Unique ID of current item. Its value should be `${RSS3ID}-item-${index}`
authors?: RSS3ID[];
title?: string;
summary?: string;
tags?: string[];
date_published?: string; // Specifies the published date in RFC 3339 format
date_modified?: string; // Specifies the modified date in RFC 3339 format
type?: string; // Item type for the not original item, for example: comment like
upstream?: RSS3ItemID; // Upstream of the not original item
contents?: { // Contents of current item, possibly multiple different types of content
address: ThirdPartyAddress; // Content address. It is one or multiple third party addresses that link to an identical file
mime_type: string; // [MIME type](https://en.wikipedia.org/wiki/Media_type) of current content
name?: string;
tags?: string[];
size_in_bytes?: string;
duration_in_seconds?: string;
}[];
"@contexts"?: { // Interactive items from other personas.
type?: string;
list: RSS3ListID; // File ID of items list that belong to this context. See **RSS3List** for more details
}[];
}
5.2 Fields
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
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 Examples
A persona 0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944
with a published item Hello World
and a comment to it
{
"@version": "rss3.io/version/v0.2.0",
"id": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944",
"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": [{
"address": ["dweb://never.html", "https://example.com/never.html"],
"mime_type": "text/html"
}, {
"address": ["dweb://never.jpg"],
"mime_type": "image/jpeg"
}],
"@contexts": [{
"type": "comment",
"list": "[email protected]@comment-0"
}, {
"type": "like",
"list": "[email protected]@like-0"
}]
}],
"items_next": "0xC8b960D09C0078c18Dcbe7eB9AB9d816BcCa8944-items-0",
"links": [{
"type": "follow",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}, {
"type": "superfollow",
"list": ["0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
}],
"@backlinks": [{
"type": "follow",
"list": "[email protected]"
}],
"accounts": [{
"platform": "EVM+",
"identity": "0x1234567890123456789012345678901234567890",
"signature": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}];
"@assets": [{
"platform": "EVM+",
"identity": "0x1234567890123456789012345678901234567890",
"id": "0xacbe98efe2d4d103e221e04c76d7c55db15c8e89-5",
"type": "Ethereum-NFT"
}]
}