Skip to content

A Decentralized knowledge marketplace: mint AI NFTs and earn whenever someone learns from you.

Notifications You must be signed in to change notification settings

Raksha001/echolink

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EchoLink - Decentralized Knowledge Marketplace 🌐🧠

Mint your content as AI Echo NFTs powered by ASI uAgents and MeTTa graphs. Earn PYUSD micro-payments directly from users who query your Echo for verifiable insights, with all usage transparently tracked on Blockscout.

Built for ETHOnline 2025.


Build Status License React.js TypeScript Python AI Agents Blockscout Monetization Smart Contracts EVM Data Layer Vector DB NLP


🌟 Overview

EchoLink is a decentralized knowledge marketplace that revolutionizes how knowledge is created, owned, and accessed. Creators upload content (text, PDF, video, audio), which is automatically processed into structured knowledge graphs and minted as interactive Echo NFTs. Users can query these Echos using natural language, with flexible payment options including pay-per-query, credit subscriptions, and full ownership purchases.

The platform delivers a scalable real-world solution for knowledge monetization, combining blockchain ownership, multi-agent AI systems, and seamless payments to create new economic opportunities in the creator economy.

End-to-End Value Proposition

User Persona Real-World Scenario Quantifiable Impact
🎓 The Professor (Dr. Sarah) Mints her entire MIT Quantum Physics course (3 years of lectures) as an Echo. Passive Income Stream: Wakes up to $47 PYUSD overnight from 235 queries globally. Her knowledge now works 24/7 while she sleeps. 90-day result: $4,200+ in micropayments from students worldwide.
🔬 The Researcher (Dr. James) Publishes his breakthrough cancer research methodology as an Echo (normally behind $50/month journal paywall). Democratized Access: One-time query costs $0.50 vs. subscription. Researchers in 12 countries access his work. Impact: Knowledge discovery increased 340% through affordable access.
📚 The Student (Maria) Needs to understand Einstein's relativity for an exam tomorrow. Instant Expertise: Asks "Why does time slow down near black holes?" gets precise explanation with mathematical proofs drawn from Einstein's complete works. Time Saved: 6 hours of reading → 2-minute query. Result: Scored 98/100.
💼 The Corporate Trainer (Mike) Works for a Fortune 500 company. Mints internal training content. Cost Efficiency: Company saves $15,000/month on live training. Employees query Echo 24/7. ROI: 300% return in first quarter. Every employee has instant access to institutional knowledge.
🏥 The Medical Specialist (Dr. Lisa) Mints her 20-year collection of rare disease case studies. Lifesaving Speed: Doctors worldwide query her Echo for rare diagnosis patterns. Real Impact: Reduced misdiagnosis rate by 40%. Monetization: Earns while helping save lives globally.
🔍 The Analyst (Alex) Wants to find the best quantum computing Echo on the platform. AI-Powered Discovery: Asks AI analyst chatbot "What's the highest performing Echo for quantum algorithms?" Gets intelligent analysis comparing 50+ Echos using Blockscout MCP on-chain data. Result: Finds perfect Echo in 30 seconds vs. 2 hours of manual browsing.
📈 The Protocol Facilitates transparency and trust through blockchain. Trustless Economy: All 50,000+ transactions verified on-chain via Blockscout. Creator Earnings: $127,000+ distributed to 234 creators in 6 months. Transparent Fees: 5% sustains platform with full audit trail.

🛠️ Core Architecture and Key Features

This section details the integrated technologies and the features they enable, combining the core integrations with their resulting capabilities.

🤖 Multi-Agent AI System (ASI Alliance Integration)

EchoLink implements a robust Multi-Agent Architecture leveraging the ASI Alliance stack for seamless, sophisticated query processing.

Feature Description Core Integration/Agent
Specialized Agents Three agents work in concert to deliver a seamless workflow: Orchestrator, Payment, and Knowledge Agents. uAgents
Agent Coordination Intelligently routes incoming queries based on context and ownership status and ensures secure agent-to-agent messaging. Orchestrator Agent (Agentverse) & Fetch.ai Almanac
Real-Time Payment Validation Validates blockchain transactions in real-time, checking PYUSD transfers and credit usage with secure Web3.py verification. Payment Agent (Agentverse)
Advanced Query Processing Processes natural language queries through multi-stage reasoning: FAISS vector search $\rightarrow$ MeTTa predicate queries $\rightarrow$ ASI:One synthesis. Knowledge Agent (Agentverse)
Structured Reasoning Advanced structured reasoning with entity-relation-value triples enables deep semantic understanding. MeTTa Knowledge Graphs
Natural Interaction Provides intuitive conversational interface, making advanced AI reasoning accessible to all users. ASI:One Integration & Chat Protocol
Agent Discovery All specialized agents are registered and discoverable on Agentverse. Agentverse Deployment

Agentverse Deployment Links: All agents registered and discoverable on Agentverse:

