Skip to content

KillMonga130/compute-escrow

Repository files navigation

BeatCopyright - Blockchain Beat Marketplace

A decentralized marketplace for beats with blockchain-verified copyright protection. Buy, sell, and license beats with trustless ownership verification.

🎯 Project Overview

BeatCopyright solves a real-world problem in the music industry: copyright protection and transparent licensing for music producers and beat makers. Traditional platforms often lack transparency, have high fees, and don't provide immutable proof of ownership. This project brings Web3 principles to the music industry, giving producers control over their intellectual property.

Problem Statement

  • Music producers struggle to prove ownership and protect their beats from unauthorized use
  • Licensing transactions lack transparency and trust
  • Copyright disputes are expensive and time-consuming
  • Middlemen take significant cuts from creators' earnings

Our Solution

BeatCopyright is a Substrate-based blockchain marketplace that:

  • βœ… Provides immutable copyright proof on-chain using blockchain verification
  • βœ… Enables direct producer-to-buyer transactions without intermediaries
  • βœ… Implements dispute resolution with on-chain verification
  • βœ… Ensures transparent licensing with smart contract automation
  • βœ… Protects producer rights with blockchain-verified ownership

πŸ† Hackathon Theme

This project fits under "User-centric Apps" - prioritizing music producers' and buyers' interests with real-world impact using Polkadot's decentralized technology stack.

Web3 Principles Applied

  • Decentralization: No central authority controls the marketplace
  • User Ownership: Producers own their beats and copyright proofs on-chain
  • Transparency: All transactions and licenses are publicly verifiable
  • Trustless: Smart contracts handle payments and license transfers automatically
  • Fairness: Direct transactions eliminate middleman fees

πŸš€ Features

For Producers

  • List beats with metadata (title, genre, BPM, key)
  • Set pricing and license types (exclusive, non-exclusive, lease)
  • Generate blockchain-verified copyright proofs
  • Receive direct payments via smart contracts
  • Track all sales and earnings on-chain

For Buyers

  • Browse available beats in a transparent marketplace
  • Purchase licenses with instant blockchain verification
  • Verify copyright before purchasing
  • File disputes if copyright issues arise
  • Own licenses with on-chain proof

For Enforcers

  • Verify copyright claims
  • Resolve disputes through on-chain verification
  • Maintain marketplace integrity
  • Review and validate beat ownership

πŸ› οΈ Technologies Used

Frontend

  • React 18 - Modern UI framework
  • TypeScript - Type-safe development
  • Vite - Fast build tool and dev server
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - Beautiful component library
  • Polkadot.js API - Blockchain interaction
  • React Router - Client-side routing

Blockchain

  • Substrate - Blockchain framework
  • Polkadot SDK - Web3 infrastructure
  • Polkadot.js Extension - Wallet integration
  • WebSocket RPC - Real-time chain connection

Key Dependencies

{
  "@polkadot/api": "^16.5.2",
  "@polkadot/extension-dapp": "^0.62.4",
  "@polkadot/types": "^16.5.2",
  "react": "^18.3.1",
  "react-router-dom": "^6.30.1",
  "tailwindcss": "^3.4.17"
}

πŸ“‹ Prerequisites

Before you begin, ensure you have:

  • Node.js (v18 or higher) and npm installed
  • Polkadot.js Extension installed in your browser
  • A Substrate node running (or use testnet - see Configuration)

πŸš€ Setup and Installation

1. Clone the Repository

git clone <your-repo-url>
cd compute-escrow

2. Install Dependencies

npm install

3. Configure Environment

Create a .env file in the root directory:

# For testnet (default)
VITE_WS_ENDPOINT=wss://rococo-rpc.polkadot.io

# For local development
# VITE_WS_ENDPOINT=ws://127.0.0.1:9944

4. Start Development Server

npm run dev

The app will be available at http://localhost:8080

5. Connect Your Wallet

  1. Open the app in your browser
  2. Install Polkadot.js extension if not already installed
  3. Create or import an account in the extension
  4. Click "Connect Polkadot Wallet" in the app
  5. Authorize the connection when prompted

πŸ“– Usage Guide

Setting Up Your Account

  1. Install Polkadot.js Extension

    • Download from Chrome/Firefox store
    • Create a new account or import existing
    • Save your seed phrase securely!
  2. Get Test Tokens (for testnet)

    • Visit Polkadot Faucet for Rococo testnet
    • Request test tokens to your account

