Docs

author_hasKey - Bittensor RPC Method

Check whether the node keystore contains a specific public key on Bittensor. Administrative method.

Checks whether the node's keystore contains a given public key for a specified key type. This is an administrative method used to verify that a validator or collator node has the correct session keys loaded before participating in block production or consensus. It is typically disabled on public shared RPC endpoints.

Parameters

ParameterTypeRequiredDescription
publicKeystringYesHex-encoded public key to look up (e.g. "0xd43593...")
keyTypestringYesFour-character key type identifier (e.g. "babe", "gran", "aura", "imon")

Response

FieldTypeDescription
resultbooleantrue if the key exists in the keystore for the given type, false otherwise.

On public shared RPC nodes, this method is usually disabled and returns an error such as Method not found or RPC call is unsafe.

Code Examples

Use Cases

  • Validator setup verification -- Confirm that session keys are properly loaded in the keystore before a validator begins producing blocks.
  • Key rotation checks -- After rotating session keys with author_rotateKeys, verify the new keys are present.
  • Monitoring and alerts -- Automated health checks to ensure a validator node still has the required keys.

Notes

  • This is an unsafe/administrative RPC method. It must be explicitly enabled on the node with the --rpc-methods unsafe flag.
  • On Dwellir's shared public RPC endpoints, expect this method to return an error.
  • The key type is a 4-byte ASCII identifier corresponding to the consensus or session module that uses the key.