Docs

eth_getBlockByHash - Astar RPC Method

Retrieve complete block data by block hash on Astar. Essential for multi-chain dApp developers, DeFi builders, and teams leveraging Polkadot + Ethereum ecosystems building on Polkadot's leading dApp hub supporting EVM, WASM, and upcoming PolkaVM environments.

Returns information about a block by hash on Astar.

Why Astar? Build on Polkadot's leading dApp hub supporting EVM, WASM, and upcoming PolkaVM environments with EVM + WASM + PolkaVM support, Build2Earn developer rewards, dApp Staking, and Soneium cross-layer integration.

Use Cases

The eth_getBlockByHash method is essential for:

  • Block verification - Verify block data using its unique hash
  • Chain reorganization handling - Track blocks during reorgs
  • Cross-chain bridges - Verify block finality for cross-chain DeFi, multi-VM smart contracts, and XCM-enabled interoperability with Ethereum and Cosmos
  • Deterministic queries - Get consistent block data regardless of chain state

Code Examples

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid block hash format
-32000Block not foundBlock with this hash does not exist