Schema
Every activity performed by a user can be described as a message with the follow schema:
Message
Name | Type | Description |
---|---|---|
id |
| Unique message ID based on the content hash of the message. See “Message ID” section. |
type |
| Main type describing the primary purpose of the message |
subtype |
| Sub type describing the secondary purpose of the message |
creator |
| Domain names of the creator (e.g. bob.eth, alice.crypto, etc) |
createdAt |
| Unix timestamp in seconds of when the message was created |
payload |
| Schema containing data of a message depends on type |
Message ID
We should hex-encode the message based on the following pseudo code in order to create a deterministic SHA256 hash.
A message can be used to described user activities such as a post, comment, likes, and follow.
Profile Message
The PROFILE type is used to support adding profile data to a name.
Name | Type | Description |
---|---|---|
value |
| value of the profile data |
Name | Type | Description |
---|---|---|
key |
| Custom key of profile data |
value |
| Custom value of profile data |
Post Message
The POST type is used to support posts (similar to tweets, status update, etc), comments, and reposts.
Name | Type | Description |
---|---|---|
topic |
| Topic of the post for ease of discovery. (e.g. sports, news) |
title |
| Plain text containing the title of the Post |
content |
| Markdown text containing content of the Post |
attachment |
| url or file message hash being attached to the message |
reference |
| post being reference |
File Message
The File type is used to support adding file to a name
Name | Type | Description |
---|---|---|
name |
| File name |
mimeType |
| Mime types of the file |
data |
| magnetURI for the torrent |
Name | Type | Description |
---|---|---|
name |
| File name |
mimeType |
| Mime types of the file |
data |
| ipfs hash for the file |
Moderation Message
The MODERATION type is used to support moderation activities, such as a LIKE, UPVOTE, DOWNVOTE, BAN, etc.
Name | Type | Description |
---|---|---|
| hash of the message receiving the moderation |
Connection Message
The CONNECTION type is used to support follows and other types of links between names.
Name | Type | Description |
---|---|---|
name |
| Domain names of the one being followed (e.g. bob.eth, alice.crypto, etc) |
Last updated