CountryRulesetManager

The CountryRulesetManager is the administrative and enforcement backbone for managing regional moderation policies tied to each CountryNFT. It works in tandem with the GeoOracle to enforce public and private content restrictions, provide AI moderation criteria, and govern the semantic and algorithmic logic used to determine whether content is regionally visible.


📌 Purpose

While GeoOracle handles real-time enforcement, the CountryRulesetManager is responsible for:

  • Registering and storing AI constraint rulesets per CountryNFT.

  • Managing semantic triggers for moderation AI pipelines.

  • Providing the public-facing moderation policy per country.

  • Enabling private enforcement logic for post-level bans.

  • Coordinating updates and consensus rules for each country’s moderators.

This contract acts as the oracle's rules registry and provides a transparent governance surface for regional DAO oversight.


🧠 Key Features

1. Public Constraint Registry

Each country must define a public JSON-like schema of moderation policies. These include:

Constraint Type
Examples

Content Categories

"Pornography", "Political Speech", "Drug Use"

Required Filters

"NSFW detector enabled", "No violence > 0.7 threshold"

User Protections

"No tracking", "No grooming content", "No hate speech"

Media Constraints

Max image size, audio volume limits, meme restrictions

These are visible to the community, stored either directly on-chain or through IPFS with hash verification.

2. Private Enforcement Logic

Each CountryNFT can maintain a private blacklist of specific post hashes to block, implemented through:

  • Encrypted IPFS storage or off-chain agents

  • Access-controlled submissions to the GeoOracle

  • AI pipelines privately labeling and enforcing bans

Only enforcement agents approved by the CountryNFT may modify this blacklist.

3. Semantic Trigger System

The manager includes embedding-aware moderation filters.

  • AI agents can register similarity patterns based on:

    • Toxic language

    • NSFW probabilities

    • AI-detected illegal themes

  • Each CountryNFT may adjust the AI thresholds and categories

  • These are stored and referenced by AI modules that trigger enforcement or recommendations

4. Constraint Hash Auditing

To ensure integrity and accountability, each public constraint schema is stored with a content hash.

  • This ensures countries cannot silently change moderation rules without detection.

  • Users and developers may audit changes by comparing current hashes with previous versions.


⚙️ Workflow

  1. Initialization

    • A CountryNFT is created and linked to a unique countryId

    • The country sets its initial public constraints and moderation schema

    • Moderators are appointed to manage rules and enforcement

  2. Constraint Updates

    • When public rules change, a new constraint hash is published

    • Old versions are retained for auditing

    • The change is submitted to the chain with a timestamp and optional description

  3. AI Moderation Integration

    • The semantic AI used by the country fetches its config from this manager

    • Any flagged content is hashed and submitted to the GeoOracle for enforcement

  4. Hash Ban Submission

    • A flagged post’s hash is added to the private enforcement set by moderators

    • The GeoOracle enforces it silently

    • Cross-country viewing remains unaffected if the content is not globally restricted


🔐 Role Management

Role
Permissions

CountryNFT Owner

Full control over constraints, AI settings, moderator roles

Moderators

Can update rules, approve post-level bans, manage semantic filters

Public Users

Can view current constraints and audit changes


🧱 Suggested Contract Architecture (Simplified)

struct CountryRuleset {
    string ipfsHash;       // Public constraint schema
    bytes32 contentHash;   // Integrity check
    uint256 updatedAt;     // Timestamp for version tracking
    address[] moderators;  // Authorized addresses for enforcement
}

mapping(address => CountryRuleset) public countryRulesets;

function updateRuleset(address country, string memory ipfsHash, bytes32 contentHash) public onlyCountryAdmin(country) {
    countryRulesets[country] = CountryRuleset(ipfsHash, contentHash, block.timestamp, countryRulesets[country].moderators);
}

🔎 Transparency Matrix

Component
Public
Private

Constraint Schema

Post-Level Ban Hashes

Moderation AI Config

❌ (some parameters)

Enforcement Agents

✅ (limited detail)


🌐 Interoperation with GeoOracle

  • GeoOracle queries this manager for active constraints.

  • CountryNFT agents may automatically apply semantic labels to post hashes.

  • Constraints act as "moderation profiles" — for both enforcement and auditability.


🔁 Upgrade & Governance

  • CountryNFTs may vote internally to change constraints or moderator privileges.

  • Future updates can include appeals mechanisms, distributed moderation DAOs, or regional arbitration systems.

  • Users may be notified of updates if content visibility changes.


✅ Summary

The CountryRulesetManager empowers regional sovereignty while preserving transparency and auditability. It allows each CountryNFT to define, evolve, and enforce content moderation logic using a mix of public schemas and private AI-driven enforcement. Paired with GeoOracle, it forms the foundation for regional governance over content visibility.

Last updated