🧠 MeTTa Knowledge Graph Reasoning

EchoLink leverages MeTTa (Meta-Type Theoretical Language) for sophisticated symbolic reasoning over knowledge, ensuring complex and traceable fact retrieval.

Feature Description
Triple Extraction Extracts precise knowledge triples (subject-relation-object) from diverse file formats (PDF, video, audio, text) using the REBEL Extraction model.
Symbolic Representation Converts knowledge triples into MeTTa atoms for symbolic reasoning and logical inference.
Dual Search Strategy Combines FAISS vector embeddings for semantic similarity with MeTTa query predicates for precise logical inference.
Complex Queries Supports complex reasoning queries like !(query relation entity) and inverse queries for comprehensive fact retrieval.
Source Provenance Every piece of knowledge maintains clear attribution and traceability to its original source content.

💳 PayPal PYUSD Payment System

EchoLink demonstrates the transformative use of PayPal PYUSD for secure, granular knowledge commerce and microtransactions.

Payment Model/Feature Description Technical Implementation
Pay-Per-Query Direct microtransactions for one-time knowledge access (e.g., 0.1 PYUSD per query). Smart Contract Integration with ERC-20 transferFrom and allowance patterns.
Credit Subscriptions Buy credits in bulk (1 PYUSD = 100 credits, 1 credit = 0.01 PYUSD) for frequent, flexible access. On-chain verification of PYUSD transfers and credit usage tracked by the Payment Agent.
Full Ownership One-Time Purchase model: Buy the full Echo NFT for unlimited lifetime access to the knowledge. ERC-721 EchoNFT contract for ownership and access control.
Consumer Experience Seamless Rainbow wallet integration with one-click payments and instant processing. Automatic transaction tracking via Blockscout SDK.
Protocol Economics Transparent 5% fee supports platform sustainability while ensuring creators are fairly rewarded for their knowledge. Creator earnings and query volume calculated using trustless event logs (QueryPaid, CreditsUsed, EchoPurchased).
Real-World Value Enables microtransactions previously impractical with high gas fees, supports global commerce, and creates sustainable economics for creators. Facilitated by low-cost blockchain infrastructure.

📊 Blockscout Analytics Platform

EchoLink leverages Blockscout to provide comprehensive, trustless blockchain analytics and real-time monitoring.

Feature Description Core Integration
AI-Powered Insights The MCP Chatbot (Model Context Protocol) provides intelligent, AI-reasoned blockchain insights. Model Context Protocol (MCP) Chatbot
Natural Language Queries Users can ask questions like "What's the highest performing Echo?" and get AI-reasoned answers using MCP tools (e.g., read_contract, get_token_transfers). MCP Chatbot & On-Chain Intelligence
Trustless Ledger Calculations Creator earnings, query volume, and Echo purchases are computed directly from event logs (QueryPaid, CreditsUsed, EchoPurchased) ensuring transparency and eliminating centralized dependencies. Blockscout MCP/API
Real-Time Tracking Provides real-time notifications and status updates for transactions via the Blockscout SDK. Blockscout SDK
Explorer Integration Seamless links to Blockscout explorer for transaction verification and contract interactions. Blockscout SDK
Leaderboard Analytics Dynamic, on-chain leaderboards display top-performing Echos and creators(earnings, query volume, etc). Rankings are derived from real-time event logs to ensure accuracy and fairness. Includes visualizations for protocol stats, price distribution and activity trends. Blockscout API/MCP
User Experience Enhancements Real-time payment confirmations, analytics dashboards, and explorer-linked transparency enhance user confidence and engagement. Blockscout SDK/API
Performance Metrics Comprehensive analytics on Echo performance, creator earnings, and platform activity. Trustless Ledger (using event logs)
Developer Benefits Open Source, fully composable with other Web3 primitives, Multi-Chain Ready via the MCP server, and Production-Ready. Open Source & MCP Server
Enterprise Monitoring Provides continuous, automated monitoring of transactions, queries, and smart contract performance—enabling enterprise-level reliability and observability. MCP Server & Blockscout SDK

⛓️ Blockchain Infrastructure, Ownership & Access

The foundation of EchoLink is a robust Web3 infrastructure built on the Ethereum Sepolia testnet.

  • Deployment: Deployed in Ethereum Sepolia testnet.

  • EchoNFT Contract: ERC-721 EchoNFT contract for ownership and access control.

  • Payment Integration: ERC-20 PYUSD integration for standardized payments.

  • Ownership & Access Control:

    • Owned Echos: Unlimited queries for owners (bypasses payment validation).

    • Paid Access: Pay-per-query or credit-based access for non-owners.

    • Transferable Ownership: Echo NFTs can be sold or transferred.

🎨 Creator Tools

EchoLink provides a comprehensive suite of tools for creators to turn their content into monetized Echo NFTs:

  1. Multi-Format Upload: Supports TXT, PDF, DOCX, MP4, MOV, MP3, and WAV.

  2. Automatic Transcription: Uses local Whisper model for video/audio transcription.

  3. Knowledge Extraction: Uses REBEL model for precise fact extraction.

  4. MeTTa Knowledge Graph Creation.

  5. Vector Embeddings with FAISS.

  6. Automatic Echo NFT minting on the blockchain.

🏗️ Architecture

System Components

┌─────────────────────────────────────────────────────────────────────┐
│                         ECHOLINK SYSTEM                             |
├─────────────────────────────────────────────────────────────────────┤
│                                                                     │
│  Frontend (React + TypeScript)                                      │
│  ├── EchoDashboard (User dashboard)                                 │
│  ├── CreatorStudio (Mint Echo NFTs)                                 │
│  ├── EchoGallery (Browse marketplace)                               │
│  ├── CreditManager (Buy credits)                                    │
│  ├── EchoLeaderboard (Analytics & rankings)                         │
│  └── AI Analyst (Blockscout MCP chatbot)                            │
│                                                                     │
│  Backend (Express.js + TypeScript)                                  │
│  ├── Creator Studio Server (File upload & processing)               │
│  ├── Agent Services (Orchestrator, Payment, Knowledge)              │
│  └── Blockscout MCP Integration (AI analyst endpoint)               │
│                                                                     │
│  Smart Contracts (Solidity)                                         │
│  ├── EchoNFT (ERC-721 with access control)                          │
│  └── QueryPayments (Payment handling)                               │
│                                                                     │
│  AI/Knowledge Processing                                            │
│  ├── REBEL Model (Triple extraction)                                │
│  ├── MeTTa (Symbolic reasoning)                                     │
│  ├── FAISS (Vector embeddings)                                      │
│  └── ASI:One LLM (Natural language synthesis)                       │
│                                                                     │
└─────────────────────────────────────────────────────────────────────┘

Multi-Agent Architecture (ASI Alliance Integration)

                    [EchoLink Frontend]
                              ↓
┌─────────────────────────────────────────────────────────┐
│  Agentverse (Discovery & Hosting)                       │
└─────────────────────────────────────────────────────────┘
                              ↓ REST calls to mailbox agents
┌─────────────────────────────────────────────────────────┐
│           Orchestrator Agent (Registered)               │
│  - Receives queries from frontend                       │
│  - Routes to appropriate specialized agent              │
│  - Coordinates multi-agent workflows                    │
└──────────┬──────────────────────────────┬───────────────┘
           │                              │
     ┌─────▼───────┐              ┌───────▼────────┐
     │  Payment    │              │   Knowledge    │
     │   Agent     │              │     Agent      │
     │(Registered) │              │  (Registered)  │
     └─────┬───────┘              └───────┬────────┘
           │                              │
           │ Validates blockchain         │
           │ transactions                 │ Loads MeTTa Graph
           │                              │
           │                              ├─→ FAISS Vector Search
           │                              ├─→ MeTTa Query Predicates
           │                              └─→ ASI:One LLM Synthesis
           │
     [PYUSD Smart Contract]       [Knowledge Storage]
     
Fetch.ai Almanac: Secure agent-to-agent messaging

Sequence flow

