Skip to content

EPIC: Schemas, Protocols, and Intent-based Delegation #2550

@p5150j

Description

@p5150j

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

  1. Intents: Represent consistent data meaning/purpose, can be associated with multiple schema versions
  2. Schemas: Now only represent data format definitions, associated with a single Intent
  3. Intent Groups: Bundles of IntentIds for easier permission management
  4. Name Registry: Protocol-based naming system for off-chain discovery

Major Changes

  • Delegations now reference IntentId instead of SchemaId
  • Storage location tied to IntentId rather 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions