PRIV ProtocolPRIV Docs
Mobile App

VPN Functionality

How the PRIV mobile VPN works, data collected while connected, privacy protections, and earnings calculation.

VPN Functionality

The PRIV mobile app includes a full-featured VPN built on the WireGuard protocol. Learn how it protects your privacy while enabling you to earn.


How the VPN Works

WireGuard Protocol

PRIV uses the WireGuard VPN protocol, known for:

  • Speed - Minimal overhead, fast connections
  • Security - Modern cryptography (ChaCha20, Curve25519)
  • Simplicity - ~4,000 lines of code vs 100,000+ for OpenVPN
  • Audited - Formally verified cryptographic implementations

Connection Flow

1. App generates WireGuard key pair (on first use)
2. Public key sent to PRIV server
3. Server returns configuration (endpoint, allowed IPs)
4. Native VPN module establishes tunnel
5. All traffic routed through encrypted tunnel
6. Session tracking begins for earnings

Technical Details

interface VpnConfig {
  // Client private key (generated locally, never leaves device)
  privateKey: string
  // Client IP assigned by server
  address: string
  // DNS servers (PRIV-operated, no logging)
  dns: string
  // Server's public key
  peerPublicKey: string
  // Server endpoint (host:port)
  peerEndpoint: string
  // Traffic routing (0.0.0.0/0 for full tunnel)
  allowedIPs: string
  // Keep connection alive
  persistentKeepalive: 25
}

Server Network

Global Coverage

PRIV operates VPN servers in multiple regions:

RegionLocationsFeatures
North AmericaUS (East, West, Central), CanadaLow latency
EuropeUK, Germany, Netherlands, FranceGDPR compliant
Asia PacificJapan, Singapore, AustraliaRegional content
South AmericaBrazilEmerging market

Server Selection

Automatic Mode (Default)

The app automatically selects the best server based on:

  • Ping latency to each server
  • Current server load
  • Your geographic location

Manual Mode

Select a specific server when you need:

  • Access to region-specific content
  • Consistent IP address
  • Lower load servers

Server Information

Each server displays:

interface ServerInfo {
  id: string         // Unique identifier
  name: string       // Display name
  country: string    // ISO country code
  city: string       // City location
  load: number       // Current load (0-100%)
  latency: number    // Measured ping (ms)
  features: string[] // ['streaming', 'p2p', etc.]
  isPremium: boolean // Premium tier only
  isAvailable: boolean
}

Data Collected While Connected

What We Collect

When you use the PRIV VPN, we collect minimal metadata for:

  1. Earnings calculation
  2. Service quality monitoring
  3. Aggregate analytics (anonymized)
DataPurposeRetained
Session durationEarnings calculation90 days
Bytes transferredEarnings calculation90 days
Server usedLoad balancing30 days
Connection timesService quality30 days
Error eventsDebugging7 days

What We Never Collect

The VPN is designed with privacy first. We structurally cannot access your traffic.

We do NOT collect:

  • Browsing history or URLs visited
  • DNS queries
  • Traffic content or payloads
  • IP addresses of sites you visit
  • Personal communications
  • Login credentials
  • Financial transactions

Zero-Knowledge Architecture

Our servers are configured to:

  • Not log traffic data
  • Not store connection logs beyond session
  • Not correlate users to destinations
  • Not share data with third parties

Privacy Protections

Encryption

All traffic is encrypted with:

  • ChaCha20 - Stream cipher for data
  • Poly1305 - Message authentication
  • Curve25519 - Key exchange
  • BLAKE2s - Hashing

This is the same encryption used by leading security tools and recommended by cryptographers.

DNS Privacy

When connected, DNS queries go through:

  • PRIV-operated DNS servers
  • Encrypted DNS (DoH/DoT)
  • No query logging

This prevents:

  • ISP DNS snooping
  • DNS-based tracking
  • DNS hijacking attacks

IP Protection

Your real IP address is:

  • Hidden from websites you visit
  • Not logged on our servers
  • Replaced with shared VPN exit IP

Leak Protection

The app includes:

  • IPv6 leak protection - Blocks IPv6 to prevent leaks
  • DNS leak protection - Forces DNS through tunnel
  • WebRTC protection - Prevents WebRTC IP leaks (browser)

Starting and Stopping Sessions

Connecting

  1. Open the VPN tab
  2. Tap the large shield button
  3. Approve VPN permission (first time only)
  4. Wait for "Connected" status
  5. Session tracking begins automatically

