# How to Withdraw Validator Commission

This guide explains how to withdraw your validator commission on BounceBit. Execute the following script on your validator machine, assuming your data directory is /data/bouncebit.

#### **Prerequisites:**

* bbcored is installed (assumed location: /usr/local/bin/bbcored).
* You have access to your validator's keyring.

Withdrawal Script:

```bash
#!/bin/bash

bbc="/usr/local/bin/bbcored --home=/data/bouncebit"

moniker=$($bbc status | jq -r '.NodeInfo.moniker' | sed 's/\n//')

opaddr=$($bbc query staking validators --output json | jq -r ".validators[] | select(.description.moniker == \"$moniker\") | .operator_address")

keys=$($bbc keys list --output json)

oper=$(echo "$keys"|jq -r '.[0].name')

rwaddr=$(echo "$keys"|jq -r '.[0].address')

cmd="bbc tx distribution withdraw-rewards $opaddr --from $oper --fees 2000000000000000bit --commission --yes --output json|jq"

echo "Moniker: $moniker"
echo "Operator Address: $opaddr"
echo "Reward Address: $rwaddr"
echo "Key Name: $oper"
echo "Command to execute: $cmd"
eval "$cmd"
```

#### Key Points:

* **Execution**: Run this script on your validator server.
* **Keyring**: You will be prompted for your keyring password twice during execution.
* **Reward Address**: Rewards will be sent to your validator's operator address ($opaddr).
* **Key** **Selection**: The script uses the first key in your keyring. Ensure this is the correct key.
* **Commission** **Flag**: The --commission flag is essential for withdrawing validator commission.

Please execute this script to withdraw your commission. Contact us if you have any questions.

<br>


---

# 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.bouncebit.io/developer-resources/how-to-withdraw-validator-commission.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.
