Video thumbnail

GuardianScope

GuardianScope is a decentralized AI content moderation protocol built on EigenLayer's AVS. It enables automated, unbiased, and privacy-preserving moderation for Web3 platforms using AI-powered analysis, ensuring transparency and security through blockchain.

GuardianScope

Created At

Agentic Ethereum

Winner of

Coinbase Developer Platform - AgentKit Pool Prize

Prize Pool

Project Description

GuardianScope is an innovative, decentralized content moderation protocol designed to address the growing need for fair, transparent, and efficient content moderation in Web3 and decentralized social platforms. Built on EigenLayer's Actively Validated Service (AVS) infrastructure, GuardianScope leverages AI-powered agents and blockchain technology to provide automated, unbiased, and privacy-preserving content moderation.

Core Problem Addressed Traditional content moderation systems are often centralized, prone to bias, and lack transparency. These systems can be easily manipulated or censored, leading to unfair outcomes and a lack of trust among users. GuardianScope aims to solve these issues by decentralizing the moderation process, ensuring that decisions are made transparently and fairly, while preserving user privacy.

How It Works GuardianScope operates as a decentralized network of AI-powered operators who analyze and moderate content submitted by users or platforms. The protocol uses EigenLayer's restaking mechanism to secure the network, ensuring that operators are economically incentivized to act honestly and efficiently. The moderation process is powered by advanced AI models capable of analyzing multi-modal content (text, images, and videos) in real-time.

Key Components: Decentralized Moderation Network:

A distributed network of operators runs AI agents to analyze content.

Operators are staked and incentivized through EigenLayer's restaking mechanism, ensuring economic security and honest behavior.

The decision-making process is transparent and recorded on-chain, making it immune to centralized control or censorship.

AI-Powered Analysis:

The protocol supports multi-modal content analysis, including text, images, and videos.

AI models, such as NLP (Natural Language Processing) for text and computer vision for images/videos, are used to evaluate content.

The system is adaptable to platform-specific moderation requirements and continuously improves through decentralized governance.

Smart Contract Infrastructure:

GuardianScope uses AVS smart contracts to coordinate moderation tasks, verify on-chain results, and distribute rewards.

The contracts ensure transparency and fairness by recording moderation decisions and operator actions on the blockchain.

EigenLayer Integration:

GuardianScope integrates with EigenLayer's AVS infrastructure, leveraging BLS signatures for efficient consensus and restaking for economic security.

Operators who act maliciously or fail to perform their duties can be slashed, ensuring the integrity of the network.

User Flow A content publisher submits content for moderation through the GuardianScope contract.

The GuardianScope contract emits a NewTaskCreated event, signaling a new moderation request.

Staked operators receive the request and process it using their AI models.

Each operator generates a moderation decision (approve/reject), hashes it with the content, and signs the hash.

Operators submit their signed decisions back to the GuardianScope contract.

The contract verifies the operators' eligibility and stake before accepting the submission, ensuring only valid and staked operators can participate.

Technical Components Smart Contracts: The backbone of the protocol, handling task coordination, result verification, and reward distribution.

EigenLayer AVS: Provides the infrastructure for secure and efficient consensus among operators.

AI Agent System: Modular and extensible, supporting multiple AI models for different types of content analysis.

Local Development and Testing GuardianScope is designed to be easily deployable for local development and testing. The project provides detailed instructions for setting up a local Anvil chain (Ethereum testnet), deploying the necessary contracts, and running the AI-powered operator application. Developers can test the moderation process by submitting content and observing how the AI agents and smart contracts handle the moderation tasks.

Future Plans Testnet Deployment: Support for testnet deployments will be added soon, allowing developers to test the protocol in a more realistic environment.

BLS Signature Architecture: Future updates will migrate to a more efficient BLS signature architecture for improved scalability and security.

Production Readiness: The protocol is currently intended for local development, but plans are in place to make it production-ready for decentralized platforms.

Why GuardianScope? GuardianScope is a pioneering solution for decentralized content moderation, combining the power of AI with the transparency and security of blockchain technology. It is designed to empower Web3 platforms with a fair, unbiased, and efficient moderation system that aligns with the principles of decentralization and user sovereignty.

How it's Made

