Skip to content

nitininhouse/Sigmoid-story-frontend

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Decentralized Music Tokenization Platform

Complete Technical Documentation


image

πŸ“‹ Table of Contents

  1. Platform Overview
  2. Architecture
  3. Smart Contract System
  4. Verification System
  5. Token Economics
  6. Security Model
  7. User Experience
  8. API Reference
  9. Integration Guide
  10. Governance
  11. Troubleshooting

🎯 Platform Overview

What is the Decentralized Music Tokenization Platform?

A blockchain-based platform that allows content creators to tokenize their YouTube music videos, creating tradeable digital assets backed by real creative content. The platform combines automated verification, community governance, and direct user verification to ensure authenticity and prevent fraud.

Key Features

  • 🎡 Music Tokenization: Convert YouTube music videos into tradeable blockchain tokens
  • πŸ” Multi-Layer Verification: Automated, community, and manual verification systems
  • πŸ—³οΈ DAO Governance: Community-driven content quality assessment
  • πŸ›‘οΈ Anti-Fraud Protection: Cryptographic proofs and ownership verification
  • πŸ’Ž Unique Token Hashing: Every token gets a unique, immutable identifier
  • 🌍 Complete Transparency: All verification data publicly accessible

Core Benefits

For Creators

  • Monetize music content through tokenization
  • Retain ownership and control of original content
  • Build direct fan engagement through token economics
  • Transparent revenue sharing mechanisms

For Investors/Fans

  • Invest in music content with transparent verification
  • Multiple layers of due diligence information
  • Direct access to verify claims independently
  • Participate in content governance decisions

For the Ecosystem

  • Decentralized content verification without central authority
  • Community-driven quality control
  • Immutable record of content ownership
  • Scalable verification system

πŸ—οΈ Architecture

System Components

graph TB
    subgraph "Frontend Layer"
        A[Web Interface]
        B[Mobile App]
        C[CLI Tools]
    end
    
    subgraph "Backend Services"
        D[Verification API]
        E[YouTube Integration]
        F[DAO Voting Service]
        G[Metadata Service]
    end
    
    subgraph "Blockchain Layer"
        H[Smart Contracts]
        I[Token Factory]
        J[Governance DAO]
        K[Verification Registry]
    end
    
    subgraph "External Services"
        L[YouTube API]
        M[IPFS Storage]
        N[Oracle Network]
    end
    
    A --> D
    B --> D
    C --> H
    D --> E
    E --> L
    D --> H
    F --> J
    G --> M
    H --> I
    H --> K
Loading

Technology Stack

Blockchain

  • Smart Contracts: Solidity 0.8.19+
  • Network: Ethereum Mainnet / Polygon / Arbitrum
  • Token Standard: ERC-20 for fungible tokens, ERC-721 for unique assets
  • Gas Optimization: Layer 2 solutions for reduced costs

Backend

  • Runtime: Node.js with Express.js
  • Database: PostgreSQL for relational data, Redis for caching
  • External APIs: YouTube Data API v3
  • Cryptography: Web3.js for blockchain interactions
  • Message Queues: Bull.js for background job processing

Frontend

  • Framework: React.js with TypeScript
  • Styling: Tailwind CSS
  • State Management: Redux Toolkit
  • Web3 Integration: ethers.js / web3.js
  • Wallet Connection: WalletConnect, MetaMask

πŸ”— Smart Contract System

Core Contracts

1. MusicTokenizationFactory

The main contract that handles token creation and verification management.

