POST
/
83e0d6661ee0488e22e167c18818cb38
curl --request POST \
  --url https://solana-mainnet.core.chainstack.com/83e0d6661ee0488e22e167c18818cb38 \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 45,
  "jsonrpc": "2.0",
  "method": "isBlockhashValid",
  "params": [
    "AspJzsEukGPuLYsebpUSSeS79GtYVVh6Bn4478qWXqBK",
    {
      "commitment": "processed"
    }
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": true
}

The Solana isBlockhashValid method checks whether a given blockhash is still valid.

This method is useful for determining if a previously fetched blockhash can still be used for transaction submission. It helps prevent the use of expired blockhashes, which would cause transactions to fail.

Get your own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockhash — the blockhash to validate, as a base-58 encoded string.
  • commitment — (optional) the level of commitment desired:
    • processed — the node has processed the block and the block may be on a fork.
    • confirmed — the block is confirmed by the cluster as not being on a fork.
    • finalized — the block is finalized by the cluster.

Response

  • result — a boolean indicating whether the blockhash is still valid:
    • true — the blockhash is valid and can be used for transaction submission.
    • false — the blockhash is no longer valid and should not be used.

Use case

A practical use case for isBlockhashValid is in transaction retry logic. When a transaction fails due to network issues, an application can use this method to check if the original blockhash is still valid before retrying the transaction. If the blockhash is no longer valid, the application knows it needs to fetch a new blockhash before retrying.

Body

application/json
id
integer
default:45
jsonrpc
string
default:2.0
method
string
default:isBlockhashValid
params
array

The blockhash to validate, as a base-58 encoded string

Response

200 - application/json
Blockhash validity status
jsonrpc
string
id
integer
result
boolean