Dash Labs Documentation
Privacy-first Solana toolkit for shielded transfers, zk receipts, and confidential computation.
# Introduction
Private by default • Verifiable by design
Dash Labs integrates zero-knowledge proofs to enable confidential value transfer and private computation—without sacrificing Solana-grade speed. This documentation covers the core concepts, the JavaScript SDK, and HTTP API examples.
What you get
- Shielded transfers and encrypted balances
- Client-side proof generation
- On-chain verification programs
- Optional zk receipts for audits
Who it’s for
- Wallets & swap UIs needing private mode
- DeFi apps with confidential logic
- Teams needing verifiable receipts
# Quickstart
Prerequisites
- Node 18+ and a Solana-compatible wallet (e.g., Phantom)
- RPC endpoint (public or provider of your choice)
Install
npm install @dashlabs/sdk
# or
pnpm add @dashlabs/sdk
# or
yarn add @dashlabs/sdk
Initialize
import { DashLabsSDK } from "@dashlabs/sdk";
const sdk = new DashLabsSDK({
cluster: "mainnet-beta", // or "testnet", "devnet"
endpoint: "https://your-rpc.example",// your RPC endpoint
programId: "DLabs1111111111111111111111111111111111", // placeholder
});
Connect wallet
await sdk.wallet.connect(); // opens Phantom/adapter
console.log("Wallet:", sdk.wallet.publicKey?.toBase58());
Send a shielded transfer
// 1) Prove off-chain
const proof = await sdk.prover.proveTransfer({
amount: "1.25", // SOL or token units
to: "recipient_public_key",
});
// 2) Verify & submit on-chain
const sig = await sdk.tx.sendShielded({ proof });
console.log("Submitted:", sig);
// 3) Optional: generate a zk receipt for audit/claims
const receipt = await sdk.receipts.create({ proof, signature: sig });
console.log("zkReceipt:", receipt);
# Core Concepts
Privacy Model
Identity, amount, and counterparties remain hidden. The chain stores only proof-verified state updates. Auditors verify correctness via zk receipts without seeing raw data.
Shielded Pools
Encrypted balances live in shielded pools. Transfers are modeled as nullifier/commitment updates proven valid by the client and verified on-chain.
zk Receipts
Receipts are optional attestations that confirm validity or ownership without revealing sensitive details. Ideal for refunds, disputes, and enterprise compliance.
# SDK (JavaScript)
Constructor Options
type DashLabsOptions = {
cluster: "devnet" | "testnet" | "mainnet-beta";
endpoint: string; // Solana RPC
programId: string; // verifier program
prover?: { // optional overrides
wasm?: string; // custom WASM path
worker?: boolean; // use WebWorker
};
};
Wallet
await sdk.wallet.connect();
await sdk.wallet.disconnect();
const pk = sdk.wallet.publicKey?.toBase58();
Prover
const proof = await sdk.prover.proveTransfer({
amount: "0.5",
to: "recipient_pubkey",
memo: "thanks!"
});
Transactions
const sig = await sdk.tx.sendShielded({ proof });
await sdk.tx.confirm(sig);
Receipts
const receipt = await sdk.receipts.create({ proof, signature: sig });
const ok = await sdk.receipts.verify(receipt);
# HTTP API
POST /api/prove
{ amount, to, memo? }{ proof }curl -X POST https://your-backend.example/api/prove \
-H "Content-Type: application/json" \
-d '{ "amount":"1.25", "to":"recipient_pubkey" }'
POST /api/verify
{ proof }{ ok: boolean }curl -X POST https://your-backend.example/api/verify \
-H "Content-Type: application/json" \
-d '{ "proof": "..." }'
POST /api/transfer
{ proof }{ signature }curl -X POST https://your-backend.example/api/transfer \
-H "Content-Type: application/json" \
-d '{ "proof": "..." }'
POST /api/receipt
{ proof, signature }{ receipt }curl -X POST https://your-backend.example/api/receipt \
-H "Content-Type: application/json" \
-d '{ "proof":"...", "signature":"..." }'
# Architecture
- Client Prover: Generates zk proofs locally (optional WASM worker)
- Verifier Program: On-chain verification and state update
- Shielded Pools: Encrypted balances and transfers
- Receipts: Optional proof of validity/ownership
# Security & Audits
We follow rigorous testing, formal verification where applicable, and third-party audits. Public reports and reproducible builds ship with major releases.
- Deterministic builds for prover and verifier
- Independent audits prior to mainnet releases
- Continuous fuzzing and invariants on circuits
# Glossary
- Shielded Transfer: A transfer whose details are hidden, verified by a zk proof.
- Nullifier: A marker proving a commitment is spent without revealing which.
- Commitment: Encrypted representation of value ownership.
- zk Receipt: A verifiable attest without exposing identities or amounts.
