Skip to main content

chain_getBlockHash

Returns the block hash for a given block number on Moonbeam.

Use Cases#

  • Historical queries - Convert block numbers to hashes
  • Block navigation - Navigate blockchain history for cross-chain DeFi, multi-chain dApps, and Ethereum-to-Polkadot bridging via XCM, Axelar, LayerZero, and Wormhole
  • Data indexing - Build block number to hash mappings

Parameters#

ParameterTypeRequiredDescription
blockNumberNumberNoBlock number. If omitted, returns latest block hash

Request#

{
"jsonrpc": "2.0",
"method": "chain_getBlockHash",
"params": [1000000],
"id": 1
}

Code Examples#

curl https://api-moonbeam.n.dwellir.com/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getBlockHash",
"params": [1000000],
"id": 1
}'