contract MusicTokenizationFactory {
    struct VideoToken {
        string youtubeUrl;           // Original YouTube URL
        address owner;               // Token creator's wallet
        bytes32 uniqueHash;         // keccak256(owner + youtubeUrl)
        uint256 timestamp;          // Creation timestamp
        
        // Verification Status
        bool backendChecked;        // Has backend verified?
        bool backendApproved;       // Backend approval result
        string backendReason;       // Verification details
        
        // DAO Governance
        uint256 daoApprovalVotes;   // Community approval votes
        uint256 daoRejectVotes;     // Community rejection votes
        uint256 qualityScore;       // 0-100 quality rating
        uint256 spamFlags;          // Community spam reports
        
        // Token Economics
        uint256 totalSupply;        // Total token supply
        uint256 currentPrice;       // Current token price
        bool tradingEnabled;        // Can tokens be traded?
    }
    
    mapping(bytes32 => VideoToken) public tokens;
    mapping(address => bytes32[]) public userTokens;
    mapping(bytes32 => address) public tokenContracts;
}

2. VerificationRegistry

Manages all verification processes and stores verification history.

contract VerificationRegistry {
    struct VerificationAttempt {
        bytes32 tokenHash;
        address verifier;
        bool approved;
        string reason;
        uint256 timestamp;
        bytes signature;
    }
    
    struct Vote {
        address voter;
        bool approved;
        string reason;
        uint256 weight;
        uint256 timestamp;
    }
    
    address public backendSigner;
    mapping(address => uint256) public voterReputation;
    mapping(bytes32 => VerificationAttempt[]) public verificationHistory;
    mapping(bytes32 => Vote[]) public daoVotes;
}

3. GovernanceDAO

Handles community voting and governance decisions.

contract GovernanceDAO {
    struct Proposal {
        uint256 id;
        string description;
        address proposer;
        uint256 forVotes;
        uint256 againstVotes;
        uint256 startTime;
        uint256 endTime;
        bool executed;
        ProposalType proposalType;
    }
    
    enum ProposalType {
        PARAMETER_CHANGE,
        VERIFIER_UPDATE,
        QUALITY_THRESHOLD,
        SPAM_HANDLING
    }
    
    mapping(uint256 => Proposal) public proposals;
    mapping(address => uint256) public votingPower;
}

Contract Functions

Token Creation

function createMusicToken(
    string memory youtubeUrl,
    uint256 totalSupply,
    string memory metadata
) external returns (bytes32 tokenHash) {
    // Generate unique hash
    tokenHash = keccak256(abi.encodePacked(msg.sender, youtubeUrl));
    
    // Ensure no duplicate tokens
    require(tokens[tokenHash].owner == address(0), "Token already exists");
    
    // Create token record
    tokens[tokenHash] = VideoToken({
        youtubeUrl: youtubeUrl,
        owner: msg.sender,
        uniqueHash: tokenHash,
        timestamp: block.timestamp,
        backendChecked: false,
        backendApproved: false,
        backendReason: "",
        daoApprovalVotes: 0,
        daoRejectVotes: 0,
        qualityScore: 50, // Start neutral
        spamFlags: 0,
        totalSupply: totalSupply,
        currentPrice: 0,
        tradingEnabled: false
    });
    
    // Deploy individual token contract
    address tokenContract = deployTokenContract(tokenHash, totalSupply);
    tokenContracts[tokenHash] = tokenContract;
    
    // Add to user's tokens
    userTokens[msg.sender].push(tokenHash);
    
    emit TokenCreated(msg.sender, youtubeUrl, tokenHash);
}

Backend Verification

function setBackendVerification(
    bytes32 tokenHash,
    bool approved,
    string memory reason,
    bytes memory signature
) external {
    // Verify signature from authorized backend
    bytes32 messageHash = keccak256(abi.encodePacked(tokenHash, approved, reason));
    require(recoverSigner(messageHash, signature) == backendSigner, "Unauthorized");
    
    // Update verification status
    tokens[tokenHash].backendChecked = true;
    tokens[tokenHash].backendApproved = approved;
    tokens[tokenHash].backendReason = reason;
    
    // Enable trading if approved
    if (approved) {
        tokens[tokenHash].tradingEnabled = true;
    }
    
    emit BackendVerification(tokenHash, approved, reason);
}

