Documentation

The Protocol,
specified.

OPAQ is a programmable privacy layer for Solana, built on ZK-SNARK circuits. Everything below is spec, not marketing. If something is not audited or not deployed, it is labelled as such.

01

Overview

OPAQ is a programmable privacy protocol on Solana. It does not hide you. It lets you decide, in code, which parts of your on-chain life are visible, to whom, and for how long.

Four primitives ship at launch:

  • Privacy Score -- quantifies how trackable an arbitrary Solana wallet is.
  • MEV Exposure-- detects sandwich, frontrun and backrun losses across a wallet's history.
  • Private Transfer -- ZK-backed SOL/SPL transfer that hides amount and counterparty.
  • Programmable Disclosure -- policies that reveal data only to the parties a user names.
Private Transfer and Programmable Disclosure are behind the NEXT_PUBLIC_2_PRIVATE_TRANSFER flag and will go live after the MVP audit.
02

Architecture

The protocol separates three concerns: client surfaces (web/extension/bot), the OPAQ service (scoring, proofs, disclosure enforcement), and the Solana runtime (on-chain verifier and state). Nothing inside the service ever receives a private key. Clients talk to Solana through our RPC proxy so the Helius endpoint is never exposed to the browser.

ascii
                ┌──────────────────────────────┐
                │   Client surfaces            │
                │   web · extension · telebot  │
                └──────────────┬───────────────┘
                               │ HTTPS
                ┌──────────────▼───────────────┐
                │   OPAQ Service (FastAPI)     │
                │   · privacy-score engine     │
                │   · mev scanner              │
                │   · disclosure policy vm     │
                │   · RPC proxy (allowlist)    │
                │   · api-key / rate limit     │
                └──────────────┬───────────────┘
                               │ JSON-RPC
                ┌──────────────▼───────────────┐
                │   Solana (mainnet-beta)      │
                │   · opaq_core (Anchor)       │
                │   · verifier · pools · tree  │
                └──────────────────────────────┘
03

Privacy Score

Privacy Score grades a wallet from 0 to 100, where 0 is an open book and 100 is maximally covered. The score is a weighted sum of six independent signals computed over the wallet's last 100 transactions.

SignalWeightDetects
Transaction Diversity20Unique counterparties, unique programs
Amount Pattern20Repeated round amounts (fingerprinting)
Time Pattern15Regular schedules, timezone leaks
DEX Activity15Strategy exposure via swap frequency
Large Transfers15Whale-tier amounts that attract trackers
Address Clustering15Links to identified wallets / exchanges

Risk levels derived from the total: 0-20 critical, 21-40 high, 41-60 medium, 61-80 low, 81-100 minimal.

04

MEV Scan

MEV Scan reads every swap from the wallet's history, finds same-slot neighbour transactions, and classifies attacks into four buckets.

  • Sandwich-- a victim's trade is wrapped by a neighbour that trades the same pair before and after, with priority fees ≥ the victim's. Loss modelled at ~0.5% of input.
  • Frontrun -- a same-direction neighbour pays more fee and executes first. Loss modelled at ~0.3% of input.
  • Backrun -- an opposite-direction neighbour pays more and fires after. Loss modelled at ~0.2% of input.
  • Slippage-- no attacker visible, but realised USD out vs USD in ≥ 1.5%. Counted as extractive slippage.
Token prices come from a conservative internal map (SOL, USDC, USDT, BONK, JUP, WIF, PYTH with a $0.05 fallback for unknown tokens). Totals will never over-report from exotic tickers.
05

Private Transfer

Private Transfer spends a commitment from an OPAQ privacy pool and creates a new one for the recipient. A Groth16 proof attests that the input existed, that the output has the same total value, and that a unique nullifier has not been used before. Anchor verifies the proof on-chain and consumes the nullifier.

ts
import { OpaqClient } from "@opaq-labs/sdk";

const client = new OpaqClient({ endpoint: "https://opaq.fun/api/rpc" });

