⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

author_rotateKeys

Description

Generates new session keys on the node and returns them for registration on-chain. Collators must rotate keys after upgrades or when redeploying infrastructure.

Parameters

This method takes no parameters.

Returns

Hex-encoded concatenation of the new session keys.

Request Example

{
"jsonrpc": "2.0",
"method": "author_rotateKeys",
"params": [],
"id": 1
}

Response Example

{
"jsonrpc": "2.0",
"result": "0xd4ff7f1e9b0f9d43e8f2dce6f9c2a86f5d43401f1fd6a6b48f6c6d15b0b7f05e",
"id": 1
}

Code Examples

JavaScript

const rotated = await api.rpc.author.rotateKeys();
console.log('New session keys:', rotated.toHex());

Python

new_keys = substrate.rpc_request('author_rotateKeys', [])["result"]
print('Submit these keys via session.setKeys extrinsic:', new_keys)

Operational Steps

  1. Call author_rotateKeys on the collator node to generate fresh keys.
  2. Submit a signed extrinsic (e.g., session.setKeys) with the returned keys and proof using the collator controller account.
  3. Wait for inclusion and verify via system_events that the keys were registered.