sequenceDiagram
    participant Creator
    participant User
    participant Frontend
    participant Wallet
    participant Contracts
    participant Blockchain
    participant Agents as Backend/Agents

    %% --- 1. Creator Minting Echo (Creation Flow) ---
    Note over Creator, Blockchain: 1. Echo Creation & Minting
    Creator->>Frontend: Upload Content (PDF/Video/etc.)
    activate Frontend
    Frontend->>Agents: Process File (Extract, Embed)
    activate Agents
    Agents->>Agents: Text -> Triples -> Atoms -> Embeddings
    Agents->>Contracts: Save Knowledge Base Info
    activate Contracts
    Contracts-->>Agents: Info Saved
    deactivate Contracts
    Agents-->>Frontend: Knowledge Base Ready
    deactivate Agents
    Creator->>Frontend: Fill Echo Details (Price, Name)
    Creator->>Wallet: Connect/Sign Transaction
    activate Wallet
    Wallet->>Contracts: mintEcho()
    activate Contracts
    Contracts->>Blockchain: Transaction Confirmation
    activate Blockchain
    Blockchain-->>Contracts: Confirmed
    deactivate Blockchain
    Contracts-->>Wallet: Minting Successful
    deactivate Contracts
    Wallet-->>Frontend: Echo Listed (Success)
    deactivate Wallet
    Frontend-->>Creator: Echo Listed (Success)
    deactivate Frontend

    rect rgb(59, 151, 151)
    Note over User, Blockchain: 7. User Buying Credits
    User->>Frontend: Initiate Credit Purchase
    activate Frontend
    Frontend->>Wallet: Check Balance/Allowance
    activate Wallet
    Wallet->>Contracts: approve(PYUSD) (if needed)
    activate Contracts
    Contracts-->>Wallet: Approved
    Wallet->>Contracts: purchaseCredits(amount)
    Contracts->>Blockchain: Mint Credits
    activate Blockchain
    Blockchain-->>Contracts: Confirmed
    deactivate Blockchain
    Contracts-->>Wallet: Credits Minted
    deactivate Contracts
    Wallet-->>Frontend: Credit Balance Updated
    deactivate Wallet
    Frontend-->>User: Credit Balance Updated
    deactivate Frontend
    end

    %% --- 4. User Buying Complete Echo (Full Ownership Flow) ---
    rect rgb(19, 36, 64)
    Note over User, Blockchain: 4. User Buying Complete Echo (Ownership)
    User->>Frontend: Select Echo & Buy
    activate Frontend
    Frontend->>Wallet: Check Balance/Allowance
    activate Wallet
    Wallet->>Contracts: approve(PYUSD) (if needed)
    activate Contracts
    Contracts-->>Wallet: Approved
    Wallet->>Contracts: buyEcho(tokenId)
    Contracts->>Blockchain: Transfer PYUSD & Update Owner
    activate Blockchain
    Blockchain-->>Contracts: Confirmed
    deactivate Blockchain
    Contracts-->>Wallet: Ownership Transferred
    deactivate Contracts
    Wallet-->>Frontend: Ownership Granted (Unlimited Access)
    deactivate Wallet
    Frontend-->>User: Ownership Granted
    deactivate Frontend
    end

    %% --- 2 & 3. User Accessing Paid Echo (Query Flow - Micro-payment/Credits) ---
    Note over User, Blockchain: 2 & 3. User Accessing Paid Echo (Query)
    User->>Frontend: Select Echo & Enter Query
    activate Frontend
    Frontend->>Contracts: Check Ownership
    activate Contracts
    Contracts-->>Frontend: Not Owned (Price needed)
    deactivate Contracts
    
    alt Paid with PYUSD (2)
        User->>Wallet: Sign Transaction (0.1 PYUSD)
        activate Wallet
        Wallet->>Contracts: approve(PYUSD) (if needed)
        activate Contracts
        Contracts-->>Wallet: Approved
        Wallet->>Contracts: transferFrom() payment
        Contracts->>Blockchain: Transaction Confirmation (tx_hash)
        activate Blockchain
        Blockchain-->>Contracts: Confirmed
        deactivate Blockchain
        Contracts-->>Wallet: Payment Complete
        deactivate Contracts
        Wallet-->>Frontend: Payment Tx Hash
        deactivate Wallet
        Frontend->>Agents: POST /query {query, tx_hash}
    else Paid with Credits (3)
        User->>Wallet: Submit useCreditsForQuery()
        activate Wallet
        Wallet->>Contracts: Deduct Credits
        activate Contracts
        Contracts->>Blockchain: Emit CreditsUsed Event
        activate Blockchain
        Blockchain-->>Contracts: Event Confirmed
        deactivate Blockchain
        Contracts-->>Wallet: Deduction Complete
        deactivate Contracts
        Wallet-->>Frontend: Credits Used
        deactivate Wallet
        Frontend->>Agents: POST /query {query, use_credits: true}
    end
    deactivate Frontend
    
    activate Agents
    Agents->>Blockchain: Validate Payment (tx_hash or Event)
    activate Blockchain
    Blockchain-->>Agents: Payment Status
    deactivate Blockchain
    Agents->>Agents: Load MeTTa Graph (Knowledge uAgent)
    Agents->>Agents: FAISS Search -> MeTTa Reasoning -> LLM Synthesize Answer
    Agents-->>Frontend: Return Answer
    deactivate Agents
    activate Frontend
    Frontend-->>User: Display AI Answer
    deactivate Frontend

    %% --- 5. User Accessing Leaderboard ---
    Note over User, Blockchain: 5. Leaderboard Access
    User->>Frontend: Click Leaderboard
    activate Frontend
    Frontend->>Contracts: getAllTokenIds() / getEchoData()
    activate Contracts
    Contracts-->>Frontend: Token Data
    deactivate Contracts
    Frontend->>Blockchain: Fetch Query/Credits Events (Blockscout API)
    activate Blockchain
    Blockchain-->>Frontend: Event Logs
    deactivate Blockchain
    Frontend->>Frontend: Aggregate Metrics, Sort & Display
    Frontend-->>User: Display Leaderboard
    deactivate Frontend

    %% --- 6. User Accessing AI Analyst Chatbot ---
    Note over User, Blockchain: 6. AI Analyst Chatbot
    User->>Frontend: Ask Question
    activate Frontend
    Frontend->>Agents: POST /ask {question}
    activate Agents
    Agents->>Agents: LLM (ASI:One) binds Blockscout tools
    Agents->>Blockchain: Call MCP Tools (read_contract, get_address_info, etc.)
    activate Blockchain
    Blockchain-->>Agents: Return Structured On-chain Data
    deactivate Blockchain
    Agents->>Agents: LLM Processes Data & Generates Insight
    Agents-->>Frontend: Return Analysis + Charts
    deactivate Agents
    Frontend-->>User: Display AI Analysis
    deactivate Frontend
