Skip to content

Commit d7a0b7c

Browse files
committed
Finalize detailed description for $tags property with constraints in protocol definition
1 parent 6a7372c commit d7a0b7c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/spec.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,8 @@ Retained messages in the Records interface are those that may be stored against
12031203

12041204
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.
12051205

1206+
1207+
12061208
#### `ProtocolsConfigure`
12071209

12081210
`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
12931295
- 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:
12941296
- The keys of the object ****MUST**** be a string that matches one of the `types`
12951297
- 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+
12961304
- The object ****MAY**** contain an `$actions` property and its value ****MUST**** be an array of rule set objects described as follows:
12971305
- The object ****MUST**** contain a `who` property and it ****MUST**** have one of the following values:
12981306
- `anyone`

0 commit comments

Comments
 (0)