> ## 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

# Getting Started

This guide walks you through basic CLI usage for Privacy Boost operations.

<Info>
  For a minimal copy-paste example, see the [CLI Quickstart](/sdk/quickstart/cli). This guide explains each step in detail.
</Info>

## Prerequisites

* The CLI [installed](/sdk/cli/installation)
* An [App ID](/sdk/concepts/app-setup) and server URL (see [Configuration](/sdk/concepts/configuration))
* A private key for the wallet you want to use

## 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:

```bash theme={null}
# Set environment variables
export SERVER_URL="https://optimism.sepolia.privacyboost.io"
export RPC_URL="https://sepolia.optimism.io"
export WETH_CONTRACT_ADDRESS="0x4200000000000000000000000000000000000006"
# Your private key (keep secure!)
export PRIVATE_KEY="0x..."
```

### 2. Login

Connect your wallet and authenticate with the Privacy Boost backend:

```bash theme={null}
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:

```bash theme={null}
# 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:

```bash theme={null}
privacy-boost shield \
  --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:

```bash theme={null}
privacy-boost unshield \
  --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:

```bash theme={null}
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:

```bash theme={null}
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
```

| Field             | Meaning                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------ |
| `Connected`       | A wallet has been connected to the SDK (private-key, mnemonic, or external).               |
| `Authenticated`   | A valid server session is active.                                                          |
| `Wallet Address`  | EOA controlling the funds.                                                                 |
| `Privacy Address` | The 194-character private receiving address that others use to send to you.                |
| `MPK`             | Master Public Key — a hex-encoded compressed public key derived from your wallet identity. |
| `Chain ID`        | EVM chain the SDK is currently scoped to.                                                  |
| `Session Expires` | When the current JWT becomes invalid. After expiry, run `privacy-boost login` again.       |

Pass `--output json` to receive the same fields as a structured object suitable for scripting.

### View Transaction History

```bash theme={null}
# 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

```bash theme={null}
privacy-boost sessions
```

### Logout

```bash theme={null}
privacy-boost logout
```

## Working with Amounts

Amounts default to wei. Use `--human` for human-readable format:

```bash theme={null}
# 1 ETH (human-readable)
privacy-boost shield --token $TOKEN --amount 1.0 --human

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

# Small amounts
privacy-boost shield --token $TOKEN --amount 0.001 --human
```

Or specify directly in wei (default):

```bash theme={null}
privacy-boost shield --token $TOKEN --amount 1000000000000000000
```

## Error Handling

### Common Errors

**Not Authenticated**

```bash theme={null}
Error: Not authenticated. Run 'privacy-boost login' first.
```

**Insufficient Balance**

```bash theme={null}
Error: Insufficient shielded balance. Have: 0.5 ETH, Need: 1.0 ETH
```

**Network Error**

```bash theme={null}
Error: Failed to connect to server at https://optimism.sepolia.privacyboost.io
Check your network connection and SERVER_URL configuration.
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Deposits" href="/sdk/cli/guides/deposits">
    Deposit tokens into the shielded pool
  </Card>

  <Card title="Withdrawals" href="/sdk/cli/guides/withdrawals">
    Withdraw tokens from the shielded pool
  </Card>

  <Card title="Private Transfers" href="/sdk/cli/guides/transfers">
    Send tokens privately between users
  </Card>

  <Card title="Balances" href="/sdk/cli/guides/balances">
    Query token balances
  </Card>

  <Card title="Transaction History" href="/sdk/cli/guides/transactions">
    View and filter transaction history
  </Card>

  <Card title="Wallet Integration" href="/sdk/cli/guides/wallet-integration">
    Authentication and key management
  </Card>

  <Card title="Session Storage" href="/sdk/cli/guides/session-storage">
    Session persistence
  </Card>

  <Card title="Error Handling" href="/sdk/cli/guides/error-handling">
    Error codes and recovery patterns
  </Card>
</CardGroup>
