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
| Component | Technology |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript |
| Styling | TailwindCSS |
| Web3 | viem, WalletConnect |
| Blockchain | Binance Smart Chain (BSC) |
| Smart Contracts | Solidity 0.8.20 |
| Storage | IPFS (via Pinata) |
| Encryption | CryptoJS (AES-CBC-256) |
| Database | Supabase (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
Node.js version 18 or higher
node --versionWeb3 Wallet - MetaMask or compatible
Download MetaMask →BSC Network configured in wallet
Mainnet: Chain ID 56 | Testnet: Chain ID 97
Pinata Account (for IPFS)
Sign up at Pinata →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 dev2. 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-key3. Available Scripts
npm run devStart development server
npm run buildBuild for production
npm startStart production server
npm run lintRun ESLint
How to Use
🛍️For Sellers
Connect Wallet
Click "Connect Wallet" button and select your wallet (MetaMask, etc.)
Navigate to Upload
Click "Start Selling" or go to /upload
Select File
Upload a file - preview will appear automatically for images
Fill Details
Enter title, description, and set your price in BNB
Upload & Create
Click "Encrypt & Create Listing" and wait for the process to complete
🛒For Buyers
Browse Marketplace
Visit the marketplace and browse available listings
View Details
Click "Details" to see preview, description, and file info
Purchase
Click "Purchase" and confirm transaction in your wallet
Download
After purchase, download and decrypt your file
API Reference
/api/listingsFetch all active listings from the database.
Request
GET /api/listings?active=true&limit=50Response
{
"success": true,
"data": [
{
"id": 1,
"seller": "0x123...",
"title": "My Listing",
"description": "Description",
"price": "0.1",
"ipfsHash": "Qm...",
"previewIpfsHash": "QmPreview...",
"active": true
}
],
"count": 1
}/api/listingsCreate 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