How GuardianScope Was Built: The Corrected Details GuardianScope is a decentralized content moderation protocol built on EigenLayer's Actively Validated Service (AVS) infrastructure. It uses OpenAI's API for AI-powered content analysis and is implemented entirely in Node.js for the backend. The project was developed using the AVS HelloWorld template as a starting point, which provided a solid foundation for building a decentralized service on EigenLayer.

Core Technologies Used Blockchain Infrastructure:

EigenLayer AVS: GuardianScope is built on EigenLayer's AVS infrastructure, which provides the decentralized coordination and security layer for the protocol.

AVS HelloWorld Template: The project started with the AVS HelloWorld template, which provided the basic structure for implementing an AVS, including task coordination, operator management, and reward distribution.

Foundry: Used for smart contract development, testing, and deployment. Foundry's Forge and Cast tools were used to write and test the smart contracts.

Anvil: A local Ethereum testnet provided by Foundry, used for local development and testing.

AI-Powered Content Analysis:

OpenAI API: Instead of building custom AI models, GuardianScope leverages OpenAI's API for content analysis. This includes text moderation using OpenAI's advanced NLP models (e.g., GPT-4) for detecting inappropriate or harmful content.

Node.js Integration: The OpenAI API is called directly from the Node.js backend, eliminating the need for Python or other AI frameworks. The backend handles the API requests and processes the moderation results.

Backend and Frontend:

Node.js: The entire backend, including the operator application and contract interaction logic, is built using Node.js. This includes handling moderation tasks, calling the OpenAI API, and interacting with the blockchain.

ethers.js: Used for interacting with Ethereum smart contracts from the Node.js backend.

TypeScript: The backend code is written in TypeScript, providing type safety and better developer experience.

Development Environment:

Nix: For reproducible development environments, Nix was used to manage dependencies and ensure consistency across different setups.

Docker: Optional containerization for deploying the backend services in a scalable manner.

How Everything Fits Together

  1. Smart Contract Infrastructure The smart contracts are based on the AVS HelloWorld template, which provides the basic structure for task coordination, operator management, and reward distribution. The contracts were extended to support content moderation tasks and integrate with the OpenAI API.

Task Coordination: The smart contracts handle the creation of moderation tasks, assignment to operators, and verification of results.

On-Chain Verification: Operators submit their moderation decisions (approve/reject) along with a hash of the content and their signature. The contract verifies the signature and ensures the operator is staked and eligible to participate.

Reward Distribution: Operators are rewarded for their work through EigenLayer's restaking mechanism, with rewards distributed transparently on-chain.

  1. EigenLayer Integration GuardianScope integrates with EigenLayer's AVS infrastructure, which provides the security and coordination layer for the decentralized network of operators.

ServiceManagerBase: GuardianScope implements EigenLayer's ServiceManagerBase contract to handle task coordination and signature aggregation.

BLS Signatures: Operators use BLS signatures to sign their moderation decisions, which are then aggregated for efficient on-chain verification.

Slashing Conditions: Malicious or non-performing operators can be slashed, ensuring the network's integrity and security.

  1. AI-Powered Content Analysis Instead of building custom AI models, GuardianScope uses OpenAI's API for content analysis. The Node.js backend handles the API calls and processes the moderation results.

OpenAI API Integration: The backend sends content to the OpenAI API for analysis and receives moderation decisions (e.g., approve/reject) based on the API's response.

Real-Time Analysis: The OpenAI API provides real-time moderation capabilities, ensuring quick turnaround times for moderation tasks.

Privacy-Preserving: While the content is sent to OpenAI for analysis, the system ensures that sensitive data is handled securely and in compliance with privacy regulations.

Development Process Local Devnet Deployment To make development and testing easier, GuardianScope provides a local devnet setup using Foundry's Anvil chain. Here's how it works:

Start Anvil Chain: A local Ethereum testnet is started using Anvil, providing a sandbox environment for testing.

Deploy Contracts: The EigenLayer core contracts and GuardianScope AVS contracts are deployed to the local chain.

Start Operator: The Node.js backend (operator application) is started, connecting to the local chain and listening for moderation tasks.

Test Moderation: Developers can submit test content for moderation and observe how the system processes it using the OpenAI API.

Testing GuardianScope includes comprehensive tests for both the smart contracts and the backend logic. The tests are written in Solidity (for smart contracts) and TypeScript (for backend logic), ensuring that the system behaves as expected under various conditions.