Connection States

type ConnectionStatus =
  | 'disconnected'  // Not connected
  | 'connecting'    // Establishing tunnel
  | 'connected'     // Fully protected
  | 'disconnecting' // Closing tunnel
  | 'error'         // Connection failed

Visual feedback:

  • Gray shield - Disconnected
  • Yellow pulse - Connecting
  • Green glow - Connected
  • Red alert - Error

Disconnecting

  1. Tap the shield button while connected
  2. Connection closes gracefully
  3. Final session data recorded
  4. Earnings credited to your account

Background Behavior

When the app is backgrounded:

  • VPN remains connected
  • Session continues earning
  • Notifications show connection status
  • iOS may disconnect after extended background time

On iOS, if you force-quit the app, the VPN will disconnect. Use the disconnect button instead.


Earnings Calculation

How VPN Earnings Work

You earn PRIV tokens based on:

Session Earnings = (Hours * Hourly Rate) + (MB * Data Rate)
                   * Regional Multiplier
                   * Peak Hours Multiplier

Current Rates

ComponentRate
Base hourly rate~0.05 PRIV/hour
Data transfer rate~0.001 PRIV/MB
Peak hours bonus1.5x (varies by region)
Underserved region bonusUp to 2x

Earnings Example

Session: 2 hours, 500 MB transferred, US East, peak hours

Base:     2 hours * 0.05 = 0.10 PRIV
Data:     500 MB * 0.001 = 0.50 PRIV
Subtotal: 0.60 PRIV
Peak:     0.60 * 1.5 = 0.90 PRIV

Session Earnings: 0.90 PRIV

Earnings Limits

To ensure fair distribution:

  • Daily cap: 10 PRIV per day per account
  • Minimum session: 5 minutes to earn
  • Maximum rate: Adjusted based on network demand

Real-Time Display

While connected, the app shows:

  • Estimated current session earnings
  • Progress toward hourly milestone
  • Live updating balance

Session Management

Session Lifecycle

1. CONNECT
   - Create session on server
   - Get session ID
   - Start local tracking

2. HEARTBEAT (every 60 seconds)
   - Send bytes transferred
   - Update session on server
   - Receive earnings update

3. DISCONNECT
   - Send final stats
   - Session marked complete
   - Earnings finalized

Session Data Structure

interface VpnSession {
  sessionId: string       // Unique identifier
  startedAt: Date        // Connection time
  endedAt?: Date         // Disconnection time
  bytesTransferred: number
  earnings: number       // PRIV earned
  serverId: string       // Server used
  status: 'active' | 'ended' | 'error'
  deviceType: string     // 'ios' | 'android'
}

Handling Disconnections

If connection drops unexpectedly:

  1. App detects disconnection
  2. Session paused on server
  3. Auto-reconnect attempted (3 times)
  4. If reconnect fails, session ends
  5. Earnings for completed time credited

Troubleshooting

Connection Issues

"Connection Failed"

1. Check internet connectivity
2. Try a different server
3. Disable any other VPN apps
4. Restart the app
5. Check VPN permissions in settings

"Server Unreachable"

1. Server may be under maintenance
2. Select a different server
3. Try the "Auto" server option
4. Check if your network blocks VPN ports

"Authentication Failed"

1. Sign out and sign back in
2. Check your account status
3. Reinstall the app if persists

Performance Issues

Slow Speeds

  • Try a server closer to your location
  • Check if server load is high
  • Ensure you have good signal strength
  • Some networks throttle VPN traffic

High Battery Usage

  • Normal: VPN uses some battery
  • If excessive, check for app updates
  • Reduce keepalive frequency in settings

Session Not Recording

If earnings are not showing:

1. Ensure you're signed in
2. Check internet connectivity
3. Wait 5 minutes for sync
4. Pull to refresh earnings screen
5. Contact support if persists

Best Practices

Maximize Earnings

  1. Stay connected longer - Hourly rate compounds
  2. Connect during peak hours - Bonus multipliers
  3. Use data while connected - Data transfer bonuses
  4. Keep app updated - Latest earning rates

Maximize Security

  1. Always use VPN on public WiFi
  2. Enable auto-connect for untrusted networks
  3. Don't share your account credentials
  4. Keep your device OS updated

Battery Optimization

  1. Use WiFi when possible - Less battery than cellular
  2. Close unused apps - Reduce background data
  3. Choose nearby servers - Lower latency = less overhead

Next Steps