const result = await client.privateTransfer({
  from: await client.pool.commitmentForOwner(signer.publicKey),
  toCommitment: await client.pool.newCommitment(recipientCommitment),
  amount: 1_000_000_000n, // 1 SOL
  proof: await client.proofs.transfer(inputs),
});
Status: circuits written, audit scheduled. The page at /transfer will flip from Coming Soon to live once the audit completes.
06

Programmable Disclosure

Disclosure policies are small expressions compiled to a ZK circuit. A policy is stored on-chain with a commitment, and a prover can show that their private data satisfies the policy without revealing the underlying data.

ts
import { Disclosure } from "@opaq-labs/sdk";

const policy = Disclosure.policy({
  when: "tx.amount > 10_000 USDC",
  reveal: ["amount", "sender"],
  to: ["auditor.sol"],
  validFor: "90d",
});

await client.disclosure.register(policy);

A policy is a pure function. It has no side effects and cannot call external oracles at proof time. Anything an auditor or counterparty will see must be named in reveal; everything else stays encrypted.

07

Developer API

Three authenticated endpoints are exposed today. Get a key at opaq.fun/developers.

GET/api/v1/privacy-score/{wallet_address}

Full Privacy Score with per-signal breakdown and mitigation list.

GET/api/v1/mev-exposure/{wallet_address}

Per-swap MEV classification, total USD loss, top-10 worst attacks.

GET/api/v1/cluster-hint/{wallet_address}

Top-10 correlated counterparties and a normalised 0-1 correlation score.

bash
curl https://opaq.fun/api/v1/privacy-score/vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg \
  -H "X-API-Key: opq_..."
Free tier: 100 requests per hour. Builder and Protocol tiers scale with staked $OPAQ.
08

SDK

TypeScript SDK lives at github.com/opaq-labs/opaq. The SDK wraps the API, the on-chain program, and the ZK proof generation pipeline. Rust and Python bindings follow the same shape.

bash
git clone https://github.com/opaq-labs/opaq.git
cd opaq
npm install --prefix sdk
npm test --prefix sdk
09

Integrations

Any Solana dApp can call the API without running a circuit locally. Typical wiring:

  • DEX aggregators -- surface a Privacy Score badge next to routes involving known MEV-active pools.
  • Wallets -- warn before a send if the recipient has a high cluster score linked to the sender.
  • DAO treasuries -- gate large payouts behind a disclosure policy so auditors see what they are entitled to and nothing else.
  • Analytics dashboards -- annotate address rows with trackability grades pulled from the public API.
10

Security Model

  • OPAQ service never receives a private key. All signing is client-side.
  • The RPC proxy uses a server-side allowlist. Only read methods and standard transaction submission are forwarded.
  • ZK circuits are compiled with anchor-lang 0.30.1 and Groth16. Trusted setup ceremony artifacts are published with every release.
  • API keys are scoped to rate-limit buckets, not to endpoints. A key cannot elevate its own tier; tier is a function of staked $OPAQ.
  • Privacy pools enforce an anonymity-set minimum before withdrawal becomes available. Pools below the minimum remain locked.
11

FAQ

Is OPAQ a mixer?

No. Mixers break links by design. OPAQ lets a user choose which links to keep, and lets policies expose just enough to satisfy auditors or counterparties. Privacy with accountability, not privacy via obscurity.

Do I need to run a prover to use the protocol?

No. Clients can delegate proving to relayer nodes. Relayers see only what the circuit allows them to see; the private witness never leaves the user's device.

What happens if a relayer goes down?

Proving is pure. Any honest relayer produces the same proof for the same inputs. The relayer set is public and clients automatically fall over to alternates.

Does $OPAQ have privileged access to the protocol?

No. $OPAQ gates pricing, governance, and relayer staking. It does not grant read access; the read API is open to anyone who registers a key.

Is the code audited?

Public repo is under review by an independent firm; the audit report will publish as a PDF pinned to the GitHub release. Private Transfer and Disclosure are gated behind feature flags until the audit closes.

Last revision tracks the main branch of opaq-labs/opaq.