Loading

🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • Python (v3.9 or higher)
  • MetaMask or compatible Web3 wallet
  • Ethereum Sepolia testnet connection
  • PYUSD tokens (testnet)

Installation

  1. Clone the repository
git clone <repository-url>
cd EchoLink/echolink-protocol
  1. Install Frontend Dependencies
cd frontend
npm install
  1. Install Backend Dependencies
cd ../backend
npm install
  1. Install Smart Contract Dependencies
cd ../contracts
npm install
  1. Set Up Python Environment (for AI processing)
cd ../backend/src/poc
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Environment Setup

Create .env files in the respective directories:

Backend (.env)

CREATOR_STUDIO_PORT=8000
PYTHON_PATH=./src/poc/venv/bin/python

Frontend (.env)

REACT_APP_ECHO_NFT_CONTRACT=<deployed_contract_address>
REACT_APP_PYUSD_CONTRACT=<pyusd_contract_address>
REACT_APP_CHAIN_ID=84532  # Base Sepolia

Running the Application

  1. Start the Backend
cd backend
npm run dev  # or npm start
# open a new terminal
cd backend
npm run creator-studio
  1. Start the Frontend
cd frontend
npm start
  1. Deploy Smart Contracts (if not already deployed)
cd contracts
npx hardhat compile
npm run deploy
npm run deploy:query-payments
  1. Start AI Agents (if using local agents)
cd backend/src/poc
source venv/bin/activate
./start_multi_agent_system.sh

 Update the relevant API keys in knowledge_agent.py, intelligent_agent.py, multiagent_config.py, backend/index.js
  1. Start Blockscout MCP Server (for AI Analyst chatbot)
# Clone the Blockscout MCP server repository
git clone https://github.com/blockscout/mcp-server.git
cd mcp-server

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies (if needed)
pip install -e .

# Run the MCP server in HTTP mode with REST API
python -m blockscout_mcp_server --http --rest --http-host 0.0.0.0 --http-port 8080

Note: The Blockscout MCP server enables the AI Analyst chatbot feature, which provides intelligent blockchain analytics and insights using the Model Context Protocol. Make sure to keep this server running alongside the application.

Blockscout SDK Integration

To provide real-time transaction feedback and analytics, EchoLink integrates the Blockscout App SDK. This allows users to instantly see their transaction status and history directly inside the app — no external explorer needed.

Installation

npm install @blockscout/app-sdk
# or
yarn add @blockscout/app-sdk

Setup

Wrap your app with the SDK providers:

import { NotificationProvider, TransactionPopupProvider } from "@blockscout/app-sdk";

function App() {
    return (
        <NotificationProvider>
            <TransactionPopupProvider>
                <App />
            </TransactionPopupProvider>
        </NotificationProvider>
    );
}

Usage Example

import { useNotification, useTransactionPopup } from "@blockscout/app-sdk";

function EchoTxComponent() {
    const { openTxToast } = useNotification();
    const { openPopup } = useTransactionPopup();

    const handleTx = async (txHash: string) => {
        await openTxToast("11155111", txHash); // Sepolia testnet
    };

    const viewHistory = () => {
        openPopup({ chainId: "11155111" });
    };

    return (
        <div>
            <button onClick={() => handleTx("0x123...")}>Send Transaction</button>
            <button onClick={viewHistory}>View History</button>
        </div>
    );
}

📘 Instructions on installation and usage available in the official Blockscout App SDK Docs

🔄 Workflow Sequences

This section details the complete end-to-end flow for each use case in EchoLink.

1. Creator Minting Echo

graph LR
    %% All nodes use standard rectangles [ ] or terminal shapes (( ))
    %% All special characters like : and () have been removed or simplified.
    A(("Start:<br>Creator"))
    B[Upload PDF / Video / Audio / Text]
    C[Backend: File Processing<br>Extract Text via Whisper]
    D[Python: REBEL Model<br>Extract Triples S-R-O]
    E[MeTTa Builder<br>Convert to MeTTa Atoms]
    F[FAISS Indexer<br>Create Vector Embeddings]
    G[(Storage: Save knowledge base)]
    H[Creator: Fill Echo Details]
    I[Wallet: Connect MetaMask]
    J[Smart Contract: EchoNFT<br>Call mintEcho]
    K[Blockchain: Sepolia<br>Transaction Confirmed]
    L(("End: Echo Listed<br>in Gallery ✅"))

    %% Flow
    A --> B
    B --> C
    C --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H --> I
    I --> J
    J --> K
    K --> L
Loading

2. User Accessing Paid Echo (Micro-payment with PYUSD / Using Credts)

