ViewIndex

The ViewIndex module is the canonical ledger for all content views on the TRN platform. It records and validates user interactions with posts, ensuring that view-based earnings are fairly credited, deduplicated, and enforced through the TRNUsageOracle. It plays a foundational role in the platform’s Merkle-based distribution cycle, enabling TRN rewards to flow to creators and curators based on confirmed attention.


✅ Confirmed Responsibilities

  • Record unique views per content ID (CID) per user per day.

  • Enforce the 1 TRN per view cost across all standard posts.

  • Handle boosted view logic for incentivized TRN payouts.

  • Sync all real-time updates with the TRNUsageOracle.

  • Ensure all interactions are counted once per day per CID.

  • Feed accurate tallies to the daily Merkle tree processor for settlement.


🔁 Real-Time Mechanics

When a user views a post:

  1. The ViewIndex checks if the user has already viewed the post that day (by CID).

  2. If the view is valid:

    • 1 TRN is debited from the viewer’s fruit balance.

    • The post creator is credited (typically with 0.9 TRN after DAO allocation).

    • The engagement is logged with timestamp and user CID.

  3. The TRNUsageOracle is updated immediately to reflect:

    • Viewer debits.

    • Creator credits (provisional until Merkle drop).

    • Any DAO cut (10%).

Note: If the user has insufficient balance or fruit credit, the view is blocked unless:

  • They watch a boosted post (which pays them).

  • They watch an ad.

  • The post is their own or already-viewed.


🚫 Deduplication Rules

To maintain integrity and prevent abuse:

  • Only one view per user per CID per 24-hour cycle is recorded.

  • View spam is automatically filtered at the ViewIndex level.

  • Bot detection and click-fraud mitigation is handled upstream via the AI detection layer (AIResonanceOracle + FlagEscalator).


🎯 Boosted View Integration

Boosted posts follow enhanced rules:

  • Each boosted view rewards the viewer with 90% of the 3× cost paid by the booster.

  • Viewer must:

    • Watch at least 10 seconds.

    • Have audio enabled to at least the device default level.

  • View is rejected if:

    • User scrolls before 10 seconds.

    • Ad is skipped or corrupted.

The boosted view is:

  • Logged distinctly in ViewIndex under a boosted flag.

  • Counted toward post earnings AND viewer wallet (as fruit balance).

  • Automatically contributes to the LottoModule and BlessBurnTracker.


📆 Daily Merkle Drop Integration

At the end of each UTC day:

  • ViewIndex passes final tallies to the Merkle tree builder.

  • Users’ pending TRN (fruit) is reconciled against view logs.

  • TRN is transferred automatically from the Merkle-based ledger into wallets based on final earned balances.


💸 Special Cases

  • Ad posts: If a user watches an ad, TRN is paid to them and deducted from the advertiser’s boost budget.

  • Subscription-gated content: Views are tracked the same way but require a valid SubscriptionNFT.

  • Country-restricted content: Views are blocked preemptively using GeoOracle.


⛔ View Access Enforcement

Users can only view content if:

  • They have sufficient TRN or fruit balance.

  • The content is not restricted by their CountryNFT.

  • They haven't already viewed the post that day.

If the user attempts a blocked view:

  • ViewIndex sends a denial signal.

  • Optionally prompts to watch a boosted post or ad to earn TRN.


🧾 File & Contract References

File Name
Description

ViewIndex.sol

Primary smart contract to log, validate, and index views.

TRNUsageOracle.sol

Core accounting layer for fruit/TRN balances.

FruitLedgerAdapter.sol

Reads/writes ledger deltas in real-time.

MerkleDropProcessor.sol

Reconciles daily earnings from views.

BoostingModule.sol

Handles boosted views and payouts to viewers.


🧠 AI & Moderation Hooks

While ViewIndex does not itself flag or moderate content, it:

  • Sends view metrics to AIResonanceOracle for scoring.

  • Participates in resonance-based post weighting for the LottoModule.

  • Can be indirectly affected if content is burned (e.g., view record is frozen and payouts halted).


✅ Summary of Locked-In Rules

  • View = 1 TRN charged to viewer.

  • Deduplicated per CID/user/day.

  • Viewers can earn for boosted posts.

  • Must watch 10s with audio to earn.

  • Synced to TRNUsageOracle in real-time.

  • Final balances settled via Merkle drop.

  • No staking, no speculative adjustments.

  • No view occurs unless preconditions are met.

Last updated