Retiring a stake pool

Stake pools might cease to operate for a number of reasons. Any stake pools no longer in use should be retired, so they do not appear as an option for delegators.

If you need to retire a stake pool, you must first determine the epoch within which the pool will be retired, create a de-registration certificate, then attach this certificate to a transaction, and finally submit the transaction to the blockchain. The transaction needs to be signed with the operator’s cold key.

To retire a stake pool, follow these steps:

  1. Determine the epoch when the stake pool is to be retired, which must be after the current epoch, but no later than eMax epochs in the future (eMax is a protocol parameter).
  2. Use this code to identify the current epoch. The number of slots per epoch is recorded in the genesis file. In this example, the epoch lasts 21600 slots.
cat ff-genesis.json | grep epoch
\> "epochLength": 21600,
  1. Query the epoch's tip to determine the current slot:
export CARDANO_NODE_SOCKET_PATH=relay-db/node-socket
cardano-cli shelley query tip --testnet-magic 42
\> Tip (SlotNo {unSlotNo = 856232}) ...
expr 856232 / 21600

The current epoch is 39, which means that the earliest epoch to retire the pool in will be 40.

  1. Identify the value of eMax by querying the protocol parameters:
cardano-cli shelley query protocol-parameters \
\--testnet-magic 42 \
\--out-file params.json
cat params.json | grep eMax
\>"eMax": 100,

In this example, the eMax value is 100, which means that the latest epoch in which the pool can be retired is 139 (the current epoch -39-, plus eMax -100-).

  1. Create a de-registration certificate and save it as pool.dereg (or any other name.)
cardano-cli shelley stake-pool deregistration-certificate \
\--cold-verification-key-file node.vkey \
\--epoch 41 \
  1. Create a transaction that contains the de-registration certificate and calculates the fees:
cardano-cli shelley transaction calculate-min-fee \
\--tx-in-count 1 \
\--tx-out-count 1 \
\--ttl 860000 \
\--testnet-magic 42 \
\--signing-key-file pay.skey \
\--signing-key-file node.skey \
\--certificate pool.dereg \
\--protocol-params-file params.json
\> 171309
  1. Query the address that you want to use the pay the transaction fees from, calculate the UTXO to use as input, and calculate the change:
cardano-cli shelley query utxo \
\--address $(cat pay) \
\--testnet-magic 42
TxHash TxIx Lovelace
9db6cf... 0 999999267766
expr 999999267766 - 171309
\> 999999096457
  1. Build the raw transaction:
cardano-cli shelley transaction build-raw \
\--tx-in 9db6cf...#0 \
\--tx-out $(cat pay)+999999096457 \
\--ttl 860000 \
\--fee 171309 \
\--out-file tx.raw \
\--certificate-file pool.dereg
  1. Sign the transaction with both the payment signing key and the cold signing key:
cardano-cli shelley transaction sign \
\--tx-body-file tx.raw \
\--signing-key-file pay.skey \
\--signing-key-file node.skey \
\--testnet-magic 42 \
\--out-file tx.signed
  1. Submit the signed transaction to the blockchain:

    cardano-cli shelley transaction submit \
    \--tx-file tx.signed \
    \--testnet-magic 42

The pool will be retired at epoch 40.

© IOHK 2015 - 2021

Cardano is an open-source project.

Cardano is a software platform ONLY and does not conduct any independent diligence on, or substantive review of, any blockchain asset, digital currency, cryptocurrency or associated funds. You are fully and solely responsible for evaluating your investments, for determining whether you will exchange blockchain assets based on your own judgement, and for all your decisions as to whether to exchange blockchain assets with Cardano. In many cases, blockchain assets you exchange on the basis of your research may not increase in value, and may decrease in value. Similarly, blockchain assets you exchange on the basis of your research may fall or rise in value after your exchange.

Past performance is not indicative of future results. Any investment in blockchain assets involves the risk of loss of part or all of your investment. The value of the blockchain assets you exchange is subject to market and other investment risks