# Withdraw rewards using HW wallet

Once your validator’s **withdraw authority** has been moved from a local keypair (`id.json`) to a **Ledger hardware wallet**, you can securely withdraw accumulated rewards directly from your vote account using your Ledger.

## Step 0 — Set Your Variables

You’ll use these across commands:

| Variable              | Description                         | Example                                 |
| --------------------- | ----------------------------------- | --------------------------------------- |
| `VOTE_ACCOUNT_PUBKEY` | Your validator vote account address | `vote.json`                             |
| `RPC`                 | Cluster endpoint                    | `https://rpc.testnet.x1.xyz`            |
| `LEDGER_PATH`         | Ledger device path                  | `usb://ledger?key=0/0`                  |
| `DESTINATION_PUBKEY`  | Wallet to receive rewards           | Usually the same as your Ledger address |

To get your Ledger’s public key (run on your **computer**, Solana app open):

```bash
solana-keygen pubkey "usb://ledger?key=0/0"
```

***

## Step 1 — Verify the vote account (on the **server**)

```bash
solana show-vote-account <VOTE_ACCOUNT_PUBKEY> --url <RPC>
```

* Confirm the **Withdraw Authority** matches your **Ledger** public key.
* Note the **Account Balance**; keep the account rent-exempt (don’t withdraw to zero).

***

## Step 2 — Connect your Ledger (on your **computer**)

1. Plug in Ledger, unlock, open **Solana** app (close Ledger Live).
2. Verify the CLI sees your device:

```bash
solana-keygen pubkey "usb://ledger?key=0/0"
```

You should see your Ledger address printed.

***

## Step 3 — Withdraw rewards (on your **computer**, Ledger signs)

Withdraw a specific amount (example: 5 XNT):

```bash
solana withdraw-from-vote-account \
  <VOTE_ACCOUNT_PUBKEY> \
  <DESTINATION_PUBKEY> \
  5 \
  --authorized-withdrawer "usb://ledger?key=0/0" \
  --url <RPC>
```

If your local default wallet has no funds for fees, make the **Ledger** pay the fee too:

```bash
solana withdraw-from-vote-account \
  <VOTE_ACCOUNT_PUBKEY> \
  <DESTINATION_PUBKEY> \
  5 \
  --authorized-withdrawer "usb://ledger?key=0/0" \
  --fee-payer "usb://ledger?key=0/0" \
  --url <RPC>
```

**Tips**

* Keep the vote account rent-exempt by leaving a buffer.
* If you hit “unfunded recipient”, first withdraw to your Ledger address, then transfer elsewhere.

***

## Step 4 — Verify the transfer (server **or** computer)

Check the vote account:

```bash
solana show-vote-account <VOTE_ACCOUNT_PUBKEY> --url <RPC>
```

Check the destination wallet:

```bash
solana balance <DESTINATION_PUBKEY> --url <RPC>
```

***

## Troubleshooting

| Issue                                | Likely Cause                              | Fix                                                                |
| ------------------------------------ | ----------------------------------------- | ------------------------------------------------------------------ |
| `no device found` / `protocol error` | Solana app not open or USB not recognized | Open Solana app, close Ledger Live, reconnect                      |
| `insufficient funds for fee`         | Fee-payer empty                           | Add `--fee-payer "usb://ledger?key=0/0"` or fund your local wallet |
| `signature verification failed`      | Wrong withdraw authority or wrong cluster | Re-check `show-vote-account` output and `--url`                    |
| `unfunded recipient`                 | Destination wallet never funded           | Withdraw to your Ledger address first, then forward                |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.x1.xyz/validating/secure-validator-with-hw-wallet/withdraw-rewards-using-hw-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