graph LR
    %% Start Node
    A((Start: Access Paid Echo))

    %% Initial User Actions
    B["Frontend: Select Echo"]
    C{"Check Ownership"}
    D{"Display Payment Options"}

    %% Payment Choice Branch
    D -- "Select 'Pay with PYUSD'" --> E
    D -- "Select 'Pay with Credits'" --> O

    %% PYUSD Payment Flow (E to N)
    E["User: Enter Query & Click 'Send (0.1 PYUSD)'"]
    F{"Wallet: Approve PYUSD spending (first time)?"}
    G["Smart Contract: PYUSD<br/>approve() transaction"]
    H["Smart Contract: EchoNFT<br/>transferFrom() PYUSD payment"]
    I["Blockchain: Tx Confirmed (tx_hash)"]
    J["Frontend: POST /query {query, token_id, tx_hash}"]
    K["Backend: Orchestrator uAgent<br/>Route to Payment Agent"]
    L["Payment uAgent: Validate tx on-chain (Web3.py)"]
    M["Payment Validated"]
    N["Route to Knowledge Agent"]

    F -- "No" --> H
    F -- "Yes" --> G
    G --> H

    %% Credits Payment Flow (O to S)
    O["User: Click 'Send (10 credits)'"]
    P["Wallet: Submit useCreditsForQuery() Tx"]
    Q["Smart Contract: EchoNFT<br/>Deduct credits & Emit CreditsUsed Event"]
    R["Frontend: POST /query {query, token_id, use_credits: true}"]
    S["Backend: Orchestrator uAgent<br/>Route to Payment Agent"]
    T["Payment uAgent: Validate CreditsUsed event"]
    U["Payment Validated"]
    V["Route to Knowledge Agent"]

    %% Common Knowledge Processing Flow (W to Z)
    W["Knowledge uAgent: Load MeTTa graph"]
    X["FAISS Search: Find relevant facts"]
    Y["MeTTa Reasoning: Execute query predicates"]
    Z["ASI:One LLM: Synthesize answer"]
    AA["Backend: Return synthesized answer"]
    BB(("End: Frontend Display AI Answer ✅"))

    %% Connections
    A --> B
    B --> C
    C -- "Not owned" --> D
    
    %% PYUSD Path
    E --> F
    H --> I
    I --> J
    J --> K
    K --> L
    L --> M
    M --> N

    %% Credits Path
    O --> P
    P --> Q
    Q --> R
    R --> S
    S --> T
    T --> U
    U --> V

    %% Merge to Knowledge Agent
    N --> W
    V --> W

    %% Knowledge Processing
    W --> X
    X --> Y
    Y --> Z
    Z --> AA
    AA --> BB
Loading

3. User Buying Complete Echo (Full Ownership)

graph LR
    %% Define Shapes using multiline labels
    A(("Start"))
    B["Frontend: Find Echo & Click 'Buy'"]
    C{"Check PYUSD Balance"}
    D{"Is PYUSD<br/>Approval Required?"}
    E["Wallet: Call approve() on<br/>PYUSD Token"]
    F["PYUSD Contract:<br/>Allowance Granted"]
    G["Frontend: Verify Allowance<br/>& Confirm Purchase"]
    H["Smart Contract:<br/>Call buyEcho(tokenId)"]
    I["Contract Logic: Transfer <br/>PYUSD & Update Owner <br/> Mapping"]
    J["Blockchain: Emit <br/> EchoPurchased Event <br/> Confirmed"]
    K["Frontend: Update UI<br/>(Show 'You Own This' badge)"]
    L(("End: <br/> Unlimited Access <br/> Enabled ✅"))

    %% Define Flow
    A --> B
    B --> C
    C --> D
    
    %% Conditional Flow for Approval
    D -- "No" --> G
    D -- "Yes" --> E
    E --> F
    F --> G
    
    G --> H
    H --> I
    I --> J
    J --> K
    K --> L
Loading

4. User Accessing Leaderboard

graph LR
    %% Start and Initial Action
    A(("Start: User Clicks Leaderboard Tab"))
    B[Frontend: Load EchoLeaderboard Component]
    
    %% Data Retrieval - Step 1: Get All Echos
    C[Read Contract - Call getAllTokenIds on EchoNFT]
    
    %% Data Retrieval - Step 2: Loop & Fetch Data
    subgraph Data Aggregation Loop
        D{Loop Through All Token IDs}
        D -- Yes --> E
        E[Call getEchoData for current Echo]
        
        %% API Call for Transaction History
        F[Fetch Blockscout Data - GET /api logs]
        G[Retrieve Events - QueryPaid + CreditsUsed Events]
        
        G --> H
        H[Process Events - Aggregate queries and earnings]
        H --> D
        D -- No --> I
    end
    
    %% Final Calculation & Display
    I[Calculate Metrics - Total market value, fees, active Echos]
    J[Fetch Creator Stats - GET account txlist for top 5 creators]
    K[Sort and Display - Show rankings, charts, price distribution]
    L(("End: Leaderboard Displayed ✅"))
    
    %% Connections
    A --> B
    B --> C
    C --> D
    E --> F
    F --> G
    
    %% Exit Loop and Final Steps
    I --> J
    J --> K
    K --> L