DAO Voting

function castDAOVote(
    bytes32 tokenHash,
    bool approve,
    string memory reason
) external {
    require(tokens[tokenHash].owner != address(0), "Token does not exist");
    require(voterReputation[msg.sender] > 0, "No voting power");
    
    // Calculate vote weight based on reputation
    uint256 weight = voterReputation[msg.sender];
    
    // Record vote
    daoVotes[tokenHash].push(Vote({
        voter: msg.sender,
        approved: approve,
        reason: reason,
        weight: weight,
        timestamp: block.timestamp
    }));
    
    // Update vote counts
    if (approve) {
        tokens[tokenHash].daoApprovalVotes += weight;
    } else {
        tokens[tokenHash].daoRejectVotes += weight;
    }
    
    // Update quality score
    updateQualityScore(tokenHash);
    
    emit DAOVote(tokenHash, msg.sender, approve, weight);
}

πŸ” Verification System

Multi-Layer Verification Architecture

The platform implements a comprehensive three-layer verification system to ensure content authenticity and prevent fraud.

Layer 1: Automated Backend Verification

Process Flow:

  1. User uploads video URL to create token
  2. Backend service automatically triggered via blockchain events
  3. YouTube API integration checks video metadata
  4. Cryptographic challenge generated for ownership proof
  5. Backend monitors for challenge completion
  6. Verification result signed and submitted to blockchain

Verification Checks:

  • URL Validity: Ensures YouTube URL is accessible and valid
  • Metadata Analysis: Extracts and validates video title, description, tags
  • Channel Verification: Checks channel authenticity and subscriber count
  • Upload Date: Compares video upload date with token creation
  • Ownership Proof: Requires cryptographic challenge in video description

Implementation:

class BackendVerificationService {
    async verifyVideoToken(tokenHash, youtubeUrl, ownerWallet) {
        try {
            // Step 1: Basic URL validation
            const videoData = await this.fetchYouTubeData(youtubeUrl);
            if (!videoData) {
                return this.submitVerification(tokenHash, false, "Invalid YouTube URL");
            }
            
            // Step 2: Generate ownership challenge
            const challenge = this.generateChallenge(ownerWallet, youtubeUrl);
            await this.storeChallenge(tokenHash, challenge);
            
            // Step 3: Check for challenge in description
            const hasChallenge = await this.checkForChallenge(youtubeUrl, challenge);
            if (!hasChallenge) {
                return this.scheduleRetry(tokenHash, 30000); // Retry in 30 seconds
            }
            
            // Step 4: Additional verification checks
            const verificationResult = await this.performDetailedChecks(videoData);
            
            // Step 5: Submit result to blockchain
            return this.submitVerification(tokenHash, verificationResult.approved, verificationResult.reason);
            
        } catch (error) {
            console.error('Verification failed:', error);
            return this.submitVerification(tokenHash, false, `Verification error: ${error.message}`);
        }
    }
    
    generateChallenge(wallet, url) {
        const timestamp = Date.now();
        const nonce = crypto.randomBytes(16).toString('hex');
        return `VERIFY_${keccak256(wallet + url + timestamp + nonce).substring(0, 12)}`;
    }
    
    async performDetailedChecks(videoData) {
        const checks = {
            channelVerified: videoData.channel.verified,
            subscriberCount: videoData.channel.subscriberCount > 1000,
            videoQuality: videoData.definition === 'hd',
            contentType: this.isMusic(videoData.title, videoData.description),
            uploadRecency: this.isRecentUpload(videoData.publishedAt),
            duplicateCheck: await this.checkForDuplicates(videoData.id)
        };
        
        const score = Object.values(checks).filter(Boolean).length;
        const approved = score >= 4; // Require at least 4/6 checks to pass
        
        return {
            approved,
            reason: this.generateVerificationReason(checks, score),
            score
        };
    }
}

Layer 2: Community DAO Verification

Governance Model:

  • Reputation-based voting system
  • Vote weight determined by user history and stake
  • Multiple voting categories (authenticity, quality, spam)
  • Quorum requirements for decision validity

Voting Categories:

  1. Authenticity Vote: Is this really the claimed artist?
  2. Quality Vote: Is this high-quality music content?
  3. Spam Vote: Is this spam or low-effort content?
  4. Originality Vote: Is this original content or a copy?

Reputation System:

class ReputationManager {
    calculateVotingPower(userAddress) {
        const factors = {
            accountAge: this.getAccountAge(userAddress),        // 0-25 points
            successfulVotes: this.getVoteAccuracy(userAddress), // 0-30 points
            tokenHoldings: this.getTokenStake(userAddress),     // 0-25 points
            communityScore: this.getCommunityScore(userAddress) // 0-20 points
        };
        
        return Math.min(100, Object.values(factors).reduce((a, b) => a + b, 0));
    }
    
    async updateReputationAfterVote(voterAddress, tokenHash, votedCorrectly) {
        if (votedCorrectly) {
            await this.increaseReputation(voterAddress, 1);
        } else {
            await this.decreaseReputation(voterAddress, 0.5);
        }
    }
}

Layer 3: User Self-Verification

Direct Verification Tools:

  • One-click YouTube access from token page
  • Verification checklist for users
  • Risk assessment calculator
  • Community comments and reviews

User Verification Checklist:

const VerificationChecklist = ({ youtubeUrl, tokenData }) => {
    const [checks, setChecks] = useState({
        urlAccess: false,
        channelMatch: false,
        verificationCode: false,
        contentQuality: false,
        uploadDate: false
    });
    
    return (
        <div className="verification-checklist">
            <h3>πŸ” Verify This Token Yourself</h3>
            <a href={youtubeUrl} target="_blank" className="youtube-link">
                🎬 Open YouTube Video
            </a>
            
            <div className="checklist">
                <CheckItem 
                    label="Video loads and plays correctly"
                    checked={checks.urlAccess}
                    onChange={(checked) => updateCheck('urlAccess', checked)}
                />
                <CheckItem 
                    label="Channel name matches claimed artist"
                    checked={checks.channelMatch}
                    onChange={(checked) => updateCheck('channelMatch', checked)}
                />
                <CheckItem 
                    label="Verification code found in description"
                    checked={checks.verificationCode}
                    onChange={(checked) => updateCheck('verificationCode', checked)}
                />
                <CheckItem 
                    label="High-quality music content"
                    checked={checks.contentQuality}
                    onChange={(checked) => updateCheck('contentQuality', checked)}
                />
                <CheckItem 
                    label="Upload date matches token creation"
                    checked={checks.uploadDate}
                    onChange={(checked) => updateCheck('uploadDate', checked)}
                />
            </div>
            
            <TrustScore checks={checks} tokenData={tokenData} />
        </div>
    );
};

Verification Data Transparency

All verification data is stored on-chain and publicly accessible:

function getVerificationDetails(bytes32 tokenHash) external view returns (
    bool backendChecked,
    bool backendApproved,
    string memory backendReason,
    uint256 daoApprovalVotes,
    uint256 daoRejectVotes,
    uint256 qualityScore,
    uint256 totalVotes
) {
    VideoToken storage token = tokens[tokenHash];
    return (
        token.backendChecked,
        token.backendApproved,
        token.backendReason,
        token.daoApprovalVotes,
        token.daoRejectVotes,
        token.qualityScore,
        token.daoApprovalVotes + token.daoRejectVotes
    );
}

πŸ’° Token Economics

Token Types

1. Music Content Tokens (MCT)

  • Standard: ERC-20 fungible tokens representing fractional ownership
  • Supply: Fixed supply set by creator (typically 1M - 100M tokens)
  • Utility: Revenue sharing, governance rights, exclusive access
  • Trading: Enabled after verification approval

