decentralized-identity / decentralized-web-node

Decentralized data storage and message relay for decentralized identity and apps.
https://identity.foundation/decentralized-web-node/spec/
Apache License 2.0
402 stars 79 forks source link

Records Commit Example Shows a `data` Field But Description Requires Clarification #207

Open andorsk opened 1 year ago

andorsk commented 1 year ago

On https://identity.foundation/decentralized-web-node/spec/#recordscommit, request for further clarity on the data field within a records commit. Shown in the example, but not expanded upon in the description section.

Example Given:

{ // Message
  "data": {...},
  "recordId": "b65b7r8n7bewv5w6eb7r8n7t78yj7hbevsv567n8r77bv65b7e6vwvd67b6",
  "descriptor": { // Message Descriptor
    "method": "RecordsCommit",
    "dataCid": CID(data),
    "parentId": CID(ANCESTOR_CID),
    "dateCreated": 123456789,
    "commitStrategy": "json-merge",
    "dataFormat": DATA_FORMAT
  }
}

Description:

RecordsCommit messages are JSON objects that include general Message Descriptor properties and the following additional properties, which MUST be composed as follows:

The message object MUST contain a recordId property, and its value MUST be the recordId of the logical record the entry corresponds with. If the message object is attached to a Protocol, and its value MUST be a Computed Context ID. If the message is not attached to a Protocol, it MUST NOT contain a contextId property. The message object MUST contain a descriptor property, and its value MUST be a JSON object composed as follows: The object MUST contain a method property, and its value MUST be the string RecordsCommit. The object MUST include a parentId property, and its value MUST be the stringified Version 1 CID of the DAG CBOR encoded descriptor object of the previous RecordsWrite or RecordsCommit ancestor in the record’s lineage. The object MUST contain a commitStrategy property, and if present its value MUST be a string from the table of registered Commit Strategies. The object MUST contain a dateCreated property, and its value MUST be an [RFC3339] ISO 8601 timestamp that MUST be set and interpreted as the time the commit was generated.

andorsk commented 1 year ago

Discussed on DIF call:

csuwildcat commented 1 year ago

For now I have removed the data prop from the examples, until we can get the precise language solid around where encodedData will appear and the details of its value. cc/ @thehenrytsai

andorsk commented 1 year ago

that works. Thanks @csuwildcat !

andorsk commented 1 year ago

@csuwildcat Was this merged and is if so, where? Can this be closed?

csuwildcat commented 1 year ago

Yes, it was merged, but I'd leave it open because it's not a full year resolved general issue