Loading

5. User Accessing AI Analyst Chatbot (Blockscout MCP)

graph LR
    %% Text highly simplified to avoid strict parser errors
    A(("Start User Clicks AI Button"))
    B[Frontend AI Analyst Chatbot Opens]
    C[User Type Question Highest performing Echo]
    D[Frontend POST /ask endpoint]
    
    %% Backend and LLM Initialization
    E[Backend Receive Request]
    F[ASI One LLM Bind Blockscout MCP Tools]
    G[LLM Reasoning Determine which tools to use]
    
    %% Tool Execution
    H[Call MCP Tools read_contract, get_address_info, etc]
    I[Blockscout MCP Server Query Blockchain Data]
    J[Return Data Structured JSON On-Chain Info]
    
    %% Final Synthesis
    K[ASI One LLM Process Data and Generate Insights]
    L[Backend Return Answer and Charts]
    M(("End Display AI Analysis with Visualizations ✅"))

    %% Connections
    A --> B
    B --> C
    C --> D
    D --> E
    E --> F
    F --> G
    G --> H
    H --> I
    I --> J
    J --> K
    K --> L
    L --> M
Loading

6. User Buying Credits

graph LR
    %% All nodes are simple rectangles or terminals, and text is simplified
    A(("Start User Clicks Credits Tab"))
    B[Component CreditManager Display current credit balance]
    C[User Enter Amount to Purchase e g 100 credits]
    D[Frontend Calculate PYUSD Cost 1 PYUSD = 100 credits]
    E{Check Wallet Verify Sufficient PYUSD Funds}
    
    %% Conditional Check for PYUSD Allowance
    F{Check Allowance Is EchoNFT approved to spend PYUSD}
    
    G[Wallet Call approve on PYUSD Contract]
    H[PYUSD Contract Allowance Granted]
    I[Frontend Verify Allowance]
    
    %% Final Purchase Action
    J[User Click Purchase Credits]
    K[Smart Contract EchoNFT Call purchaseCredits amount]
    L[Contract Transfer PYUSD Mint credits to userCredits mapping]
    M[Blockchain Emit CreditsPurchased Event Confirmed]
    N(("End Refresh Balance Show Success ✅"))

    %% Connections
    A --> B
    B --> C
    C --> D
    D --> E
    
    %% E - Funds Check Logic (FIXED)
    E -- Funds OK --> F
    E -- Insufficient Funds --> N

    %% F - Allowance Branch (FIXED)
    F -- Insufficient --> G
    F -- Sufficient --> J
    G --> H
    H --> I
    I --> J
    
    %% Transaction Flow
    J --> K
    K --> L
    L --> M
    M --> N
Loading

📖 Usage Guide

For Creators: Minting an Echo

  1. Navigate to "🎨 Create" tab
  2. Upload your knowledge file (PDF, video, audio, text)
  3. Fill in Echo details:
    • Name and description
    • Price per query (in PYUSD)
    • Purchase price (optional)
    • Set as free or paid
  4. Click "Mint Echo" and approve wallet transactions
  5. Wait for knowledge processing (background)
  6. Your Echo appears in the marketplace!

For Users: Querying an Echo

  1. Browse "💬 Explore" gallery
  2. Select an Echo you want to query
  3. If you own it: Unlimited access
  4. If you don't own it: Pay with credits or PYUSD
  5. Type your question and get AI-powered answers
  6. Answers are synthesized from the knowledge graph

For Users: Buying an Echo

  1. Find an Echo in the gallery
  2. Click "Buy Echo"
  3. Approve PYUSD spending
  4. Confirm purchase transaction
  5. Enjoy unlimited access to the Echo!

For Users: Managing Credits

  1. Go to "💳 Credits" tab
  2. View your current credit balance
  3. Buy credits with PYUSD (1 PYUSD = 100 credits)
  4. Use credits to query paid Echos

For Users: Viewing Analytics & Leaderboard

  1. Navigate to "🏆 Leaderboard" tab
  2. View real-time rankings of top-performing Echos based on query volume
  3. Check creator leaderboard showing total earnings and Echo count
  4. Explore market metrics:
    • Total market value transacted
    • Protocol fees collected
    • Active Echos (7-day window)
    • Average revenue per Echo
  5. View price distribution visualization showing knowledge pricing tiers
  6. See top 5 Echos by query volume with interactive charts

For Users: AI Analyst Chatbot (Blockscout MCP)

  1. Click the floating AI button (bottom-right corner)
  2. The AI Analyst chatbot powered by Blockscout MCP opens
  3. Ask natural language questions about blockchain data:
    • "What's the highest performing Echo?"
    • "Show me all Echos created by address 0x..."
    • "What's the total value of transactions on the platform?"
    • "Which creator has the most earnings?"
  4. Get AI-reasoned answers with on-chain data insights
  5. View transaction logs, contract calls, and address information
  6. The AI uses Blockscout MCP tools (read_contract, get_address_info, get_token_transfers) for comprehensive analysis