2. Creator NFTs (CNT)

  • Standard: ERC-721 unique tokens for special content
  • Supply: Limited edition (1-1000 pieces)
  • Utility: Exclusive perks, meet & greets, early access
  • Trading: Marketplace integration

Pricing Mechanism

Initial Price Discovery

class PricingEngine {
    calculateInitialPrice(tokenData) {
        const factors = {
            channelSubscribers: this.getSubscriberMultiplier(tokenData.channelSubs),
            videoViews: this.getViewsMultiplier(tokenData.views),
            verificationScore: this.getVerificationMultiplier(tokenData.verificationScore),
            qualityScore: this.getQualityMultiplier(tokenData.qualityScore),
            marketDemand: this.getMarketDemand(tokenData.category)
        };
        
        const basePrice = 0.001; // ETH
        const multiplier = Object.values(factors).reduce((a, b) => a * b, 1);
        
        return basePrice * multiplier;
    }
    
    getSubscriberMultiplier(subs) {
        if (subs > 10000000) return 5.0;      // 10M+ subscribers
        if (subs > 1000000) return 3.0;       // 1M+ subscribers
        if (subs > 100000) return 2.0;        // 100K+ subscribers
        if (subs > 10000) return 1.5;         // 10K+ subscribers
        return 1.0;                           // Less than 10K
    }
}

Dynamic Pricing

  • Bonding Curve: Price increases with demand
  • Verification Premium: Verified tokens trade at premium
  • Quality Bonus: High-quality scores increase value
  • Scarcity Factor: Limited supply drives price discovery

Revenue Distribution

contract RevenueDistribution {
    struct RevenueShare {
        address creator;
        uint256 creatorShare;    // 70% default
        uint256 platformShare;   // 20% default  
        uint256 communityShare;  // 10% default
    }
    
    function distributeRevenue(bytes32 tokenHash, uint256 amount) external {
        RevenueShare memory shares = revenueShares[tokenHash];
        
        // Creator revenue
        uint256 creatorAmount = (amount * shares.creatorShare) / 100;
        payable(shares.creator).transfer(creatorAmount);
        
        // Platform revenue
        uint256 platformAmount = (amount * shares.platformShare) / 100;
        payable(platformWallet).transfer(platformAmount);
        
        // Community treasury
        uint256 communityAmount = (amount * shares.communityShare) / 100;
        payable(communityTreasury).transfer(communityAmount);
        
        emit RevenueDistributed(tokenHash, amount, creatorAmount, platformAmount, communityAmount);
    }
}

πŸ›‘οΈ Security Model

Smart Contract Security

Access Control

contract AccessControl {
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
    bytes32 public constant VERIFIER_ROLE = keccak256("VERIFIER_ROLE");
    bytes32 public constant MODERATOR_ROLE = keccak256("MODERATOR_ROLE");
    
    modifier onlyRole(bytes32 role) {
        require(hasRole(role, msg.sender), "Access denied");
        _;
    }
    
    function grantRole(bytes32 role, address account) external onlyRole(ADMIN_ROLE) {
        _grantRole(role, account);
    }
}

Reentrancy Protection

import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

contract SecureTokenization is ReentrancyGuard {
    function purchaseTokens(bytes32 tokenHash, uint256 amount) 
        external 
        payable 
        nonReentrant 
    {
        // Safe token purchase logic
    }
}

Rate Limiting

contract RateLimiter {
    mapping(address => uint256) public lastActionTime;
    mapping(address => uint256) public actionCount;
    uint256 public constant RATE_LIMIT = 10; // 10 actions per hour
    
    modifier rateLimited() {
        require(
            block.timestamp >= lastActionTime[msg.sender] + 1 hours ||
            actionCount[msg.sender] < RATE_LIMIT,
            "Rate limit exceeded"
        );
        
        if (block.timestamp >= lastActionTime[msg.sender] + 1 hours) {
            actionCount[msg.sender] = 0;
        }
        
        actionCount[msg.sender]++;
        lastActionTime[msg.sender] = block.timestamp;
        _;
    }
}

