You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/spec.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1203,6 +1203,8 @@ Retained messages in the Records interface are those that may be stored against
1203
1203
1204
1204
DWeb Nodes are designed to act the substrate upon which a wide variety of decentralized applications and services can be written. With an interface like [Records](#records) alone, a DWeb Node owner and those they permission can write isolated records, but that alone is not enough to support and facilitate decentralized apps. Protocols introduces a mechanism for declaratively encoding an app or service's underlying protocol rules, including segmentation of records, relationships between records, data-level requirements, and constraints on how participants interact with a protocol. With the DWeb Node Protocols mechanism, one can model the underpinning protocols for a vast array of use cases in a way that enables interop-by-default between app implementations that ride on top of them.
1205
1205
1206
+
1207
+
1206
1208
#### `ProtocolsConfigure`
1207
1209
1208
1210
`ProtocolsConfigure` messages are JSON objects that include general [Message Descriptor](#message-descriptors) properties and the following additional properties, which ****must**** be composed as follows:
@@ -1293,6 +1295,12 @@ Protocol Definition objects are declarative rules within `ProtocolConfigure` mes
1293
1295
- The _Protocols Definition_ object ****MUST**** contain a `structure` property, and its value ****MUST**** be a _Record Rules_ object whose keys match the labels defined in the _Protocols Definition_ object. This object is recursive, allowing subsequent record relationships to be defined within. Labeled members of the object are composed as follows:
1294
1296
- The keys of the object ****MUST**** be a string that matches one of the `types`
1295
1297
- The values representing those keys within the object ****MUST**** be an object composed as follows:
1298
+
- The object ****MAY**** contain a `$tags` property; if present, its value ****MUST**** be an object with defined constraints:
1299
+
- `$requiredTags` (optional) is an array that lists required tag names.
1300
+
- `$allowUndefinedTags` (optional) is a boolean that defaults to false, and if set to false, undefined tags are not allowed.
1301
+
- The constraints are a subset of JSON Schema that may include properties such as `type`, `enum`, `minimum`, `maximum`, `minLength`, `maxLength`, and others.
1302
+
- Protocols can define these constraints for each tag, ensuring adherence to the expected formats and usage guidelines specified within the protocol definition.
1303
+
1296
1304
- The object ****MAY**** contain an `$actions` property and its value ****MUST**** be an array of rule set objects described as follows:
1297
1305
- The object ****MUST**** contain a `who` property and it ****MUST**** have one of the following values:
0 commit comments