# Integrated addresses for exchanges

### Starting the daemon and the wallet application as RPC server

Unlike Bitcoin, CryptoNote family coins have different, more effective approach on how to handle user deposits.

An exchange generates only one address for receiving coins and all users send coins to that address. To distinguish different deposits from different users the exchange generates random identifier (called **payment ID**) for each one and a user attaches this payment ID to his transaction while sending. Upon receiving, the exchange can extract payment ID and thus identify the user.<br/>
In original CryptoNote there were two separate things: exchange deposit address (the same for all users) and payment ID (unique for all users). Later, for user convenience and to avoid missing payment ID we combined them together into one thing, called **integrated address**. So nowadays modern exchanges usually give to a user an integrated address for depositing instead of pair of standard deposit address and a payment ID.

### Creating an integrated address

```bash
# Generate with random payment ID
curl -X POST http://127.0.0.1:36944/json_rpc \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{}}'

# Generate with specific payment ID (8 bytes hex)
curl -X POST http://127.0.0.1:36944/json_rpc \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":"cafebabe12345678"}}'
```

**Response:**
```json
{
  "result": {
    "integrated_address": "iTHnNj4dWPHP1yy8xH2y5iQa...",
    "payment_id": "cafebabe12345678"
  }
}
```

Note: Standard addresses start with `iTHN` (uppercase N), integrated addresses start with `iTHn` (lowercase n).

### Splitting an integrated address

```bash
curl -X POST http://127.0.0.1:36944/json_rpc \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":"0","method":"split_integrated_address","params":{"integrated_address":"iTHnNj4dWPHP1yy8xH2y5iQa..."}}'
```

### Detecting deposits

Use `get_bulk_payments` to poll for incoming payments by payment ID:

```bash
curl -X POST http://127.0.0.1:36944/json_rpc \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":"0","method":"get_bulk_payments","params":{"payment_ids":["cafebabe12345678"],"min_block_height":10000}}'
```

For more details, see:
- [make_integrated_address](/docs/build/rpc-api/wallet-rpc-api/make_integrated_address)
- [split_integrated_address](/docs/build/rpc-api/wallet-rpc-api/split_integrated_address)
- [get_bulk_payments](/docs/build/rpc-api/wallet-rpc-api/get_bulk_payments)

> **Verified:** Integrated address generation tested on Lethean testnet. The `iTHn` prefix was confirmed for integrated addresses vs `iTHN` for standard addresses.
