Appearance
eth_getTransactionByBlockNumberAndIndex
served · same as reth
Returns the transaction at a position in a block.
When to use
Use it to walk through 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_getTransactionByBlockNumberAndIndex", "params": ["0x18facad", "0x0"]}' \
http://127.0.0.1:8547json
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [
"0x18facad",
"0x0"
]
}Response
Live mainnet, block 26193069, 2026-10-14. Checked against reth 2.7: equal.
json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"type": "0x2",
"chainId": "0x1",
"nonce": "0x25c30",
"gas": "0x711a4",
"maxFeePerGas": "0x1570de41",
"maxPriorityFeePerGas": "0x0",
"to": "0x0000000aa232009084bd71a5797d089aa4edfad4",
"value": "0x0",
"accessList": [],
"input": "0x09c5eabe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002bd0000cca0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000082bedcbe00000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000aa059a20000000000000000000003bd97020d200000000000000000... 1146 more characters",
"r": "0x103be1fd79e3a155b76cdf050414ef4e8fdda93d16b5534eb7dc73d8ba659c62",
"s": "0x204ce7790e5110ecea1a42048ecfdc04ef42f7163b14042d4b8de3e4abc03fc2",
"yParity": "0x0",
"v": "0x0",
"hash": "0xa457d1d714f7c63b99f3846b390c13ae45d5f41952cc657d369b439b8fc8fa16",
"blockHash": "0x88392e71b7c4893c80cadfdeadcbaa91add6a41a1a9e2bda3aef6774053617a5",
"blockNumber": "0x18facad",
"transactionIndex": "0x0",
"from": "0xc917c3fa468f2c4b9c84c72caa46420eb9825249",
"gasPrice": "0xad66c85",
"blockTimestamp": "0x6acfe2e7"
}
}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 transaction, or null when the block or the position does not exist. A block below the first block of the node gives the error 4444. See Transaction.
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_getBlockByNumber, eth_getTransactionByHash.
Schema (OpenRPC)
The official specification: eth_getTransactionByBlockNumberAndIndex in ethereum/execution-apis.
Parameter Block: Block number or Block tag
json
{
"oneOf": [
{
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "Block number",
"type": "string"
},
{
"description": "`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"title": "Block tag",
"type": "string"
}
],
"title": "Block number or tag"
}Parameter Transaction index: string
json
{
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "hex encoded unsigned integer",
"type": "string"
}Result: Not Found (null) or Transaction information
json
{
"oneOf": [
{
"title": "Not Found (null)",
"type": "null"
},
{
"oneOf": [
{
"properties": {
"accessList": {
"description": "EIP-2930 access lists",
"items": {
"additionalProperties": false,
"properties": {
"address": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "hex encoded address",
"type": "string"
},
"storageKeys": {
"items": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
},
"type": "array"
}
},
"required": [
"address",
"storageKeys"
],
"title": "Access list entry",
"type": "object"
},
"title": "accessList",
"type": "array"
},
"authorizationList": {
"description": "List of authorizations for the transaction",
"items": {
"properties": {
"address": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "hex encoded address",
"type": "string"
},
"chainId": {
"description": "Chain ID on which this transaction is valid",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]{0,63})$",
"title": "s",
"type": "string"
},
"yParity": {
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "yParity",
"type": "string"
}
},
"required": [
"chainId",
"nonce",
"address",
"yParity",
"r",
"s"
],
"type": "object"
},
"title": "authorizationList",
"type": "array"
},
"chainId": {
"description": "Chain ID that this transaction is valid on",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"gas": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas limit",
"type": "string"
},
"gasPrice": {
"description": "The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas price",
"type": "string"
},
"input": {
"pattern": "^0x[0-9a-f]*$",
"title": "input data",
"type": "string"
},
"maxFeePerGas": {
"description": "The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max fee per gas",
"type": "string"
},
"maxPriorityFeePerGas": {
"description": "Maximum fee per gas the sender is willing to pay to miners in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max priority fee per gas",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "s",
"type": "string"
},
"to": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "to address",
"type": "string"
},
"type": {
"pattern": "^0x4$",
"title": "type",
"type": "string"
},
"v": {
"description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "v",
"type": "string"
},
"value": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "value",
"type": "string"
},
"yParity": {
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "yParity",
"type": "string"
}
},
"required": [
"accessList",
"authorizationList",
"chainId",
"gas",
"input",
"maxFeePerGas",
"maxPriorityFeePerGas",
"nonce",
"r",
"s",
"to",
"type",
"value",
"yParity"
],
"title": "Signed 7702 Transaction",
"type": "object"
},
{
"properties": {
"accessList": {
"description": "EIP-2930 access list",
"items": {
"additionalProperties": false,
"properties": {
"address": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "hex encoded address",
"type": "string"
},
"storageKeys": {
"items": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
},
"type": "array"
}
},
"required": [
"address",
"storageKeys"
],
"title": "Access list entry",
"type": "object"
},
"title": "accessList",
"type": "array"
},
"blobVersionedHashes": {
"description": "List of versioned blob hashes associated with the transaction's EIP-4844 data blobs",
"items": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
},
"title": "blobVersionedHashes",
"type": "array"
},
"chainId": {
"description": "Chain ID that this transaction is valid on",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"gas": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas limit",
"type": "string"
},
"gasPrice": {
"description": "The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas price",
"type": "string"
},
"input": {
"pattern": "^0x[0-9a-f]*$",
"title": "input data",
"type": "string"
},
"maxFeePerBlobGas": {
"description": "The maximum total fee per gas the sender is willing to pay for blob gas in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max fee per blob gas",
"type": "string"
},
"maxFeePerGas": {
"description": "The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max fee per gas",
"type": "string"
},
"maxPriorityFeePerGas": {
"description": "Maximum fee per gas the sender is willing to pay to miners in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max priority fee per gas",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "s",
"type": "string"
},
"to": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "to address",
"type": "string"
},
"type": {
"pattern": "^0x3$",
"title": "type",
"type": "string"
},
"v": {
"description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "v",
"type": "string"
},
"value": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "value",
"type": "string"
},
"yParity": {
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "yParity",
"type": "string"
}
},
"required": [
"accessList",
"blobVersionedHashes",
"chainId",
"gas",
"input",
"maxFeePerBlobGas",
"maxFeePerGas",
"maxPriorityFeePerGas",
"nonce",
"r",
"s",
"to",
"type",
"value",
"yParity"
],
"title": "Signed 4844 Transaction",
"type": "object"
},
{
"properties": {
"accessList": {
"description": "EIP-2930 access list",
"items": {
"additionalProperties": false,
"properties": {
"address": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "hex encoded address",
"type": "string"
},
"storageKeys": {
"items": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
},
"type": "array"
}
},
"required": [
"address",
"storageKeys"
],
"title": "Access list entry",
"type": "object"
},
"title": "accessList",
"type": "array"
},
"chainId": {
"description": "Chain ID that this transaction is valid on.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"gas": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas limit",
"type": "string"
},
"gasPrice": {
"description": "The effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas price",
"type": "string"
},
"input": {
"pattern": "^0x[0-9a-f]*$",
"title": "input data",
"type": "string"
},
"maxFeePerGas": {
"description": "The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max fee per gas",
"type": "string"
},
"maxPriorityFeePerGas": {
"description": "Maximum fee per gas the sender is willing to pay to miners in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "max priority fee per gas",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "s",
"type": "string"
},
"to": {
"oneOf": [
{
"title": "Contract Creation (null)",
"type": "null"
},
{
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "Address",
"type": "string"
}
],
"title": "to address"
},
"type": {
"pattern": "^0x2$",
"title": "type",
"type": "string"
},
"v": {
"description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "v",
"type": "string"
},
"value": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "value",
"type": "string"
},
"yParity": {
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "yParity",
"type": "string"
}
},
"required": [
"accessList",
"chainId",
"gas",
"gasPrice",
"input",
"maxFeePerGas",
"maxPriorityFeePerGas",
"nonce",
"r",
"s",
"type",
"value",
"yParity"
],
"title": "Signed 1559 Transaction",
"type": "object"
},
{
"properties": {
"accessList": {
"description": "EIP-2930 access list",
"items": {
"additionalProperties": false,
"properties": {
"address": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "hex encoded address",
"type": "string"
},
"storageKeys": {
"items": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "32 byte hex value",
"type": "string"
},
"type": "array"
}
},
"required": [
"address",
"storageKeys"
],
"title": "Access list entry",
"type": "object"
},
"title": "accessList",
"type": "array"
},
"chainId": {
"description": "Chain ID that this transaction is valid on.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"gas": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas limit",
"type": "string"
},
"gasPrice": {
"description": "The gas price willing to be paid by the sender in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas price",
"type": "string"
},
"input": {
"pattern": "^0x[0-9a-f]*$",
"title": "input data",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "s",
"type": "string"
},
"to": {
"oneOf": [
{
"title": "Contract Creation (null)",
"type": "null"
},
{
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "Address",
"type": "string"
}
],
"title": "to address"
},
"type": {
"pattern": "^0x1$",
"title": "type",
"type": "string"
},
"v": {
"description": "For backwards compatibility, `v` is optionally provided as an alternative to `yParity`. This field is DEPRECATED and all use of it should migrate to `yParity`.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "v",
"type": "string"
},
"value": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "value",
"type": "string"
},
"yParity": {
"description": "The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.",
"pattern": "^0x([0-9a-fA-F]?){1,2}$",
"title": "yParity",
"type": "string"
}
},
"required": [
"accessList",
"chainId",
"gas",
"gasPrice",
"input",
"nonce",
"r",
"s",
"type",
"value",
"yParity"
],
"title": "Signed 2930 Transaction",
"type": "object"
},
{
"properties": {
"chainId": {
"description": "Chain ID that this transaction is valid on.",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "chainId",
"type": "string"
},
"gas": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas limit",
"type": "string"
},
"gasPrice": {
"description": "The gas price willing to be paid by the sender in wei",
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "gas price",
"type": "string"
},
"input": {
"pattern": "^0x[0-9a-f]*$",
"title": "input data",
"type": "string"
},
"nonce": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "nonce",
"type": "string"
},
"r": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "r",
"type": "string"
},
"s": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "s",
"type": "string"
},
"to": {
"oneOf": [
{
"title": "Contract Creation (null)",
"type": "null"
},
{
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "Address",
"type": "string"
}
],
"title": "to address"
},
"type": {
"pattern": "^0x0$",
"title": "type",
"type": "string"
},
"v": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "v",
"type": "string"
},
"value": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "value",
"type": "string"
}
},
"required": [
"gas",
"gasPrice",
"input",
"nonce",
"r",
"s",
"type",
"v",
"value"
],
"title": "Signed Legacy Transaction",
"type": "object"
}
],
"properties": {
"blockHash": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "block hash",
"type": "string"
},
"blockNumber": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "block number",
"type": "string"
},
"blockTimestamp": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "block timestamp",
"type": "string"
},
"from": {
"pattern": "^0x[0-9a-fA-F]{40}$",
"title": "from address",
"type": "string"
},
"hash": {
"pattern": "^0x[0-9a-f]{64}$",
"title": "transaction hash",
"type": "string"
},
"transactionIndex": {
"pattern": "^0x(0|[1-9a-f][0-9a-f]*)$",
"title": "transaction index",
"type": "string"
}
},
"required": [
"blockHash",
"blockNumber",
"blockTimestamp",
"from",
"hash",
"transactionIndex"
],
"title": "Transaction information",
"type": "object"
}
]
}