Crates.io | pubky-app-specs |
lib.rs | pubky-app-specs |
version | |
source | src |
created_at | 2024-11-27 08:48:34.65789 |
updated_at | 2024-11-29 15:56:17.459473 |
description | Pubky.app Data Model Specifications |
homepage | https://pubky.app |
repository | https://github.com/pubky/pubky-app-specs |
max_upload_size | |
id | 1462796 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Version 0.2.1
⚠️ Warning: Rapid Development Phase
This specification is in an early development phase and is evolving quickly. Expect frequent changes and updates as the system matures. Consider this a v0 draft.When we reach the first stable, long-term support version of the schemas, paths will adopt the format:
pubky.app/v1/
to indicate compatibility and stability.
This document specifies the data models and validation rules for the Pubky.app clients interactions. It defines the structure of data entities, their properties, and the validation rules to ensure data integrity and consistency. This is intended for developers building compatible libraries or clients.
This document intents to be a faithful representation of our Rust pubky.app models. If you intend to develop in Rust, use them directly. In case of disagreement between this document and the Rust implementation, the Rust implementation prevails.
Pubky.app models are designed for decentralized content sharing. The system uses a combination of timestamp-based IDs and Blake3-hashed IDs encoded in Crockford Base32 to ensure unique identifiers for each entity.
Description: Represents a user's profile information.
URI: /pub/pubky.app/profile.json
Field | Type | Description | Validation Rules |
---|---|---|---|
name |
String | User's name. | Required. Length: 3–50 characters. Cannot be "[DELETED]" . |
bio |
String | Short biography. | Optional. Maximum length: 160 characters. |
image |
String | URL to the user's profile image. | Optional. Valid URL. Maximum length: 300 characters. |
links |
Array | List of associated links (title + URL). | Optional. Maximum of 5 links, each with title (100 chars max) and valid URL (300 chars max). |
status |
String | User's current status. | Optional. Maximum length: 50 characters. |
Validation Notes:
[DELETED]
cannot be used for name
.UserLink
in links
must have a valid title and URL.Example: Valid User
{
"name": "Alice",
"bio": "Toxic maximalist.",
"image": "pubky://user_id/pub/pubky.app/files/0000000000000",
"links": [
{
"title": "GitHub",
"url": "https://github.com/alice"
}
],
"status": "Exploring decentralized tech."
}
Description: Represents metadata of file uploaded by the user.
URI: /pub/pubky.app/files/:file_id
Field | Type | Description | Validation Rules |
---|---|---|---|
name |
String | Name of the file. | Required. |
created_at |
Integer | Unix timestamp of creation. | Required. |
src |
String | File blob URL | Required. |
content_type |
String | MIME type of the file. | Required. |
size |
Integer | Size of the file in bytes. | Required. Positive integer. |
Validation Notes:
file_id
in the URI must be a valid Timestamp ID.Description: Represents a user's post.
URI: /pub/pubky.app/posts/:post_id
Field | Type | Description | Validation Rules |
---|---|---|---|
content |
String | Content of the post. | Required. Max length: 1000 (short), 50000 (long). Cannot be "[DELETED]" . |
kind |
String | Type of post. | Required. Must be a valid PubkyAppPostKind value. |
parent |
String | URI of the parent post (if a reply). | Optional. Must be a valid URI if present. |
embed |
Object | Embedded content (type + URI). | Optional. URI must be valid if present. |
attachments |
Array | List of attachment URIs. | Optional. Each must be a valid URI. |
Post Kinds:
short
long
image
video
link
file
Example: Valid Post
{
"content": "Hello world! This is my first post.",
"kind": "short",
"parent": null,
"embed": {
"kind": "short",
"uri": "pubky://user_id/pub/pubky.app/posts/0000000000000"
},
"attachments": ["pubky://user_id/pub/pubky.app/files/0000000000000"]
}
Description: Represents a tag applied to a URI.
URI: /pub/pubky.app/tags/:tag_id
Field | Type | Description | Validation Rules |
---|---|---|---|
uri |
String | URI of the tagged object. | Required. Must be a valid URI. |
label |
String | Label for the tag. | Required. Trimmed, lowercase. Max length: 20 characters. |
created_at |
Integer | Unix timestamp of creation. | Required. |
Validation Notes:
tag_id
is a Hash ID derived from the uri
and label
.Description: Represents a bookmark to a URI.
URI: /pub/pubky.app/bookmarks/:bookmark_id
Field | Type | Description | Validation Rules |
---|---|---|---|
uri |
String | URI of the bookmark. | Required. Must be a valid URI. |
created_at |
Integer | Timestamp of creation. | Required. |
Validation Notes:
bookmark_id
is a Hash ID derived from the uri
.Description: Represents a follow relationship.
URI: /pub/pubky.app/follows/:user_id
Field | Type | Description | Validation Rules |
---|---|---|---|
created_at |
Integer | Timestamp of creation. | Required. |
Description: Represents a feed configuration.
URI: /pub/pubky.app/feeds/:feed_id
Field | Type | Description | Validation Rules |
---|---|---|---|
tags |
Array | List of tags for filtering. | Optional. Strings must be trimmed. |
reach |
String | Feed visibility (e.g., all , friends ). |
Required. Must be a valid reach. |
layout |
String | Feed layout style (e.g., columns ). |
Required. Must be valid layout. |
sort |
String | Sort order (e.g., recent ). |
Required. Must be valid sort. |
content |
String | Type of content filtered. | Optional. |
name |
String | Name of the feed. | Required. |
This specification is released under the MIT License.