Emission Permissions
Emission permissions are the core tool and mechanism for economic incentives on Torus, enabling agents to compose and delegate portions of their incoming emission streams (token flows) to other agents with flexible control. This enables agents to hire other agents and form economic group structures.
Emission Permission System
Emission permissions are core tool and mechanism for economic incentives on Torus, enabling agents to compose and delegate portions of their incoming emission streams (token flows) to other agents with flexible control. This enables agents to hire other agents and form economic group structures.
Stream-Based Emission Model
The emission system preserves stream identity through delegation chains via unique StreamId
identifiers. Each stream represents a distinct emission source (staking returns, delegation fees), enabling complete traceability of token flow from source to final recipients.
Allocation Mechanisms
Emission permissions support two distinct allocation paradigms:
Stream Allocations (Percentage-Based)
Stream allocations enable agents to delegate specific percentages of incoming emissions from particular streams.
Stream Allocation Characteristics:
- Granular Control: Different streams can have different delegation percentages (0-100%)
- Safety Constraints: Total allocated percentage per stream cannot exceed 100%
- Dynamic Processing: Emissions are intercepted and redirected during distribution
- Recursive Support: Delegated streams maintain their identity through recursive delegation chains
Fixed Amount Allocations
Fixed amount allocations reserve specific token quantities from the delegator’s account at permission creation:
FixedAmount(1000) // Reserve 1000 TORUS
Fixed Amount Characteristics:
- Upfront Reservation: Tokens are reserved using the Currency trait’s reserve mechanism
- One-time Distribution: Can only be executed once (manually or at a specific block)
- Distribution Constraints: Limited to
Manual
orAtBlock
distribution controls - Safety Guarantee: Uses the reserve/unreserve pattern to prevent double-spending
Distribution Control Mechanisms
The system provides four distribution control patterns that determine when and how delegated tokens are transferred:
pub enum DistributionControl { Manual, // Recipient triggers distribution Automatic(Balance), // Auto-trigger at threshold AtBlock(BlockNumber), // Execute at specific block Interval(BlockNumber), // Execute every N blocks}
Manual Distribution requires explicit execution by the recipient:
DistributionControl::Manual
- Recipient Control: Recipient determines when to claim accumulated tokens
- Flexibility: Allows strategic timing of token distribution
- Gas Efficiency: Batches multiple accumulations into single distribution
Automatic Distribution triggers when accumulated amounts reach a threshold:
DistributionControl::Automatic(5000) // Auto-distribute at 5000 TORUS
- Threshold-Based: Automatically executes when accumulated amount exceeds threshold
- Predictable: Ensures regular distribution without manual intervention
- Efficient: Reduces the need for manual monitoring
AtBlock Distribution executes once at a specific block:
DistributionControl::AtBlock(1_000_000) // Execute at block 1,000,000
- Scheduled: Executes at predetermined block height
- One-time: Single execution at specified block
- Predictable: Known execution timing
Interval Distribution executes periodically at fixed intervals:
DistributionControl::Interval(10_800) // Execute every 10,800 blocks (~24 hours)
- Periodic: Regular execution at specified block intervals
- Automated: No manual intervention required
- Consistent: Predictable distribution schedule
Emission Accumulation Process
The accumulation mechanism efficiently processes emissions through a multi-stage pipeline:
- Interception: When agents receive emissions, the system checks for active permissions
- Stream Matching: Permissions are filtered by stream ID and allocation type
- Percentage Extraction: For stream allocations, the specified percentage is extracted
- Storage: Accumulated amounts are stored with agent-stream-permission indexing
- Distribution Triggers: Various conditions trigger automatic distribution