Skip to main content

chain_getBlock

Description#

Returns complete block information, including the header and SCALE-encoded extrinsics. Supplying a block hash lets you fetch historical blocks deterministically; omitting the parameter yields the latest block known to the node.

Parameters#

ParameterTypeRequiredDescription
blockHashstringNoHex-encoded block hash. If omitted, the latest block is returned

Returns#

FieldTypeDescription
block.headerobjectBlock header (parent hash, number, state root, extrinsics root, digest)
block.extrinsicsarrayArray of SCALE-encoded extrinsic payloads
justificationsarray | nullFinality justifications, if present

Request Example#

{
"jsonrpc": "2.0",
"method": "chain_getBlock",
"params": [
"0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b"
],
"id": 1
}

Response Example#

{
"jsonrpc": "2.0",
"result": {
"block": {
"header": {
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"number": "0x0",
"stateRoot": "0x2a9c5fae68d226bfef7830398114196416ca1799ebb0099fdfa8b7b7ef19adf4",
"extrinsicsRoot": "0x03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314",
"digest": {
"logs": []
}
},
"extrinsics": []
},
"justifications": null
},
"id": 1
}

The example above shows the Bifrost genesis block (#0), which contains no extrinsics.

Code Examples#

# Latest block
curl https://api-bifrost-polkadot.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getBlock",
"params": [],
"id": 1
}'

Usage Notes#

  • For production monitoring, pair chain_getBlock with chain_getFinalizedHead to avoid processing non-finalized blocks.
  • Extrinsics are returned as SCALE-encoded bytes. Decode them with the Bifrost metadata to extract calls such as timestamp.set, parachainsystem.set_validation_data, or SALP pallet operations.