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

# Transfers

# Private Transfers

This guide covers sending tokens privately between privacy addresses using the Privacy Boost CLI.

## CLI Command

```bash theme={null}
privacy-boost send \
  --token 0x4200000000000000000000000000000000000006 \
  --amount 0.1 \
  --recipient 0x04...194-char-privacy-address \
  --human
```

Output:

```
Building proof... (this may take a moment)
Proof generated successfully
Transfer submitted!
Transaction: 0x9abc...def0
Amount: 0.1 ETH
Recipient: 0x04ab...ef01 (privacy address)
```

## Command Parameters

| Flag          | Required | Description                                       |
| ------------- | -------- | ------------------------------------------------- |
| `--token`     | Yes      | Token contract address                            |
| `--amount`    | Yes      | Amount to send                                    |
| `--recipient` | Yes      | Recipient's 194-character privacy address         |
| `--human`     | No       | Interpret amount as human-readable (default: wei) |

## Programmatic Usage (Rust)

```rust theme={null}
let result = sdk.send(
    "0x4200000000000000000000000000000000000006",
    "100000000000000000", // 0.1 tokens in wei
    "0x04...recipient-privacy-address",
)?;
println!("Transfer TX: {}", result.tx_hash);
println!("Fee: {}", result.fee);
```

### TransferResult

```rust theme={null}
pub struct TransferResult {
    pub tx_hash: String,
    pub fee: String,
}
```

## Privacy Address Validation

Validate the recipient address before sending:

```rust theme={null}
if !sdk.is_valid_privacy_address(recipient) {
    println!("Invalid privacy address");
    return;
}

let result = sdk.send(token_address, amount, recipient)?;
```

## Address Lookup

Look up a user's privacy address:

```rust theme={null}
let identity = sdk.resolve_identity("0x...wallet-address")?;
println!("Privacy address: {}", identity.privacy_address);

sdk.send(token_address, amount, &identity.privacy_address)?;
```

## Error Handling

```rust theme={null}
match sdk.send(token_address, amount, recipient_privacy_address) {
    Ok(result) => println!("Transfer TX: {}", result.tx_hash),
    Err(CliError::InsufficientBalance) => println!("Not enough shielded balance"),
    Err(CliError::InvalidAddress) => println!("Invalid privacy address"),
    Err(CliError::NotAuthenticated) => println!("Please login first"),
    Err(CliError::NetworkError { message }) => println!("Network error: {}", message),
    Err(e) => println!("Transfer failed: {:?}", e),
}
```

## Best Practices

### 1. Validate Addresses Before Sending

Always validate the privacy address before attempting a transfer.

### 2. Check Balance After Transfer

```bash theme={null}
privacy-boost send --token $TOKEN --amount 0.1 --recipient $PRIVACY_ADDR --human
privacy-boost balance --token $TOKEN
```

## Next Steps

* [Deposits Guide](./deposits)
* [Balances Guide](./balances)
* [Transactions Guide](./transactions)
* [Error Handling](./error-handling)
