-
Notifications
You must be signed in to change notification settings - Fork 23
EPIC: Schemas, Protocols, and Intent-based Delegation #2550
Copy link
Copy link
Open
6 / 76 of 7 issues completedMilestone
Description
Epic: Schema, Protocols, and Intent-Based Delegation
Summary
Implement a new architecture for Frequency's schema and delegation systems that introduces named intents with version tracking and intent-based delegation to address current limitations around coupling between schema versions and delegations.
Background
The current implementation tightly binds delegations to specific SchemaIds, which has proven limiting:
- Strong coupling between schema versions and delegations
- Schemas represent data format but not purpose
- Lack of human-readable context for schemas
This epic introduces:
- Named intents with version tracking
- Intent-based delegation replacing schema-based delegation
- Intent groups for bundling related permissions
- Protocol-based name registry for off-chain resolution
Goals
- Schema Immutability: Individual schema versions remain immutable once published
- Minimal Delegation Churn: Minor data format changes don't require new delegations
- Minimal Storage Churn: Format changes don't require mass data migration
- Intent Separation: Separate data purpose/action from format when permissioning
- On-Chain Efficiency: Maintain efficient on-chain operations
Technical Overview
Key Components
- Intents: Represent consistent data meaning/purpose, can be associated with multiple schema versions
- Schemas: Now only represent data format definitions, associated with a single Intent
- Intent Groups: Bundles of IntentIds for easier permission management
- Name Registry: Protocol-based naming system for off-chain discovery
Major Changes
- Delegations now reference
IntentIdinstead ofSchemaId - Storage location tied to
IntentIdrather than schemas - Introduction of versioned storage for messages and stateful-storage pallets
Tasks
Dependencies
- Governance approval for all schema/intent/intent group operations
- Analysis of existing mainnet data for migration planning
Risks & Mitigations
- Risk: Large-scale data migration complexity
- Mitigation: Dual storage approach avoiding immediate migration needs
- Risk: Breaking existing delegations
- Mitigation: 1:1 mapping of SchemaId to IntentId preserves all delegations
- Risk: Performance impact of additional lookups
- Mitigation: Schema->Intent lookup mitigates performance impact
Success Metrics
- Zero breaking changes to existing delegations
- No mass data migration required at launch
- Delegation updates reduced by >80% for schema version changes
- All existing functionality maintained with improved flexibility
Testing Requirements
- Comprehensive unit tests for all new storage and extrinsics
- Integration tests for migration scenarios
- Performance benchmarks comparing old vs new delegation lookups
- End-to-end tests for complete user flows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels