Skip to main content

Getting Started

This guide walks you through basic CLI usage for Privacy Boost operations.
For a minimal copy-paste example, see the CLI Quickstart. This guide explains each step in detail.

Prerequisites

Overview

The Privacy Boost CLI provides command-line access to all SDK functionality:
  • Wallet connection and key derivation
  • Authentication with the backend
  • Deposits, withdrawals, and transfers
  • Balance queries and transaction history

Quick Start

1. Configure Network

Set up your environment:
# Set environment variables
export INDEXER_URL="https://test-api.privacy-boost.sunnyside.io/indexer"
export RPC_URL="https://eth.llamarpc.com"
export WETH_CONTRACT="0x4200000000000000000000000000000000000006"
# Your private key (keep secure!)
export PRIVATE_KEY="0x..."

2. Login

Connect your wallet and authenticate with the Privacy Boost backend:
privacy-boost login --private-key $PRIVATE_KEY
Output:
Logged in!
  Wallet Address:  0x1234...5678
  Privacy Address: 0x9abc...def0
  MPK:             0xfedc...ba98

Session saved! Future commands won't require --private-key.

3. Check Balance

Query your shielded balance:
# Check specific token
privacy-boost balance --token 0x4200000000000000000000000000000000000006

# Check all balances
privacy-boost balances
Output:
Token: 0xC02a...Cc2 (WETH)
Shielded Balance: 1.5 ETH
Wallet Balance: 0.5 ETH

4. Deposit

Deposit tokens into the shielded pool:
privacy-boost deposit \
  --token 0x4200000000000000000000000000000000000006 \
  --amount 1.0 \
  --human
Output:
Deposit submitted!
Transaction: 0x1234...5678
Commitment: 0xabcd...ef01
Waiting for confirmation...
Deposit confirmed in block 12345678

5. Withdraw

Withdraw tokens from the shielded pool:
privacy-boost withdraw \
  --token 0x4200000000000000000000000000000000000006 \
  --amount 0.5 \
  --recipient 0x1234567890123456789012345678901234567890 \
  --human
Output:
Building proof... (this may take a moment)
Proof generated successfully
Withdraw submitted!
Transaction: 0x5678...9abc
Amount: 0.5 ETH
Recipient: 0x1234...7890

6. Send Private Transfer

Send tokens privately to another privacy address:
privacy-boost send \
  --token 0x4200000000000000000000000000000000000006 \
  --amount 0.1 \
  --recipient 0x[194-character-privacy-address] \
  --human
Output:
Building proof... (this may take a moment)
Proof generated successfully
Transfer submitted!
Transaction: 0x9abc...def0
Amount: 0.1 ETH
Recipient: 0x9abc...ef01 (privacy address)

Common Workflows

Check Status

View current connection and authentication status:
privacy-boost status
Output:
Status
------
Connected: Yes
Authenticated: Yes
Wallet Address: 0x1234...5678
Privacy Address: 0x9abc...def0
MPK: 0xfedc...ba98
Chain ID: 1
Session Expires: 2024-01-15 10:30:00 UTC

View Transaction History

# All transactions
privacy-boost history

# Filter by type
privacy-boost history --tx-type shield
privacy-boost history --tx-type unshield
privacy-boost history --tx-type transact

# Filter by token
privacy-boost history --token 0x4200000000000000000000000000000000000006

# Limit results
privacy-boost history --limit 10

List Sessions

privacy-boost sessions

Logout

privacy-boost logout

Working with Amounts

Amounts default to wei. Use --human for human-readable format:
# 1 ETH (human-readable)
privacy-boost deposit --token $TOKEN --amount 1.0 --human

# 0.5 ETH
privacy-boost deposit --token $TOKEN --amount 0.5 --human

# Small amounts
privacy-boost deposit --token $TOKEN --amount 0.001 --human
Or specify directly in wei (default):
privacy-boost deposit --token $TOKEN --amount 1000000000000000000

Error Handling

Common Errors

Not Authenticated
Error: Not authenticated. Run 'privacy-boost login' first.
Insufficient Balance
Error: Insufficient shielded balance. Have: 0.5 ETH, Need: 1.0 ETH
Network Error
Error: Failed to connect to indexer at https://test-api.privacy-boost.sunnyside.io/indexer
Check your network connection and INDEXER_URL configuration.

Next Steps

Deposits

Deposit tokens into the shielded pool

Withdrawals

Withdraw tokens from the shielded pool

Private Transfers

Send tokens privately between users

Balances

Query token balances

Transaction History

View and filter transaction history

Wallet Integration

Authentication and key management

Session Storage

Session persistence

Error Handling

Error codes and recovery patterns