Appearance
eth_getBlockTransactionCountByHash
served · same as reth
Returns the number of transactions in a block, by block hash.
When to use
Use it to find how many transactions a block has without the block itself.
Example
bash
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_getBlockTransactionCountByHash", "params": ["0x88392e71b7c4893c80cadfdeadcbaa91add6a41a1a9e2bda3aef6774053617a5"]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x88392e71b7c4893c80cadfdeadcbaa91add6a41a1a9e2bda3aef6774053617a5"
]
}Response
Live mainnet, block 26193069, 2026-10-14. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xed"
}Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
blockHash | 32-byte hash | yes | The hash of the block. |
Returns
The count as a hex number, or null when the hash is unknown or not on the canonical chain.
Errors
| Code | Message | When |
|---|---|---|
| -32602 | Invalid params | A parameter is missing or does not parse. data has the text of reth, with the position. |
Compared with reth
The live example above gives the same answer on Cinder and on reth 2.7.
Related methods
eth_getBlockTransactionCountByNumber, eth_getBlockByHash.
Schema (OpenRPC)
The official specification: eth_getBlockTransactionCountByHash in ethereum/execution-apis.
Parameter Block hash: string
json
{
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
}Result: Not Found (null) or Transaction count
json
{
"oneOf": [
{
"title": "Not Found (null)",
"type": "null"
},
{
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "Transaction count",
"type": "string"
}
]
}