From d46a05fe12dd5715f7a004a9f85df0ea35491693 Mon Sep 17 00:00:00 2001 From: Wes Biggs Date: Fri, 12 Apr 2024 09:08:53 -0500 Subject: [PATCH] Proposal for a new user data type for profile-linked documents --- .spellcheckerdict.txt | 1 + pages/DSNP/Announcements.md | 4 +++- pages/DSNP/Types/CID.md | 48 +++++++++++++++++++++++++++++++++++++ pages/DSNP/UserData.md | 1 + pages/SUMMARY.md | 3 ++- 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 pages/DSNP/Types/CID.md diff --git a/.spellcheckerdict.txt b/.spellcheckerdict.txt index 144253f7..77b63816 100644 --- a/.spellcheckerdict.txt +++ b/.spellcheckerdict.txt @@ -8,6 +8,7 @@ CalVer CC0 Changelog changeType +cid [Cc]odec('s)? contentHash cryptographic diff --git a/pages/DSNP/Announcements.md b/pages/DSNP/Announcements.md index 8010868b..6abe3aec 100644 --- a/pages/DSNP/Announcements.md +++ b/pages/DSNP/Announcements.md @@ -15,12 +15,14 @@ Each Announcement has an enumerated type for use when separating out a stream of | 2 | [Broadcast](Types/Broadcast.md) | a public post | YES | YES | | 3 | [Reply](Types/Reply.md) | a public response to a Broadcast | YES | YES | | 4 | [Reaction](Types/Reaction.md) | a public visual reply to a Broadcast | no | no | -| 5 | [Profile](Types/Profile.md) | a profile | YES | no | +| 5 | ~~[Profile](Types/Profile.md)~~b | ~~a profile~~ | ~~YES~~ | ~~no~~ | | 6 | [Update](Types/Update.md) | an update to content| YES | no | | 7 | [Public Key](Types/PublicKey.md) | a public key for secure communication | no | no | a Since DSNP version 1.2, social graph changes use [User Data](UserData.md) operations as described in the [Graph](Graph.md) section. +b Since DSNP version 1.3, profile changes use [User Data](UserData.md) operations. + ## Announcement Validation There is no guarantee that, at time of creation, a given Announcement will be from the `fromId` claimed in the Announcement. diff --git a/pages/DSNP/Types/CID.md b/pages/DSNP/Types/CID.md new file mode 100644 index 00000000..d1d7a24e --- /dev/null +++ b/pages/DSNP/Types/CID.md @@ -0,0 +1,48 @@ +# CID + +A Content IDentifier is represented by the CID object type. + +## Serialization + +CID object serialization MUST conform to the following [Avro](https://avro.apache.org) schema: + +``` +{ + "namespace": "org.dsnp", + "name": "CID", + "type": "record", + "doc": "Content IDentifier for external document", + "fields": [ + { + "name": "cid", + "type": "string", + "doc": "Content IDentifier of document" + }, + { + "name": "type", + "type": "int", + "doc": "Type of document" + } + ] +} +``` + +## Generation + +### cid + +- MUST be a valid value per the [Content IDentifier](https://github.com/multiformats/cid) specification. + +It should be possible to locate the content item associated with a CID on a content-addressed distributed file system. + +### type + +- MUST be a supported DSNP linked document type. + +#### Supported Linked Document Types + +| Value | Description | Specification | Content Type | DSNP Version Added | +| --- | --- | --- | --- | +| 1 | Activity Content Profile with DSNP extensions | [DSNP Profile](../../ActivityContent/Types/Profile.md) | `application/json` | 1.3 | + +All other document type values are reserved for future expansion. diff --git a/pages/DSNP/UserData.md b/pages/DSNP/UserData.md index 5a3fca8f..13052845 100644 --- a/pages/DSNP/UserData.md +++ b/pages/DSNP/UserData.md @@ -19,6 +19,7 @@ DSNP implementations MUST support the following User Data Types: | `privateFollows` | 1.2 | `curve25519xsalsa20poly1305` | [`DEFLATE`](https://en.wikipedia.org/wiki/Deflate) | [GraphEdge](Types/GraphEdge.md) | | `privateConnections` | 1.2 | `curve25519xsalsa20poly1305` | [`DEFLATE`](https://en.wikipedia.org/wiki/Deflate) | [GraphEdge](Types/GraphEdge.md) | | `privateConnectionPRIds` | 1.2 | NONE | NONE | [PRId](Types/PRId.md) | +| `linkedCIDs` | 1.3 | NONE | NONE | [CID](Types/CID.md) | Data for each data type is initially formatted as a stream of Avro objects that should conform to the schema specified. Avro file- and block-level information (including in-stream schema) is omitted. diff --git a/pages/SUMMARY.md b/pages/SUMMARY.md index db8a0f1f..58126c71 100644 --- a/pages/SUMMARY.md +++ b/pages/SUMMARY.md @@ -8,17 +8,18 @@ - [User Data](DSNP/UserData.md) - [Graph Edge](DSNP/Types/GraphEdge.md) - [PRId](DSNP/Types/PRId.md) + - [CID](DSNP/Types/CID.md) - [Batch Publications](DSNP/BatchPublications.md) - [Announcements](DSNP/Announcements.md) - [Tombstone](DSNP/Types/Tombstone.md) - [Broadcast](DSNP/Types/Broadcast.md) - [Reply](DSNP/Types/Reply.md) - [Reaction](DSNP/Types/Reaction.md) - - [Profile](DSNP/Types/Profile.md) - [Update](DSNP/Types/Update.md) - [Public Key](DSNP/Types/PublicKey.md) - [Migrated Announcements](DSNP/Migrated.md) - [Graph Change](DSNP/Types/GraphChange.md) + - [Profile](DSNP/Types/Profile.md) - [Operations](DSNP/Operations.md) - [State Change Records](DSNP/Records.md) - [Serializations](DSNP/Serializations.md)