Documentation

Complete guide to using Privexa Mind Privacy - from setup to deployment

Introduction

Privexa Mind Privacy is a decentralized marketplace for buying and selling encrypted digital files with privacy-preserving technology built on Binance Smart Chain (BSC).

Core Value Proposition

Private Trade, Verifiable Trust

  • Files are encrypted client-side before upload
  • Only buyers who purchase can decrypt the content
  • All transactions are verifiable on-chain
  • Preview images visible to all users in marketplace

Tech Stack

ComponentTechnology
FrontendNext.js 15, React 19, TypeScript
StylingTailwindCSS
Web3viem, WalletConnect
BlockchainBinance Smart Chain (BSC)
Smart ContractsSolidity 0.8.20
StorageIPFS (via Pinata)
EncryptionCryptoJS (AES-CBC-256)
DatabaseSupabase (PostgreSQL)

Features

🔐

End-to-End Encryption

Files encrypted locally using AES-256-CBC before leaving user's device. Encryption keys only shared upon successful purchase.

🖼️

Image Preview System

Automatic thumbnail generation for image files. Preview uploaded to IPFS and visible to all users in marketplace.

📦

Decentralized Storage

Encrypted files stored on IPFS via Pinata. Resilient, censorship-resistant delivery with content-addressed storage.

Instant BSC Payments

Payments settle on Binance Smart Chain in seconds with low gas fees and automatic fee distribution.

Verifiable Transactions

All purchases recorded on-chain with auditable transaction history. Smart contract ensures trustless exchange.

💾

Persistent Database

Metadata stored in Supabase. Titles, descriptions, and previews visible to all with cross-device synchronization.

Getting Started

Prerequisites

1.

Node.js version 18 or higher

node --version
2.

Web3 Wallet - MetaMask or compatible

Download MetaMask →
3.

BSC Network configured in wallet

Mainnet: Chain ID 56 | Testnet: Chain ID 97

4.

Pinata Account (for IPFS)

Sign up at Pinata →
5.

Supabase Account (recommended)

Sign up at Supabase →

Installation

1. Clone the Repository

# Clone repository
git clone <repository-url>
cd privexa-mind-privacy

# Install dependencies
npm install

# Run development server
npm run dev

2. Configure Environment

Copy and edit the environment file:

# DATABASE (Supabase)
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

# SMART CONTRACT
NEXT_PUBLIC_MARKETPLACE_ADDRESS=0x1234567890abcdef...

# IPFS / PINATA
NEXT_PUBLIC_IPFS_PROJECT_ID=your-pinata-project-id
NEXT_PUBLIC_IPFS_PROJECT_SECRET=your-pinata-secret-key

3. Available Scripts

npm run dev

Start development server

npm run build

Build for production

npm start

Start production server

npm run lint

Run ESLint

How to Use

🛍️For Sellers

1

Connect Wallet

Click "Connect Wallet" button and select your wallet (MetaMask, etc.)

2

Navigate to Upload

Click "Start Selling" or go to /upload

3

Select File

Upload a file - preview will appear automatically for images

4

Fill Details

Enter title, description, and set your price in BNB

5

Upload & Create

Click "Encrypt & Create Listing" and wait for the process to complete

🛒For Buyers

1

Browse Marketplace

Visit the marketplace and browse available listings

2

View Details

Click "Details" to see preview, description, and file info

3

Purchase

Click "Purchase" and confirm transaction in your wallet

4

Download

After purchase, download and decrypt your file

API Reference

GET/api/listings

Fetch all active listings from the database.

Request

GET /api/listings?active=true&limit=50

Response

{
  "success": true,
  "data": [
    {
      "id": 1,
      "seller": "0x123...",
      "title": "My Listing",
      "description": "Description",
      "price": "0.1",
      "ipfsHash": "Qm...",
      "previewIpfsHash": "QmPreview...",
      "active": true
    }
  ],
  "count": 1
}
POST/api/listings

Create a new listing in the database.

Request Body

{
  "sellerAddress": "0x123...",
  "title": "My Listing",
  "description": "Description",
  "priceEth": "0.1",
  "priceWei": "100000000000000000",
  "ipfsHash": "Qm...",
  "previewIpfsHash": "QmPreview...",
  "encryptionMetadata": "{...}",
  "fileName": "file.jpg",
  "fileType": "image/jpeg",
  "fileSize": 1234567
}

Troubleshooting

❌ "Contract address not configured"

Deploy smart contract and update NEXT_PUBLIC_MARKETPLACE_ADDRESS in .env.local

❌ "Failed to upload to IPFS"

Check Pinata API keys are correct and account has upload permissions

❌ "Preview not showing"

Ensure database is configured (Supabase) and previewIpfsHash is saved

❌ "Wallet not connecting"

Install MetaMask, add BSC network, and clear browser cache

Additional Resources