Skip to content

Commit 9b84448

Browse files
committed
add to README
1 parent 4ec8bcd commit 9b84448

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

designdocs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ To create a new design document, Please see the [Design Doc README](https://gith
2222
- [PR](https://github.com/frequency-chain/frequency/pull/900)
2323
- [Graph Sdk](./graph_sdk.md)
2424
- [PR](https://github.com/frequency-chain/frequency/pull/1159)
25+
- [Schemas, Protocols & Intents](./schemas_protocols_intents.md)
26+
- [PR](https://github.com/frequency-chain/frequency/pull/2312)
2527

2628
## Basic Data Model
2729

designdocs/schemas_protocols_intents.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11

2-
# 📘 Schema Protocols and Intent-Based Delegation in Frequency
2+
# 📘 Design Discussion: Schema Protocols and Intent-Based Delegation in Frequency
33

4-
## 1. **Background and Motivation**
4+
## 0. **Work in Progress** <a id="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** <a id="section_1"></a>
59

610
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.
711

@@ -20,7 +24,7 @@ These limitations have motivated a re-architecture of the schema and delegation
2024
- **Intent-based delegation**
2125
- **More expressive APIs and storage models**
2226

23-
## 2. **Design Goals**
27+
## 2. **Design Goals** <a id="section_2"></a>
2428

2529
This section outlines the key objectives that guide the redesign of Frequency's schema and delegation architecture.
2630

@@ -32,7 +36,7 @@ This section outlines the key objectives that guide the redesign of Frequency's
3236
- **Namespace Ownership and Governance**
3337
- **On-Chain Efficiency**
3438

35-
## 3. **Schema Protocols and Versioning**
39+
## 3. **Schema Protocols and Versioning** <a id="section_3"></a>
3640

3741
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.
3842

@@ -58,7 +62,7 @@ Protocols are not just organizational tools—they enable meaningful delegation.
5862
- Minor updates (new schema version) may be published by the namespace owner
5963
- Major updates require a new protocol (e.g., change in semantic intent)
6064

61-
## 4. **Namespace Ownership**
65+
## 4. **Namespace Ownership** <a id="section_4"></a>
6266

6367
In order to provide organizational control, accountability, and publishing boundaries for schemas and intents, the protocol introduces the concept of **namespaces**.
6468

@@ -69,7 +73,7 @@ A namespace (e.g., `dsnp`, `bsky`) serves as a root authority under which protoc
6973
Each namespace is a unique identifier, typically human-readable (e.g., `"dsnp"`), mapped to an on-chain `NamespaceId` (e.g., `NamespaceId = 2`).
7074

7175
- 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))_
7377

7478
### 👤 Ownership and Control
7579

@@ -98,7 +102,7 @@ Namespaces define logical and administrative isolation between ecosystems. For e
98102

99103
This structure provides a trust boundary that maps to real-world organizational authority.
100104

101-
## 5. **Delegation Semantics**
105+
## 5. **Delegation Semantics** <a id="section_5"></a>
102106

103107
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:
104108
- Delegation by `SchemaId` (existing/legacy, for future deprecation)
@@ -135,7 +139,7 @@ pub type Delegations<T> = StorageDoubleMap<
135139

136140
This unified structure supports flexibility while maintaining clear access logic.
137141

138-
## 6. **Intent Registration & Delegation Models**
142+
## 6. **Intent Registration & Delegation Models** <a id="section_6"></a>
139143

140144
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_.
141145

@@ -192,7 +196,7 @@ We explore three models for intent registration and delegation:
192196

193197
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.
194198

195-
## 7. **Intent Registry Design**
199+
## 7. **Intent Registry Design** <a id="section_7"></a>
196200

197201
The intent registry is an on-chain mapping of supported intents, including associated metadata and governance control.
198202

@@ -245,7 +249,7 @@ Depending on the model chosen for intents (see Section 6), intent publication wo
245249
- Global intents: Intents are only publishable by governance.
246250
- Namespaced intents: namespace owners may register intents
247251

248-
## 8. **Authorization Resolution Models**
252+
## 8. **Authorization Resolution Models** <a id="section_8"></a>
249253

250254
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`.
251255

@@ -279,7 +283,7 @@ This multi-path resolution allows greater flexibility, but requires care to avoi
279283
- If a schema supports multiple intents, fallback rules and audit logic must be clear.
280284
- SDKs should provide helpers for intent resolution and delegation explanation.
281285

282-
## 9. **On-Chain Data Structures**
286+
## 9. **On-Chain Data Structures** <a id="section_9"></a>
283287

284288
This section outlines the proposed on-chain data structures to support schema protocols, intents, delegations, and namespace ownership in the redesigned Frequency architecture.
285289

@@ -371,7 +375,7 @@ The current runtime includes a top-level flag indicating whether any delegation
371375

372376
This simplification removes complexity and keeps delegation logic self-contained.
373377

374-
## 10. **Governance and Publication Workflows**
378+
## 10. **Governance and Publication Workflows** <a id="section_10"></a>
375379

376380
The publication of schemas, protocols, namespaces, and intents is tightly linked to governance controls and administrative authority.
377381

@@ -414,7 +418,7 @@ While it's difficult to define a strict on-chain method for determining "minor"
414418

415419
This encourages transparency and long-term stability of protocols while supporting iterative development.
416420

417-
## 11. **API Identifier Handling and Resolution**
421+
## 11. **API Identifier Handling and Resolution** <a id="section_11"></a>
418422

419423
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.
420424

@@ -467,7 +471,7 @@ Additionally, it is possible that future use cases will arise that make use of i
467471
- Whether to expose protocol- or intent-based extrinsics directly is an open question.
468472
- SDKs such as the Frequency Gateway may offer string-based input and resolve IDs internally.
469473

470-
## 12. **Migration Strategy**
474+
## 12. **Migration Strategy** <a id="section_12"></a>
471475

472476
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.
473477

@@ -499,7 +503,7 @@ Once adoption of intent/protocol delegation is widespread:
499503

500504
This strategy ensures a smooth, opt-in path to the new system while preserving all critical functionality during the transition period.
501505

502-
## 13. **Open Questions and Next Steps**
506+
## 13. **Open Questions and Next Steps** <a id="section_13"></a>
503507

504508
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.
505509

0 commit comments

Comments
 (0)