Frontend Security

Signature Verification

class SecurityManager {
    async verifyBackendSignature(data, signature) {
        const message = this.createMessage(data);
        const recoveredAddress = ethers.utils.verifyMessage(message, signature);
        return recoveredAddress === this.backendSignerAddress;
    }
    
    async generateSecureNonce(userWallet) {
        const timestamp = Date.now();
        const random = crypto.getRandomValues(new Uint8Array(16));
        return keccak256(userWallet + timestamp + random);
    }
}

Input Validation

class InputValidator {
    validateYouTubeURL(url) {
        const patterns = [
            /^https:\/\/www\.youtube\.com\/watch\?v=[\w-]+/,
            /^https:\/\/youtu\.be\/[\w-]+/,
            /^https:\/\/youtube\.com\/watch\?v=[\w-]+/
        ];
        
        return patterns.some(pattern => pattern.test(url));
    }
    
    sanitizeInput(input) {
        return input
            .replace(/[<>]/g, '')
            .trim()
            .substring(0, 1000); // Max length limit
    }
}

Attack Prevention

Common Attack Vectors & Mitigations

  1. Duplicate Token Creation

    • Mitigation: Unique hash system (wallet + URL)
    • Check: require(tokens[hash].owner == address(0))
  2. Fake Verification

    • Mitigation: Cryptographic signatures from backend
    • Verification: Signature recovery and validation
  3. Vote Manipulation

    • Mitigation: Reputation-based voting weights
    • Detection: Anomaly detection in voting patterns
  4. Front-running

    • Mitigation: Commit-reveal voting scheme
    • Protection: Time delays for high-value transactions

πŸ‘€ User Experience

User Journey Flows

For Content Creators

  1. Wallet Connection

    // Connect wallet using MetaMask or WalletConnect
    const connectWallet = async () => {
        if (typeof window.ethereum !== 'undefined') {
            await window.ethereum.request({ method: 'eth_requestAccounts' });
            const provider = new ethers.providers.Web3Provider(window.ethereum);
            const signer = provider.getSigner();
            return await signer.getAddress();
        }
    };
  2. Content Upload

    • Paste YouTube URL
    • Set token parameters (supply, initial price)
    • Submit transaction to create token
    • Token created with verified: false status
  3. Verification Process

    • System generates unique verification code
    • Creator adds code to YouTube video description
    • Backend automatically detects and verifies
    • Token status updated to verified: true
  4. Community Engagement

    • Monitor DAO voting on content
    • Respond to community feedback
    • Participate in governance decisions

For Token Buyers/Investors

  1. Discovery

    const TokenDiscovery = () => {
        return (
            <div className="token-marketplace">
                <SearchFilters />
                <SortingOptions />
                <TokenGrid tokens={filteredTokens} />
            </div>
        );
    };
  2. Due Diligence

    • Review verification signals
    • Check YouTube video directly
    • Read community comments
    • Assess risk factors
  3. Purchase Decision

    • Connect wallet
    • Approve token spending
    • Execute purchase transaction
    • Receive tokens in wallet

User Interface Components

Token Card Component

const TokenCard = ({ tokenHash, tokenData }) => {
    const [expanded, setExpanded] = useState(false);
    
    return (
        <div className="token-card">
            {/* Header */}
            <div className="token-header">
                <img src={tokenData.thumbnail} alt="Video thumbnail" />
                <div className="token-info">
                    <h3>{tokenData.title}</h3>
                    <p>by {tokenData.artist}</p>
                    <span className="token-hash">{tokenHash.substring(0, 10)}...</span>
                </div>
            </div>
            
            {/* Verification Status */}
            <div className="verification-status">
                <VerificationBadge 
                    backendVerified={tokenData.backendApproved}
                    daoScore={tokenData.daoApprovalPercentage}
                    qualityScore={tokenData.qualityScore}
                />
            </div>
            
            {/* Trading Info */}
            <div className="trading-info">
                <span className="price">{tokenData.currentPrice} ETH</span>
                <span className="supply">{tokenData.availableSupply} available</span>
            </div>
            
            {/* Action Buttons */}
            <div className="token-actions">
                <button onClick={() => setExpanded(!expanded)}>
                    {expanded ? 'Less Info' : 'More Info'}
                </button>
                <button onClick={() => viewOnYouTube(tokenData.youtubeUrl)}>
                    View Video
                </button>
                <button onClick={() => purchaseToken(tokenHash)}>
                    Buy Tokens
                </button>
            </div>
            
            {/* Expanded Details */}
            {expanded && (
                <div className="expanded-details">
                    <VerificationDetails tokenHash={tokenHash} />
                    <CommunityVotes tokenHash={tokenHash} />
                    <TradingHistory tokenHash={tokenHash} />
                </div>
            )}
        </div>
    );
};

Verification Dashboard

const VerificationDashboard = ({ tokenHash }) => {
    return (
        <div className="verification-dashboard">
            <h3>πŸ” Verification Status</h3>
            
            {/* Automated Verification */}
            <div className="verification-section">
                <h4>πŸ€– Automated Verification</h4>
                <BackendVerificationStatus tokenHash={tokenHash} />
            </div>
            
            {/* Community Voting */}
            <div className="verification-section">
                <h4>πŸ—³οΈ Community Voting</h4>
                <DAOVotingInterface tokenHash={tokenHash} />
            </div>
            
            {/* User Verification */}
            <div className="verification-section">
                <h4>πŸ‘€ Self Verification</h4>
                <UserVerificationChecklist tokenHash={tokenHash} />
            </div>
            
            {/* Overall Trust Score */}
            <div className="trust-score">
                <TrustScoreCalculator tokenHash={tokenHash} />
            </div>
        </div>
    );
};

πŸ”Œ API Reference

REST API Endpoints

Authentication

// POST /api/auth/wallet
{
    "wallet": "0x742d35Cc6Cc1326Ab27b51Dc87085C4004B35dAa",
    "signature": "0x...",
    "message": "Sign this message to authenticate"
}

Token Management

// GET /api/tokens
// Query parameters: page, limit, verified, category, sortBy
{
    "tokens": [...],
    "pagination": {
        "page": 1,
        "limit": 20,
        "total": 150,
        "hasNext": true
    }
}

// GET /api/tokens/:tokenHash
{
    "tokenHash": "0xa7f3e9b1...",
    "youtubeUrl": "https://youtube.com/watch?v=...",
    "owner": "0x742d35Cc...",
    "verificationStatus": {...},
    "tradingData": {...}
}

// POST /api/tokens/create
{
    "youtubeUrl": "https://youtube.com/watch?v=...",
    "totalSupply": 1000000,
    "metadata": {...}
}

Verification

// GET /api/verification/:tokenHash
{
    "backendVerification": {
        "checked": true,
        "approved": true,
        "reason": "All checks passed",
        "timestamp": 1638360000
    },
    "daoVoting": {
        "totalVotes": 1250,
        "approvalVotes": 1100,
        "rejectionVotes": 150,
        "approvalPercentage": 88
    },
    "qualityMetrics": {...}
}

// POST /api/verification/vote
{
    "tokenHash": "0xa7f3e9b1...",
    "approved": true,
    "reason": "High quality content from verified artist",
    "signature": "0x..."
}

WebSocket API

Real-time Updates

// Connect to WebSocket
const ws = new WebSocket('wss://api.platform.com/ws');

// Subscribe to token updates
ws.send(JSON.stringify({
    "action": "subscribe",
    "type":

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.8%
  • Other 0.2%