getIdentity
Learn getIdentity use cases, code examples, request parameters, response structure, and tips.
The getIdentity RPC method returns the public key (identity) of the Solana RPC node you are connected to. Each node in the Solana network has a unique cryptographic keypair, and the public key serves as its node identifier.
✅ Common Use Cases
Identify the RPC Node Retrieve the unique public key of the node serving your request—useful in distributed systems or when using multiple providers.
Cross-reference with Cluster Nodes Combine with
getClusterNodesto match the identity to other metadata (e.g., gossip, TPU, version) from the full cluster view.Logging and Debugging Track which RPC node handled a given request—ideal for diagnostics in multi-node environments.
Protocol-Level Verification (Advanced) Some advanced tooling may require node identity verification, though this is uncommon in general dApp workflows.
🛠 Request Parameters
This method does not take any parameters.
📦 Response Structure
The result field contains:
{
"jsonrpc": "2.0",
"result": {
"identity": "8Lx6...xKMN"
},
"id": 1
}identity
string
Base-58 encoded public key of the node you are connected to.
💡 Example: Get RPC Node Identity
Code Examples
Example Response
🧠 Developer Tips
Node-Specific Identity The returned identity is unique to the specific RPC node queried. Connecting to another RPC server (even within the same cluster or provider) may return a different identity.
Not Related to Wallets This identity is not a user wallet or validator address—it strictly identifies the node process itself.
Key Stability A node’s identity is generally stable, but may change if the operator regenerates or replaces the node’s keypair.
Use for Traceability Consider including the node’s identity in debug logs or telemetry to trace request origins in distributed setups.
Last updated