⚠️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 - JSON-RPC Method

Description

Generates new session keys on the connected Enjin Matrix node and returns the public key bundle. Validators use this RPC before submitting session.setKeys extrinsics. For security reasons the call is restricted to local or authenticated connections—public RPC endpoints return an error.

Parameters

This method does not accept parameters.

Returns

FieldTypeDescription
resultstringHex-encoded concatenation of newly generated session public keys

Request Example

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

Response Example (Local Validator Node)

{
"jsonrpc": "2.0",
"result": "0x9ac4...",
"id": 1
}

Error Example (Public Endpoint)

{
"jsonrpc": "2.0",
"error": {
"code": -32601,
"message": "RPC call is unsafe to be called externally"
},
"id": 1
}

Usage Notes

  1. Run the command against your validator node's local RPC (e.g., http://127.0.0.1:9933).
  2. Submit the returned key bundle in a signed session.setKeys extrinsic.
  3. Wait for the extrinsic to finalize before restarting validator services.

cURL (Local Validator)

curl http://127.0.0.1:9933 \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "author_rotateKeys",
"params": [],
"id": 1
}'

Security Guidance

  • Expose the author RPC only on trusted networks; it can manipulate validator keys and should never be open to the public internet.
  • Store previous key bundles securely until the new keys are confirmed active on-chain.
  • Rotate keys before major upgrades or when transitioning collator infrastructure in the Enjin ecosystem.