Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/companion_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,10 @@ Connection](https://identity.foundation/decentralized-web-node/spec/images/topol
This will give users the ability to access encrypted data on a DWN for only a
subset of a DWN, using a derived key. There is also a vision of DWNs being
able to work using homomorphic entryption, however this is an area of research now.
- **What's the point of the protocols property in the protocols specification?
Why does it need to exist?** It is the URI which items are bucketed under. You
create records under that uri namespace. Protocol and schema are required to be URIs
- **No additional properties?** Becausae JSON Schema
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **No additional properties?** Becausae JSON Schema
- **No additional properties?** Because JSON Schema ???


### Reference Implementations

Expand Down
92 changes: 92 additions & 0 deletions spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,98 @@ given schema, which may be well-known in a given vertical or industry, apps and
the same datasets across one another, enabling a cohesive, cross-platform, cross-device, cross-app
experience for users.

#### `Records Read`

`RecordsRead` messages are JSON objects that include general [Message Descriptor](#message-descriptors) properties and the following additional properties, which ****MUST**** be composed as follows:

- The message object ****MUST**** contain a `descriptor` property, and its value ****MUST**** be a JSON object composed as follows:
- The object ****MUST**** contain an `interface` property, and its value ****MUST**** be the string `Records`.
- The object ****MUST**** contain a `method` property, and its value ****MUST**** be the string `Read`.
- The object ****MUST**** contain a `date` property, and its value
****MUST**** be of type string property, and its value ****MUST**** be an
[[spec:rfc3339]] ISO 8601 timestamp that ****MUST**** be set and interpreted
as the time the `RecordsWrite` was created by the DID owner or another permitted party.
- The object ****MUST**** contain a `recordId` property, and its value ****MUST**** be the `recordId` of the logical record the entry corresponds with.

A reference of the json schema can be found in the
[schemas](https://github.com/decentralized-identity/decentralized-web-node/blob/main/schemas/json-schemas/records/records-read.json)
directory of the specification.

<tab-panels selected-index="0">
<nav>
<button type="button">Simple Records Read Example</button>
<button type="button">Sample JSON Schema</button>
</nav>

<section>

::: example Records Read - Minimal Example

```json
{
"descriptor": {
"recordId": "b65b7r8n7bewv5w6eb7r8n7t78yj7hbevsv567n8r77bv65b7e6vwvd67b6",
"date": "2002-10-02T10:00:00-05:00",
"method": "Read",
"interface": "Records"
}
}
```
</section>

<section>

::: example Records Read - JSON Schema

```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://identity.foundation/dwn/json-schemas/records-read.json",
"type": "object",
"additionalProperties": false,
"required": [
"descriptor"
],
"properties": {
"authorization": {
"$ref": "https://identity.foundation/dwn/json-schemas/general-jws.json"
},
"descriptor": {
"type": "object",
"additionalProperties": false,
"required": [
"interface",
"method",
"date",
"recordId"
],
"properties": {
"interface": {
"enum": [
"Records"
],
"type": "string"
},
"method": {
"enum": [
"Read"
],
"type": "string"
},
"date": {
"type": "string"
},
"recordId": {
"type": "string"
}
}
}
}
}
```
</section>
</tab-panels>

#### `RecordsQuery`

`RecordsQuery` messages are JSON objects that include general [Message Descriptor](#message-descriptors) properties and the following additional properties, which ****must**** be composed as follows:
Expand Down