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: designdocs/schemas_protocols_intents.md
+19-15Lines changed: 19 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,11 @@
1
1
2
-
# 📘 Schema Protocols and Intent-Based Delegation in Frequency
2
+
# 📘 Design Discussion: Schema Protocols and Intent-Based Delegation in Frequency
3
3
4
-
## 1. **Background and Motivation**
4
+
## 0. **Work in Progress** <aid="section_0"></a>
5
+
6
+
Note: This document is a work in progress; specific implementation details and code examples exhibited herein are for illustrative purposes only. Once the various questions and concerns surfaced by this "pre-design" document have be answered satisfactorily, the document will be updated and expanded to include specific details related to the proposed implementation.
7
+
8
+
## 1. **Background and Motivation** <aid="section_1"></a>
5
9
6
10
In the current implementation, schemas are registered with immutable numeric identifiers (`SchemaId`) and describe the layout and storage semantics (e.g., Avro/Parquet formats, on-chain/off-chain storage). These schema IDs are used as references by clients and runtime modules alike, particularly in the delegation system defined by the `msa` pallet.
7
11
@@ -20,7 +24,7 @@ These limitations have motivated a re-architecture of the schema and delegation
20
24
-**Intent-based delegation**
21
25
-**More expressive APIs and storage models**
22
26
23
-
## 2. **Design Goals**
27
+
## 2. **Design Goals** <aid="section_2"></a>
24
28
25
29
This section outlines the key objectives that guide the redesign of Frequency's schema and delegation architecture.
26
30
@@ -32,7 +36,7 @@ This section outlines the key objectives that guide the redesign of Frequency's
32
36
-**Namespace Ownership and Governance**
33
37
-**On-Chain Efficiency**
34
38
35
-
## 3. **Schema Protocols and Versioning**
39
+
## 3. **Schema Protocols and Versioning** <aid="section_3"></a>
36
40
37
41
Protocols are not just organizational tools—they enable meaningful delegation. In the new model, a protocol is a first-class on-chain entity that represents a named and versioned group of schemas. Every schema is assigned to a protocol, and new versions of a protocol simply add new schema IDs to the protocol's version history.
38
42
@@ -58,7 +62,7 @@ Protocols are not just organizational tools—they enable meaningful delegation.
58
62
- Minor updates (new schema version) may be published by the namespace owner
59
63
- Major updates require a new protocol (e.g., change in semantic intent)
In order to provide organizational control, accountability, and publishing boundaries for schemas and intents, the protocol introduces the concept of **namespaces**.
64
68
@@ -69,7 +73,7 @@ A namespace (e.g., `dsnp`, `bsky`) serves as a root authority under which protoc
69
73
Each namespace is a unique identifier, typically human-readable (e.g., `"dsnp"`), mapped to an on-chain `NamespaceId` (e.g., `NamespaceId = 2`).
70
74
71
75
- Every protocol must be published under a namespace: `namespace.protocol`
72
-
- Intents may also be published under a namespace _(open question, discussed below)_
76
+
- Intents may also be published under a namespace _(open question, discussed [below](#section_6))_
73
77
74
78
### 👤 Ownership and Control
75
79
@@ -98,7 +102,7 @@ Namespaces define logical and administrative isolation between ecosystems. For e
98
102
99
103
This structure provides a trust boundary that maps to real-world organizational authority.
Delegation is the mechanism by which a user authorizes a provider to act on their behalf. Currently, this is limited to individual `SchemaId`s, but we propose expanding the delegation model to include one or more of the following:
104
108
- Delegation by `SchemaId` (existing/legacy, for future deprecation)
@@ -135,7 +139,7 @@ pub type Delegations<T> = StorageDoubleMap<
135
139
136
140
This unified structure supports flexibility while maintaining clear access logic.
Intents represent abstract actions or operations that a provider may be authorized to perform on behalf of a user. While schemas define how data is structured, intents define what that data _means_ or how it is _used_.
141
145
@@ -192,7 +196,7 @@ We explore three models for intent registration and delegation:
192
196
193
197
Since the only expected use case for namespaced intents is to fill the gap where no global intent exists, the cleaner long-term solution is to require governance-approved global-only intents, while using delegation scoping to preserve control.
This section outlines how delegation is verified at the time of an extrinsic call or message submission. In the new model, the runtime may evaluate permissions based on either a specific `SchemaId`, or based on a broader context such as `IntentId` or `ProtocolId`.
251
255
@@ -279,7 +283,7 @@ This multi-path resolution allows greater flexibility, but requires care to avoi
279
283
- If a schema supports multiple intents, fallback rules and audit logic must be clear.
280
284
- SDKs should provide helpers for intent resolution and delegation explanation.
281
285
282
-
## 9. **On-Chain Data Structures**
286
+
## 9. **On-Chain Data Structures** <aid="section_9"></a>
283
287
284
288
This section outlines the proposed on-chain data structures to support schema protocols, intents, delegations, and namespace ownership in the redesigned Frequency architecture.
285
289
@@ -371,7 +375,7 @@ The current runtime includes a top-level flag indicating whether any delegation
371
375
372
376
This simplification removes complexity and keeps delegation logic self-contained.
373
377
374
-
## 10. **Governance and Publication Workflows**
378
+
## 10. **Governance and Publication Workflows** <aid="section_10"></a>
375
379
376
380
The publication of schemas, protocols, namespaces, and intents is tightly linked to governance controls and administrative authority.
377
381
@@ -414,7 +418,7 @@ While it's difficult to define a strict on-chain method for determining "minor"
414
418
415
419
This encourages transparency and long-term stability of protocols while supporting iterative development.
416
420
417
-
## 11. **API Identifier Handling and Resolution**
421
+
## 11. **API Identifier Handling and Resolution** <aid="section_11"></a>
418
422
419
423
The choice of identifiers in runtime and SDK APIs has significant implications for both usability and performance. Historically, Frequency APIs used `SchemaId` for delegation and data interpretation. The proposed model must account for protocols and intents, while maintaining runtime efficiency.
420
424
@@ -467,7 +471,7 @@ Additionally, it is possible that future use cases will arise that make use of i
467
471
- Whether to expose protocol- or intent-based extrinsics directly is an open question.
468
472
- SDKs such as the Frequency Gateway may offer string-based input and resolve IDs internally.
Transitioning from the current schema + delegation system to the new protocol + intent model must be handled carefully to preserve backward compatibility while enabling the new architecture to roll out incrementally.
473
477
@@ -499,7 +503,7 @@ Once adoption of intent/protocol delegation is widespread:
499
503
500
504
This strategy ensures a smooth, opt-in path to the new system while preserving all critical functionality during the transition period.
501
505
502
-
## 13. **Open Questions and Next Steps**
506
+
## 13. **Open Questions and Next Steps** <aid="section_13"></a>
503
507
504
508
Several open questions remain that may influence the final implementation strategy and runtime behavior. These are left intentionally unresolved to guide future design discussions within the development and governance communities.
0 commit comments