Hacky or Notable Solutions OpenAI API Integration:

Instead of building custom AI models, GuardianScope leverages OpenAI's API for content analysis. This significantly reduced development time and allowed us to focus on the decentralized infrastructure.

The Node.js backend handles all API calls, making the system lightweight and easy to maintain.

AVS HelloWorld Template:

Using the AVS HelloWorld template as a starting point allowed us to quickly build the core functionality of GuardianScope. The template provided the basic structure for task coordination, operator management, and reward distribution, which we extended to support content moderation.

Node.js Backend:

The entire backend is implemented in Node.js, including the operator application and OpenAI API integration. This simplified the development process and eliminated the need for additional languages like Python.

Partner Technologies and Their Benefits EigenLayer:

EigenLayer's restaking mechanism and AVS infrastructure were critical to GuardianScope's security and scalability. By leveraging EigenLayer, we were able to build a decentralized network of operators with strong economic incentives to act honestly.

OpenAI API:

Using OpenAI's API for content analysis allowed us to quickly implement advanced AI capabilities without building custom models. This saved significant development time and provided access to state-of-the-art NLP models.

Foundry:

Foundry's Forge and Cast tools made smart contract development and testing much faster and more efficient. The ability to write tests in Solidity and deploy contracts locally with Anvil streamlined the development process.

Conclusion GuardianScope is a powerful decentralized content moderation protocol built on EigenLayer's AVS infrastructure and powered by OpenAI's API. By leveraging the AVS HelloWorld template and implementing the backend entirely in Node.js, we were able to create a lightweight, efficient, and scalable system. The integration with OpenAI provides advanced AI capabilities, while EigenLayer ensures the security and decentralization of the network. This combination makes GuardianScope a robust solution for Web3 platforms seeking fair and efficient content moderation.

operator is on rust. Thank you for the additional clarification! With the operator implemented in Rust, the architecture of GuardianScope becomes even more interesting. Let’s revise the explanation to reflect this key detail and provide a more accurate description of how the project was built.

How GuardianScope Was Built: The Corrected Details (Rust Operator) GuardianScope is a decentralized content moderation protocol built on EigenLayer's Actively Validated Service (AVS) infrastructure. It uses OpenAI's API for AI-powered content analysis, with the operator implemented in Rust for performance and efficiency. The project was developed using the AVS HelloWorld template as a starting point, which provided a solid foundation for building a decentralized service on EigenLayer.

Core Technologies Used Blockchain Infrastructure:

EigenLayer AVS: GuardianScope is built on EigenLayer's AVS infrastructure, which provides the decentralized coordination and security layer for the protocol.

AVS HelloWorld Template: The project started with the AVS HelloWorld template, which provided the basic structure for implementing an AVS, including task coordination, operator management, and reward distribution.

Foundry: Used for smart contract development, testing, and deployment. Foundry's Forge and Cast tools were used to write and test the smart contracts.

Anvil: A local Ethereum testnet provided by Foundry, used for local development and testing.

AI-Powered Content Analysis:

OpenAI API: Instead of building custom AI models, GuardianScope leverages OpenAI's API for content analysis. This includes text moderation using OpenAI's advanced NLP models (e.g., GPT-4) for detecting inappropriate or harmful content.

Rust Integration: The OpenAI API is called from the Rust-based operator, which handles the API requests and processes the moderation results.

Operator Implementation:

Rust: The operator, responsible for receiving moderation tasks, calling the OpenAI API, and submitting results back to the blockchain, is implemented in Rust. Rust was chosen for its performance, safety, and efficiency, making it ideal for handling high-throughput tasks in a decentralized network.

Web3 Libraries in Rust: Libraries like ethers-rs or web3.rs are used to interact with Ethereum smart contracts from the Rust operator.

Async Programming: Rust's async/await features are used to handle concurrent tasks, such as listening for new moderation tasks and making API calls to OpenAI.

Development Environment:

Nix: For reproducible development environments, Nix was used to manage dependencies and ensure consistency across different setups.

Docker: Optional containerization for deploying the Rust operator and backend services in a scalable manner.

How Everything Fits Together

  1. Smart Contract Infrastructure The smart contracts are based on the AVS HelloWorld template, which provides the basic structure for task coordination, operator management, and reward distribution. The contracts were extended to support content moderation tasks and integrate with the OpenAI API.

Task Coordination: The smart contracts handle the creation of moderation tasks, assignment to operators, and verification of results.

On-Chain Verification: Operators submit their moderation decisions (approve/reject) along with a hash of the content and their signature. The contract verifies the signature and ensures the operator is staked and eligible to participate.

Reward Distribution: Operators are rewarded for their work through EigenLayer's restaking mechanism, with rewards distributed transparently on-chain.

  1. EigenLayer Integration GuardianScope integrates with EigenLayer's AVS infrastructure, which provides the security and coordination layer for the decentralized network of operators.

ServiceManagerBase: GuardianScope implements EigenLayer's ServiceManagerBase contract to handle task coordination and signature aggregation.

BLS Signatures: Operators use BLS signatures to sign their moderation decisions, which are then aggregated for efficient on-chain verification.

Slashing Conditions: Malicious or non-performing operators can be slashed, ensuring the network's integrity and security.

  1. AI-Powered Content Analysis Instead of building custom AI models, GuardianScope uses OpenAI's API for content analysis. The Rust-based operator handles the API calls and processes the moderation results.

OpenAI API Integration: The Rust operator sends content to the OpenAI API for analysis and receives moderation decisions (e.g., approve/reject) based on the API's response.

Real-Time Analysis: The OpenAI API provides real-time moderation capabilities, ensuring quick turnaround times for moderation tasks.

Privacy-Preserving: While the content is sent to OpenAI for analysis, the system ensures that sensitive data is handled securely and in compliance with privacy regulations.

  1. Rust Operator The Rust-based operator is the core component that ties everything together. It performs the following tasks:

Listens for new moderation tasks emitted by the GuardianScope smart contract.

Calls the OpenAI API to analyze the content and generate a moderation decision.

Submits the decision back to the blockchain, signed with the operator's BLS signature.

Handles errors and retries gracefully, ensuring robust operation in a decentralized environment.

Development Process Local Devnet Deployment To make development and testing easier, GuardianScope provides a local devnet setup using Foundry's Anvil chain. Here's how it works:

Start Anvil Chain: A local Ethereum testnet is started using Anvil, providing a sandbox environment for testing.

Deploy Contracts: The EigenLayer core contracts and GuardianScope AVS contracts are deployed to the local chain.

Start Rust Operator: The Rust-based operator is started, connecting to the local chain and listening for moderation tasks.

Test Moderation: Developers can submit test content for moderation and observe how the system processes it using the OpenAI API.

Testing GuardianScope includes comprehensive tests for both the smart contracts and the Rust operator. The tests are written in Solidity (for smart contracts) and Rust (for the operator), ensuring that the system behaves as expected under various conditions.

Hacky or Notable Solutions Rust Operator for Performance:

Implementing the operator in Rust was a strategic choice for performance and efficiency. Rust's memory safety and concurrency features make it ideal for handling high-throughput tasks in a decentralized network.

The operator uses async/await to handle concurrent tasks, such as listening for new tasks and making API calls to OpenAI.

OpenAI API Integration in Rust:

Integrating the OpenAI API in Rust required using HTTP libraries like reqwest or hyper to make API calls and process JSON responses. This was a lightweight and efficient solution compared to using a heavier stack like Python.

AVS HelloWorld Template:

Using the AVS HelloWorld template as a starting point allowed us to quickly build the core functionality of GuardianScope. The template provided the basic structure for task coordination, operator management, and reward distribution, which we extended to support content moderation.

Partner Technologies and Their Benefits EigenLayer:

EigenLayer's restaking mechanism and AVS infrastructure were critical to GuardianScope's security and scalability. By leveraging EigenLayer, we were able to build a decentralized network of operators with strong economic incentives to act honestly.

OpenAI API:

Using OpenAI's API for content analysis allowed us to quickly implement advanced AI capabilities without building custom models. This saved significant development time and provided access to state-of-the-art NLP models.

Rust:

Rust's performance, safety, and efficiency made it the perfect choice for implementing the operator. Its async/await features and strong ecosystem for blockchain integration (e.g., ethers-rs) streamlined development.

background image mobile

Join the mailing list

Get the latest news and updates