# Renovar KES keys

El procedimiento es similar al de crear las llaves, salvo algunas diferencias.

{% hint style="danger" %}
Es muy recomendado que toda operación que implique acceso a las *cold keys*, *payment.addr* o *stake.addr* se realicen en una maquina sin acceso a internet a fin de minimizar posibilidades de exponer info sensitiva de nuestro pool y/o fondos a terceros mal intencionados. Luego se copian los archivos firmados al BP o un relay online y desde ahí se les agrega a la blockchain.
{% endhint %}

## Calcular epoch inicial

Para hacer el cambio efectivo de inmediato debemos usar el epoch actual.

```
cd ~/cardano-node
expr $(cardano-cli query tip --mainnet | jq .slotNo) \
  / $(cat block/shelley-genesis.json | jq .slotsPerKESPeriod)
```

## Rotar las llaves KES

Para generar nuevas llaves KES usamos el siguiente comando:

{% hint style="warning" %}
Recuerda siempre hacer un backup de tus llaves antes de manipularlas.
{% endhint %}

```
cardano-cli node key-gen-KES \
  --verification-key-file pool-keys/kes.vkey \
  --signing-key-file pool-keys/kes.skey
```

## Certificado operacional&#x20;

También debemos generar un nuevo certificado operacional firmado con nuestra nueva KES

```
cardano-cli node issue-op-cert \
  --kes-verification-key-file pool-keys/kes.vkey \
  --cold-signing-key-file pool-keys/cold.skey \
  --operational-certificate-issue-counter pool-keys/cold.counter \
  --kes-period 86 \
  --out-file pool-keys/node.cert
```

Una vez hecho esto debemos copiar nuestras nuevas llaves al BP y reiniciar el servicio.


---

# 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://es-kb.topopool.com/mantenimiento-del-pool/renovar-kes.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.