As a Producer

  1. Switch to "Producer" role in the navigation
  2. Click "List New Beat"
  3. Fill in beat details:
    • Title, description, genre
    • Price (in DOT or testnet tokens)
    • License type (exclusive/non-exclusive/lease)
    • Audio hash (IPFS hash of your beat file)
  4. Submit to blockchain
  5. Your beat is now listed and available for purchase!

As a Buyer

  1. Stay in "Buyer" role
  2. Browse available beats in the marketplace
  3. Click "Purchase License" on beats you want
  4. Approve the transaction in your wallet
  5. License is transferred to your account on-chain

As an Enforcer

  1. Switch to "Enforcer" role
  2. Review beats with "Disputed" status
  3. Verify copyright validity
  4. Click "Verify Valid" or "Reject" to resolve disputes

πŸ—οΈ Architecture

Frontend Architecture

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ BeatMarketplace/ # Main marketplace UI
β”‚   β”œβ”€β”€ Navigation/      # Top navigation bar
β”‚   β”œβ”€β”€ Hero/           # Landing page
β”‚   └── EventFeed/      # Real-time blockchain events
β”œβ”€β”€ hooks/
β”‚   └── useBlockchain/  # Blockchain interaction hook
β”œβ”€β”€ lib/
β”‚   └── blockchain.ts   # Polkadot.js API wrapper
└── types/
    └── blockchain.ts   # TypeScript type definitions

Blockchain Integration

The app connects to a Substrate-based blockchain with a custom pallet for beat copyright management:

  • Pallet Name: beatCopyright or audioMarketplace
  • Storage: On-chain beat registry, licenses, disputes
  • Events: BeatListed, LicensePurchased, DisputeFiled, CopyrightVerified
  • Transactions: listBeat, purchaseLicense, fileDispute, verifyCopyright

Smart Contract Functions

// List a beat
listBeat(title, description, genre, price, licenseType, audioHash, copyrightProof)

// Purchase license
purchaseLicense(beatId)

// File dispute
fileDispute(beatId, reason)

// Verify copyright
verifyCopyright(beatId, isValid)

πŸ”§ Development

Running Locally

# Development server with hot reload
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Connecting to Local Node

  1. Build and run your Substrate node (see SETUP_GUIDE.md)
  2. Update .env:
    VITE_WS_ENDPOINT=ws://127.0.0.1:9944
  3. Restart the dev server

Building the Substrate Node

See SETUP_GUIDE.md for detailed instructions on:

  • Installing Rust and Substrate
  • Building a custom node
  • Creating the beat copyright pallet
  • Deploying to testnet

πŸ§ͺ Testing

Manual Testing Checklist

  • Connect wallet successfully
  • List a beat as producer
  • Purchase license as buyer
  • File dispute on a beat
  • Verify copyright as enforcer
  • View real-time blockchain events
  • Switch between roles

πŸ“ Project Structure

compute-escrow/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”œβ”€β”€ lib/              # Utility functions
β”‚   β”œβ”€β”€ pages/            # Page components
β”‚   └── types/            # TypeScript types
β”œβ”€β”€ public/               # Static assets
β”œβ”€β”€ .env                  # Environment variables
β”œβ”€β”€ package.json          # Dependencies
β”œβ”€β”€ vite.config.ts        # Vite configuration
β”œβ”€β”€ tailwind.config.ts    # Tailwind CSS config
└── README.md             # This file

🌐 Deployment

Deploy Frontend

The frontend can be deployed to any static hosting service:

  • Vercel: vercel deploy
  • Netlify: Connect GitHub repo
  • GitHub Pages: Use npm run build and deploy dist/ folder

Deploy Blockchain

  1. Build your Substrate node: cargo build --release
  2. Deploy to Polkadot Cloud or your own infrastructure
  3. Update frontend .env with production WebSocket endpoint

🀝 Contributing

This is a hackathon project, but contributions are welcome! Areas for improvement:

  • IPFS integration for audio file storage
  • Audio preview functionality
  • Advanced search and filtering
  • Producer analytics dashboard
  • Mobile-responsive improvements

πŸ“„ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

  • Polkadot SDK - For the amazing blockchain framework
  • Substrate Developer Hub - For excellent documentation
  • Polkadot.js - For seamless Web3 integration
  • shadcn/ui - For beautiful UI components

πŸ”— Resources

πŸ“§ Contact

For questions or support, please open an issue in this repository.


Built with ❀️ for the Polkadot Hackathon

Bringing Web3 to the music industry, one beat at a time.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages