PRIV ProtocolPRIV Docs
Dataxchange

Purchasing Data

How to find and purchase datasets on DataXchange.

Overview

DataXchange offers anonymized Web3 behavioral data for research, product development, and trading strategies.

Finding Data

Browse Marketplace

Visit app.priv.io/dataxchange to browse listings.

Filter Options

FilterDescription
CategoryDeFi, NFT, Governance, Gaming, Social
Price RangeMin/max PRIV
Data PointsMinimum dataset size
Time RangeData coverage period
Quality ScoreMinimum quality rating
ChainsFilter by blockchain

Search by keywords:

  • Protocol names (e.g., "uniswap", "aave")
  • Event types (e.g., "swap", "mint")
  • Token names (e.g., "ETH", "USDC")

Evaluating Listings

Listing Details

Each listing shows:

┌─────────────────────────────────────────────────┐
│  DeFi Trading Activity - January 2024          │
├─────────────────────────────────────────────────┤
│  Price: 100 PRIV (~$30 USD)                    │
│  Data Points: 75,000                           │
│  Time Range: Jan 1-31, 2024                    │
│  Category: defi_trading                        │
│  Quality Score: 95/100                         │
│  Purchases: 12 | Rating: 4.8/5                 │
├─────────────────────────────────────────────────┤
│  Description:                                   │
│  Comprehensive swap and LP data from major     │
│  DEXs on Base including Uniswap, Aerodrome...  │
├─────────────────────────────────────────────────┤
│  Events: swap, lp_add, lp_remove, stake        │
│  Protocols: uniswap, aerodrome, balancer       │
│  Chains: Base (8453)                           │
├─────────────────────────────────────────────────┤
│  [View Sample] [Purchase]                      │
└─────────────────────────────────────────────────┘

Sample Data

Always review the sample before purchasing:

{
  "sample": [
    {
      "timestamp": "2024-01-15T10:30:00Z",
      "event": "swap",
      "tokens": ["ETH", "USDC"],
      "amounts": ["1-2", "2000-3000"],
      "protocol": "uniswap",
      "user_hash": "anon_abc123"
    }
  ]
}

Quality Indicators

IndicatorGoodCaution
Quality Score80+Below 60
Completeness95%+Below 90%
Purchases5+ with reviews0 purchases
Rating4.0+Below 3.0
Seller HistoryEstablishedNew seller

Making a Purchase

Step 1: Ensure PRIV Balance

Check your wallet has enough PRIV:

const balance = await privToken.balanceOf(myAddress)
const price = listing.price

if (balance < price) {
  // Buy PRIV on Uniswap or other DEX
}

Step 2: Approve Spending

Approve the DataXchange contract to spend your PRIV:

await privToken.approve(dataXchangeAddress, price)

Step 3: Complete Purchase

Click "Purchase" and sign the transaction:

const accessKey = await dataXchange.purchase(listingId)

Step 4: Download Data

Use the access key to download:

curl "https://api.priv.io/v1/dataxchange/download/pur_abc123" \
  -H "Authorization: Bearer your_api_key" \
  -o dataset.json

Or via the dashboard:

  1. Go to "My Purchases"
  2. Click the listing
  3. Click "Download"

Programmatic Purchasing

Using the API

import { PRIVToken, DataXchange } from '@priv/contracts'

async function purchaseData(listingId: bigint) {
  // Get listing details
  const listing = await dataXchange.getListing(listingId)

  // Approve PRIV spend
  await privToken.approve(dataXchangeAddress, listing.price)

  // Purchase
  const tx = await dataXchange.purchase(listingId)
  const receipt = await tx.wait()

  // Get access key from event
  const event = receipt.logs.find(
    log => log.topics[0] === dataXchange.interface.getEventTopic('DataPurchased')
  )
  const { accessKey } = dataXchange.interface.decodeEventLog(
    'DataPurchased',
    event.data,
    event.topics
  )

  // Download data
  const response = await fetch(
    `https://api.priv.io/v1/dataxchange/download/${accessKey}`,
    {
      headers: { Authorization: `Bearer ${apiKey}` }
    }
  )

  return response.json()
}

Batch Purchases

Buy multiple datasets at once:

const listingIds = [1n, 2n, 3n]
const accessKeys = await dataXchange.purchaseBatch(listingIds)

Data Formats

Standard Format

All datasets follow a consistent schema:

interface DataPoint {
  timestamp: string     // ISO 8601
  event: string        // Event type
  user_hash: string    // Anonymized user
  properties: Record<string, unknown>
}

Category-Specific Fields

DeFi Trading:

{
  "timestamp": "2024-01-15T10:30:00Z",
  "event": "swap",
  "user_hash": "anon_abc123",
  "properties": {
    "token_in": "ETH",
    "token_out": "USDC",
    "amount_in_range": "1-2",
    "amount_out_range": "2000-3000",
    "protocol": "uniswap",
    "pool": "0x..."
  }
}

NFT Activity:

{
  "timestamp": "2024-01-15T10:30:00Z",
  "event": "sale",
  "user_hash": "anon_abc123",
  "properties": {
    "collection": "0x...",
    "token_id_range": "1000-2000",
    "price_range": "0.1-0.5",
    "currency": "ETH",
    "marketplace": "opensea"
  }
}

After Purchase

Data Storage

Store purchased data securely:

  • Encrypt at rest
  • Limit access to authorized users
  • Follow your organization's data policies

Usage Rights

When you purchase data:

  • You may use for any legal purpose
  • You may not attempt to de-anonymize
  • You may not resell raw data
  • Attribution to PRIV Protocol appreciated

Leaving Reviews

Help the community by reviewing purchases:

  1. Go to "My Purchases"
  2. Click "Leave Review"
  3. Rate 1-5 stars
  4. Add optional comment

Disputes

Opening a Dispute

If data doesn't match description:

Step 1: Document the Issue

Note specific problems:

  • Missing fields
  • Incorrect date range
  • Lower quality than claimed

Step 2: Open Dispute

  1. Go to "My Purchases"
  2. Click "Open Dispute"
  3. Select reason
  4. Provide evidence
  5. Submit

Step 3: Await Resolution

  • PRIV arbitrators review within 7 days
  • If valid, you receive a refund
  • If invalid, no action taken

Dispute Reasons

ReasonExample
Data mismatchListed 50k points, received 30k
Quality issues60% completeness, claimed 95%
Format problemsUnreadable or corrupted data
Missing eventsListed "swap" events not present

Disputes are resolved by community arbitrators who earn PRIV for fair judgments.

Best Practices

  1. Review samples: Always check before buying
  2. Start small: Test sellers with smaller purchases first
  3. Check reviews: Learn from other buyers' experiences
  4. Verify schemas: Ensure data format meets your needs
  5. Keep records: Document purchases for your own tracking

Next Steps