Retiring Your Stake Pool

If you no longer want to operate your stake pool, then you can deregister the pool. Deregistering the pool retires the pool.

To retire your stake pool, your stake pool does NOT require valid KES keys. However, you must ensure that your nodes are fully synchronized with the blockchain.

To retire your stake pool:

First, generate the protocol-parameters.

cardano-cli query protocol-parameters \
    --mainnet \
    --out-file $NODE_HOME/params.json

Calculate the current epoch.

startTimeGenesis=$(cat $NODE_HOME/shelley-genesis.json | jq -r .systemStart)
startTimeSec=$(date --date=${startTimeGenesis} +%s)
currentTimeSec=$(date -u +%s)
epochLength=$(cat $NODE_HOME/shelley-genesis.json | jq -r .epochLength)
epoch=$(( (${currentTimeSec}-${startTimeSec}) / ${epochLength} ))
echo current epoch: ${epoch}

Find the earliest and latest retirement epoch that your pool can retire.

poolRetireMaxEpoch=$(cat $NODE_HOME/params.json | jq -r '.poolRetireMaxEpoch')
echo poolRetireMaxEpoch: ${poolRetireMaxEpoch}

minRetirementEpoch=$(( ${epoch} + 1 ))
maxRetirementEpoch=$(( ${epoch} + ${poolRetireMaxEpoch} ))

echo earliest epoch for retirement is: ${minRetirementEpoch}
echo latest epoch for retirement is: ${maxRetirementEpoch}

🚧 Example: if we are in epoch 39 and poolRetireMaxEpoch is 18,

  • the earliest epoch for retirement is 40 ( current epoch + 1).

  • the latest epoch for retirement is 57 ( poolRetireMaxEpoch + current epoch).

Let's presume that you want to retire as soon as possible, in epoch 40.

Create the deregistration certificate and save it as pool.dereg. Update the epoch to your desired retirement epoch, usually the earliest epoch or asap.

Copy pool.dereg to your hot environment.

Find your balance and UTXOs.

Find the tip of the blockchain to set the invalid-here after parameter properly.

Run the build-raw transaction command.

Calculate the minimum fee:

Calculate your change output.

Build the transaction.

Copy tx.raw to your cold environment.

Sign the transaction.

Copy tx.signed to your hot environment.

Send the transaction.

After the retirement epoch, you can verify that the pool was successfully retired with the following query which should return an empty result.

In two epochs, after retirement completes:

  1. Verify that your pool is retired using a block explorer such as cardanoscan.io

  2. Your pool deposit of 500 ADA is returned to your stake address (stake.addr) as a reward.

  3. Claim your stake pool rewards.

  4. As needed, send funds to another wallet.

  5. Optionally, de-register the stake key to re-claim your 2 ADA stake deposit.

References