Appearance
eth_getRawTransactionByBlockNumberAndIndex
served · same as reth
Returns the encoded transaction (EIP-2718) at a position in a block, by block number or tag.
When to use
Use it to get the exact bytes of the transactions of a block one by one.
Example
bash
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"jsonrpc": "2.0", "id": 1, "method": "eth_getRawTransactionByBlockNumberAndIndex", "params": ["0x18facad", "0x0"]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getRawTransactionByBlockNumberAndIndex",
"params": [
"0x18facad",
"0x0"
]
}Response
Live mainnet, block 26193069, 2026-10-14. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x02f903700183025c3080841570de41830711a4940000000aa232009084bd71a5797d089aa4edfad480b9030409c5eabe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002bd0000cca0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000082bedcbe00000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead908... 1370 more characters"
}Parameters
| Name | Type | Required | Meaning |
|---|---|---|---|
block | block number in hex, or a tag, see Block parameter | yes | The block. |
index | hex number | yes | The position of the transaction in the block, from 0x0. |
Returns
The encoded transaction as hex data, or null when the block or the position does not exist.
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_getRawTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex.
Schema (OpenRPC)
Parameter block: BlockNumberOrTag
json
{
"title": "Block number or tag",
"oneOf": [
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
},
{
"title": "Block tag",
"type": "string",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"description": "latest is the head of the last forkchoice update, as reth. pending is the block that Cinder builds from its transaction pool after latest, as reth. safe and finalized are the blocks of the last forkchoice update, as reth. Before the first update, they name no block. earliest is the first block that the node stored, as reth."
}
]
}Parameter index: Quantity
json
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
}Result: Bytes or null
json
{
"oneOf": [
{
"title": "hex encoded bytes",
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
{
"type": "null"
}
]
}