Skip to main content

Parameters

string
required
The blockhash to validate (base-58 encoded)
object
Configuration object containing:
string
Commitment level (processed, confirmed, finalized)
number
The minimum slot that the request can be evaluated at

Response

boolean
Whether the blockhash is still valid (true) or not (false)

Code Examples

Basic Request

Using web3.js

Notes

  1. Returns whether a blockhash is still valid
  2. Blockhashes expire after a certain number of slots
  3. The response is immediate as it reads from the current state
  4. Invalid blockhashes cannot be used in transactions
  5. The blockhash must be base-58 encoded

Best Practices

  1. Use appropriate commitment level based on your needs
  2. Cache results when appropriate to reduce RPC load
  3. Check blockhash validity before sending transactions
  4. Consider using websocket subscription for real-time updates
  5. Handle network errors and retry when appropriate

Common Errors

Use Cases

  1. Blockhash Validation
  2. Blockhash Monitoring
  3. Transaction Planning