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
| Parameter | Type | Required | Description |
|---|---|---|---|
publicKey | string | Yes | Hex-encoded public key to look up (e.g. "0xd43593...") |
keyType | string | Yes | Four-character key type identifier (e.g. "babe", "gran", "aura", "imon") |
Response
| Field | Type | Description |
|---|---|---|
result | boolean | true 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 foundorRPC 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 unsafeflag. - 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.
Related Methods
author_rotateKeys-- Generate new session keys in the keystoreauthor_submitExtrinsic-- Submit extrinsics (requires keys for signing)system_nodeRoles-- Check what roles the node is configured with (authority, full, etc.)
archive_v1_storageDiff_stopStorageDiff - Bittensor RPC Method
Stop an active storage diff subscription on Bittensor via the archive RPC using the new JSON-RPC v2 spec.
chainHead_v1_body - Bittensor RPC Method
Retrieve a block body within an active chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.