ContentView System
Overview
ContentView is an integrated view tracking system for all content types, enabling users to access content without gas fees through Sponsored Transactions.
Key Features
1. Zero Gas Fee
- Platform pays gas fees on behalf of users
- Users access content completely free
- Removes entry barriers for mass adoption
2. Integrated Tracking System
- Unified management for all content types (articles, projects, quizzes)
- Consistent reward system
- Efficient data aggregation
System Architecture
ContentView Structure
struct ContentView has key, store {
id: UID,
content_id: ID,
content_type: u8, // 1: Article, 2: Project, 3: Quiz
viewer: address,
epoch: u64,
timestamp: u64,
collection_context: Option<ID>
}
struct ContentViewSponsor has key {
id: UID,
gas_pool: Balance<SUI>,
sponsored_views_count: u64,
min_gas_threshold: u64
}
Sponsored Transaction Flow
Epoch-based Aggregation
Automatic Aggregation Process
- Real-time Recording: Each view is recorded as a ContentView object
- Epoch End: Aggregation after a set period (e.g., 24 hours)
- Reward Calculation: Creator rewards calculated based on view count
- Storage Recovery: Gas recovery through ContentView object deletion
Aggregation Function
public fun aggregate_epoch_views(
epoch: u64,
content_views: vector<ContentView>,
reward_config: &ViewRewardConfig
) {
// 1. Aggregate views per content
// 2. Calculate rewards
// 3. Distribute to creators
// 4. Delete ContentView objects (storage recovery)
}
Economic Impact
Unit Economics
| Item | Cost (gas units) |
|---|---|
| ContentView Creation | 1,000 |
| Storage Recovery | -800 |
| Net Operating Cost | 200 |
| Creator Reward | 300-500 |
| Platform Margin | 100-300 |
Sustainability
- Automatic Scaling: Auto-expansion with usage growth
- Cost Optimization: Gas cost reduction through batch processing
- Revenue Sharing: Transparent creator reward system
Collection Context
Viewing Through Collections
Additional context recording when viewing content within a Collection:
// View content within Collection
public fun view_content_in_collection(
content_id: ID,
collection_id: ID,
viewer: address
) {
let view = ContentView {
content_id,
collection_context: option::some(collection_id),
// ...
};
}
Privacy Protection
Anonymity Guarantee
- View records deleted after Epoch
- Only aggregated statistics permanently stored
- Personal identification information minimized
Data Security
- On-chain encryption
- Access control management
- Audit log maintenance
Performance Optimization
Batch Processing
- Process multiple views at once
- Minimize gas costs
- Improve processing speed
Caching Strategy
- Popular content caching
- Prevent duplicate views
- Reduce network load
Statistics and Analytics
Real-time Dashboard
- View count trends
- Popular content rankings
- User behavior patterns
Creator Analytics
- Performance by content
- Revenue tracking
- Engagement metrics
Future Improvements
- AI-based Recommendations: Personalization through view pattern analysis
- Cross-chain Support: Integration with other blockchains
- Real-time Streaming: Live content support
- Advanced Analytics: Machine learning-based insights