🛠️ Technologies Used

Frontend

  • React + TypeScript
  • Wagmi + RainbowKit (Web3 integration)
  • TailwindCSS (styling)
  • Blockscout SDK (transaction tracking and notifications)

Backend

  • Express.js (API server)
  • Multer (file uploads)
  • PDF-Parse, Mammoth (document processing)
  • FFmpeg (video/audio processing)
  • OpenAI Whisper (transcription)

Smart Contracts

  • Solidity (contract language)
  • Hardhat (development framework)
  • OpenZeppelin (security libraries)
  • ERC-721 (EchoNFT contract)
  • ERC-20 (PYUSD integration)

AI Alliance Stack 🚀

  • uAgents: Multi-agent framework for autonomous agents
  • Agentverse: Agent discovery, listing, and hosting platform
  • MeTTa: Symbolic reasoning with knowledge graphs
  • ASI:One: Web3-native LLM for natural language synthesis
  • Fetch.ai Almanac: Agent-to-agent communication and discovery
  • Chat Protocol: Human-agent interaction interface
  • FAISS: Vector embeddings and similarity search
  • REBEL: Triple extraction (subject-relation-object)

PayPal PYUSD 💳

  • PYUSD Token: Stablecoin for payments and transactions
  • ERC-20 Standard: Compatible with all Ethereum wallets
  • Smart Contract Integration: Direct PYUSD transfers in EchoNFT contract
  • Credit System: Flexible payment model (PYUSD ↔ Credits conversion)

Blockscout Integration 🔍

  • Blockscout MCP: AI analyst chatbot powered by Model Context Protocol
  • Blockscout SDK: Transaction tracking, popup notifications, explorer integration
  • MCP Tools: get_address_info, read_contract, get_token_transfers, get_transaction_logs
  • Real-time Analytics: On-chain data insights and performance metrics

Blockchain

  • Ethereum Sepolia (testnet)
  • Web3.py (blockchain interaction)
  • RainbowKit (wallet connection)

🚀 Business Model & Scalability

EchoLink is designed as a sustainable, scalable business:

Revenue Streams

  • Protocol Fees: 5% fee on all transactions (queries, purchases, credit sales)
  • Creator Monetization: Creators set their own prices per query and purchase
  • Premium Features: Future monetization of advanced analytics and tools

Market Opportunity

  • $100B+ creator economy looking for new monetization models
  • Growing demand for AI-powered knowledge tools
  • Web3 adoption creating demand for blockchain-native solutions

Scalability

  • Agent-based architecture scales horizontally
  • MeTTa knowledge graphs enable efficient query processing
  • PYUSD integration eliminates currency conversion barriers
  • Open-source composability enables ecosystem growth

🔮 Future Enhancements

EchoLink will continue evolving with cutting-edge features:

🤖 AI-Powered Recommendations

  • Smart Discovery: Intelligent Echo recommendations powered by Blockscout MCP analysis
  • Usage-Based Suggestions: AI agent analyzes on-chain activity to recommend relevant Echos based on user query patterns
  • Trend Detection: Identify trending knowledge domains and suggest popular Echos
  • Personalized Feed: Deliver curated Echo suggestions based on user interests and browsing history

📈 Advanced Analytics

  • Predictive Insights: ML models to forecast Echo performance and creator earnings
  • Cross-Chain Support: Extend to multiple blockchain networks for broader accessibility
  • Enhanced Search: Natural language search across all Echos with semantic understanding

🔐 Enterprise Features

  • Team Collaboration: Shared workspace for teams to collaborate on Echo creation
  • API Access: Developer APIs for custom integrations and automations
  • Advanced Access Control: Granular permissions and enterprise-level security

🏆 Hackathon Submission Details

🎉 Acknowledgments

EchoLink is built with cutting-edge technologies from leading Web3 and AI platforms:

  • 🤖 ASI Alliance: uAgents framework, MeTTa symbolic reasoning, ASI:One LLM, Agentverse platform
  • 💳 PayPal: PYUSD stablecoin for frictionless global payments
  • 🔍 Blockscout: MCP for AI analytics and SDK for transaction tracking
  • ⛓️ OpenZeppelin: Battle-tested smart contract security patterns
  • 🌐 Fetch.ai: Decentralized agent communication and discovery
  • 🧠 SingularityNET: MeTTa knowledge representation and reasoning

Built with ❤️

About

A Decentralized knowledge marketplace: mint AI NFTs and earn whenever someone learns from you.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 57.9%
  • Python 31.3%
  • JavaScript 5.9%
  • Solidity 3.2%
  • CSS 0.8%
  • HTML 0.5%
  • Shell 0.4%