Skip to content

Add block timestamp to eth_getTransaction* methods #729

@bogdan

Description

@bogdan

Rationale

eth_getTransactionByHash returns the transaction together with blockHash and blockNumber once it is mined, but it does not include the block timestamp.

As a result, clients must issue an additional RPC call (eth_getBlockByHash or eth_getBlockByNumber) to retrieve the timestamp, even though this information is already known by the node at that point.

This extra round-trip significantly increases latency and RPC load for a very common access pattern.

Use-cases include:

  • Wallets displaying transaction history with timestamps
  • NFT marketplaces and indexers tracking transfers
  • Block explorers and analytics tools
  • Mobile or high-latency clients where minimizing RPC calls is important

Including the timestamp directly would improve performance, simplify client code, and reduce unnecessary RPC traffic.


Implementation

A possible implementation would be to add an optional field to the eth_getTransaction* response, for example:

"blockTimestamp": "0x6565f1a0"
  • Present only for mined transactions
  • null or omitted for pending transactions
  • Encoded in the same hex format as block timestamps in eth_getBlockBy*

This change would be fully backward-compatible, as it only adds a new field.

RPC methods affected:

  • eth_getTransactionByHash
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getBlockByHash
  • eth_getBlockByNumber

Orignally from ethereum/go-ethereum#33491

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions