Claiming Stake Pool Rewards
In the Cardano ecosystem, stake addresses store rewards that you earn for staking. Staking rewards and any new ADA in a wallet are automatically included in the staking balance for the account. You do not need to claim staking rewards. However, you may claim rewards that you earn for operating or delegating to a stake pool at any time.
Note | Cardano CLI commands throughout the How to Set Up a Cardano Stake Pool guide may use the |
To claim rewards that the stake pool you operate earns:
- Ensure that the stake address storing rewards to claim is Delegating to a Representative.
- Ensure that the destination payment address receiving staking rewards has a balance of at least ₳1 to pay the transaction fee.
Note

The transaction fee for claiming rewards is about 200,000 Lovelace.
- On the block-producing node in your stake pool configuration, using a terminal window type the following commands to save protocol parameters:
cd $NODE_HOME
cardano-cli conway query protocol-parameters \
--mainnet \
--out-file params.json - When the local copy of the Cardano blockchain ledger is fully synchronized, type the following command using a terminal window to query the slot number of the current tip of the ledger:
currentSlot=$(cardano-cli conway query tip --mainnet | jq -r '.slot')
echo "Current Slot: ${currentSlot}" - To assign the amount of rewards to claim to a variable, type:
rewardBalance=$(cardano-cli conway query stake-address-info \
--address $(cat $NODE_HOME/stake.addr) \
--mainnet | jq -r ".[0].rewardAccountBalance")
echo Reward Balance: ${rewardBalance}Note

You must claim the full amount of staking rewards available. You cannot claim partial staking rewards.
- To assign the stake address and amount of rewards available to a variable using a format that the transaction requires, type:
withdrawalString="$(cat $NODE_HOME/stake.addr)+${rewardBalance}"
echo Withdrawal String: ${withdrawalString} - To retrieve the UTXOs available for the destination payment address and calculate the balance, type:
# Retrieve the list of UTXOs available for your payment address
utxo_json=$(cardano-cli conway query utxo --output-json \
--address $(cat $NODE_HOME/payment.addr) \
--mainnet)
# Initialize variables
tx_in=""
total_balance=0
# Loop through the list of UTXOs
while read -r utxo; do
# Retrieve the values for the current UTXO
values=$(jq -r --arg k "${utxo}" '.[$k]' <<< "${utxo_json}")
# Retrieve datum associated with the UTXO
datum=$(jq -r '.datum' <<< "${values}")
# Retrieve the reference script associated with the UTXO
script=$(jq -r '.referenceScript' <<< "${values}")
# If limits on spending the UTXO may exist, then skip the UTXO
if [[ ${datum} == 'null' && ${script} == 'null' ]]
then
hash=${utxo%%#*}
idx=${utxo#*#}
utxo_balance=$(jq -r '.value.lovelace' <<< "${values}")
total_balance=$((${total_balance}+${utxo_balance}))
echo "TxHash: ${hash}#${idx}"
echo "UTXO Balance: ${utxo_balance} Lovelace"
tx_in="${tx_in} --tx-in ${hash}#${idx}"
fi
done <<< "$(jq -r 'keys[]' <<< "${utxo_json}")"
echo
echo "Total available balance: ${total_balance} Lovelace"
echo "Final --tx-in string:${tx_in}" - To build a draft transaction for calculating the transaction fee, type:
cardano-cli conway transaction build-raw \
${tx_in} \
--tx-out $(cat $NODE_HOME/payment.addr)+$(( ${total_balance} - 200000 + ${rewardBalance} )) \
--invalid-hereafter $(( ${currentSlot} + 10000 )) \
--fee 200000 \
--withdrawal ${withdrawalString} \
--out-file $NODE_HOME/tx.tmp - To calculate the fee for the transaction, type:
fee=$(cardano-cli conway transaction calculate-min-fee --output-json \
--tx-body-file $NODE_HOME/tx.tmp \
--witness-count 2 \
--byron-witness-count 0 \
--protocol-params-file $NODE_HOME/params.json | jq -r '.fee')
echo "Fee: ${fee}" - To calculate change from the transaction, type:
txOut=$(( ${total_balance} - ${fee} + ${rewardBalance} ))
echo Change: ${txOut} - To build the transaction, type:
cardano-cli conway transaction build-raw \
${tx_in} \
--tx-out $(cat $NODE_HOME/payment.addr)+${txOut} \
--invalid-hereafter $(( ${currentSlot} + 10000 )) \
--fee ${fee} \
--withdrawal ${withdrawalString} \
--out-file $NODE_HOME/tx.raw - Copy the
tx.rawfile that you created in step 11 to the$NODE_HOMEfolder on your air-gapped, offline computer, and then using a terminal window type the following commands to sign the transaction:cd $NODE_HOME
cardano-cli conway transaction sign \
--tx-body-file tx.raw \
--signing-key-file payment.skey \
--signing-key-file stake.skey \
--mainnet \
--out-file tx.signed - Copy the
tx.signedfile that you created in step 12 to the$NODE_HOMEfolder on the block-producing node, and then using a terminal window type the following command to submit the transaction to the network:cardano-cli conway transaction submit \
--tx-file $NODE_HOME/tx.signed \
--mainnet - To verify that staking rewards are claimed successfully, type the following command to display the list of Unspent Transaction Output (UTXOs) available for the payment address receiving staking rewards in the transaction, and then find the UTXO that the transaction output:
cardano-cli conway query utxo --output-json \
--address $(cat $NODE_HOME/payment.addr) \
--mainnet