Documentation Index
Fetch the complete documentation index at: https://docs.privacyboost.io/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started
This guide walks through the core integration flow: initialize the SDK, authenticate a wallet, and perform your first private transactions.For a minimal copy-paste example, see the TypeScript Quickstart. This guide explains each step in detail.
Prerequisites
- The SDK installed in your project
- An App ID and server URL (see Configuration)
- A wallet (MetaMask, WalletConnect, etc.)
- Familiarity with authentication options (optional for development, required for production)
Step 1: Initialize the SDK
Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
appId | string | Yes | Application identifier |
serverUrl | string | Yes | Privacy Boost server endpoint |
chainId | number | No | EVM chain ID (auto-discovered from server) |
shieldContractAddress | string | No | Shield contract address (auto-discovered from server) |
wethContractAddress | string | No | WETH contract for ETH handling |
Step 2: Authenticate
Connect a wallet and authenticate in a single call:Using Browser Wallet (MetaMask, etc.)
When does
credentialRequired fire?
credentialRequired only fires when persistence with pin or password unlock is configured. For the simple case (no persistence), authenticate() always returns authenticated directly.Using React? The React SDK provides
createWalletAdapter() and authenticateWithWalletAdapter() which handle this for you. See the React Getting Started guide.Authentication State
Step 3: Check Balance
Each token has two balances: a shielded balance (tokens inside the private pool, only visible to you) and a wallet balance (your public on-chain balance). Both are returned together in aTokenBalance object.
Step 4: Deposit Tokens
Move tokens from your public wallet into the shielded pool. Once deposited, your balance is private — only you can see it.Deposit Steps
The deposit operation goes through several steps:- wrapping - If depositing ETH, wrap to WETH
- approving - Approve token spending
- shielding - Execute the deposit transaction
- registering - Register the deposit with the indexer
- compliance - Wait for compliance check
Step 5: Send Private Transfer
Send tokens privately to another user’s privacy address. The recipient shares their privacy address with you (similar to sharing a bank account number). No on-chain observer can see the sender, recipient, or amount.For
send() and unshield(), the returned txHash is a local placeholder until the canonical on-chain hash is available. Track status by requestId (e.g. sdk.vault.getTransferStatus(requestId) / sdk.vault.getUnshieldStatus(requestId)). For shield(), txHash is the real on-chain hash because the wallet signs and submits it directly.Step 6: Withdraw Tokens
Move tokens out of the shielded pool to any public Ethereum address. This is how you “cash out” back to a regular wallet.Step 7: Multi-Chain (Optional)
To operate on additional blockchains, create chain clients from the same SDK instance. Each chain client shares your identity but has independent auth, balances, and transactions:What’s Next
You’ve completed the core flow: init → auth → balance → deposit → send → withdraw. Here’s where to go from here:Deposits
Deposit tokens into the shielded pool
Withdrawals
Withdraw tokens from the shielded pool
Private Transfers
Send tokens privately between users
Error Handling
Error codes and retry patterns
Multi-Chain
Operate across multiple blockchains
API Reference
Complete method signatures and type definitions