eth_getTransactionReceipt on Optimism
Everything below was measured on 2026-11-29 by calling eth_getTransactionReceipt on Optimism through the same endpoint customers use, and is re-measured weekly.
What eth_getTransactionReceipt does
Returns the outcome of a mined transaction: status (1 success, 0 reverted), gas used, the effective gas price, the logs it emitted and any contract it created. It returns null until the transaction is in a block.
eth_getTransactionReceipt on Optimism: what we measured
| Fields | 22 (7 beyond the Ethereum set) |
|---|---|
| Receipt for an unknown hash | null |
| Size of the sample receipt | 7.0 KB |
Reading the fee and fields
Beyond the Ethereum fields, Optimism receipts carry 7 more. l1GasPrice: the Ethereum base fee the L1 fee was priced with; l1GasUsed: the L1 gas the transaction's compressed data was estimated to use; l1Fee: the L1 data fee in wei, charged on top of gasUsed × effectiveGasPrice. Add it to get the real cost; l1BaseFeeScalar: the weight of Ethereum's execution base fee in the L1 fee (post-Ecotone formula); l1BlobBaseFee: the Ethereum blob base fee the L1 fee was priced with; l1BlobBaseFeeScalar: the weight of Ethereum's blob base fee in the L1 fee; daFootprintGasScalar: the data-availability footprint scalar from the OP Stack fee configuration.
gasUsed × effectiveGasPrice is not the whole cost on Optimism. In the sample receipt below, execution cost 5,483,403,782,280 wei and the L1 data fee (l1Fee) 1,151,584,934 wei, so 0% of what the sender paid was the L1 fee. A wallet or accounting tool that ignores l1Fee understates fees.
A hash the node has not seen returns null, not an error, so poll until it is non-null (viem's waitForTransactionReceipt does this) and give up after a timeout.
A real Optimism receipt
As our endpoint returned it; logs collapsed to a count and long hex values shortened.
{
"type": "0x2",
"status": "0x1",
"cumulativeGasUsed": "0x1167be",
"logs": "8 logs",
"logsBloom": "0x0000230000002000…(256 bytes)",
"transactionHash": "0xa898dabaf281e39aef9951cc007a9d3a8e1b389247b0b8cf46c1470c971903e4",
"transactionIndex": "0x1",
"blockHash": "0x8eee3a7dc25bc28774e72335b0cb68257ce705cde7e68e74ee23cec83e649d11",
"blockNumber": "0x98bf353",
"gasUsed": "0x10b328",
"effectiveGasPrice": "0x4c733d",
"blobGasUsed": "0x11300",
"from": "0xdc45db93c3fc37272f40812bba9c4bad91344b46",
"to": "0x7ca0b75e67e33c0014325b739a8d019c4fe445f0",
"contractAddress": null,
"l1GasPrice": "0x2aca589",
"l1GasUsed": "0xb09",
"l1Fee": "0x44a3caa6",
"l1BaseFeeScalar": "0x146b",
"l1BlobBaseFee": "0x29a9a9",
"l1BlobBaseFeeScalar": "0xf79c5",
"daFootprintGasScalar": "0x190"
}Example request
curl -s https://rpc.swiftnodes.io/rpc/optimism?key=YOUR_API_KEY \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0xa898dabaf281e39aef9951cc007a9d3a8e1b389247b0b8cf46c1470c971903e4"]}'import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("https://rpc.swiftnodes.io/rpc/optimism?key=YOUR_API_KEY"),
});
const receipt = await client.waitForTransactionReceipt({ hash, timeout: 60_000 });
if (receipt.status !== "success") throw new Error("reverted");
// Total cost on Optimism: execution plus the L1 data fee
const execution = receipt.gasUsed * receipt.effectiveGasPrice;
const total = execution + (receipt.l1Fee ?? 0n);Other methods on Optimism
- eth_blockNumberSupported
- eth_chainIdSupported
- eth_getBalanceSupported
- eth_getBlockByNumberSupported
- eth_getTransactionByHashSupported
- eth_callSupported
- eth_estimateGasSupported
- eth_gasPriceSupported
- eth_feeHistorySupported
- eth_maxPriorityFeePerGasSupported
- eth_sendRawTransactionSupported
- eth_getTransactionCountSupported
- eth_getCodeSupported
- eth_subscribeSupported
- eth_getLogsSupported
- eth_getBlockReceiptsSupported
- eth_getProofSupported
- eth_createAccessListSupported
- debug_traceCallNot available
- trace_blockNot available
- trace_transactionNot available
eth_getTransactionReceipt on other chains
- Ethereum
- Base
- Arbitrum
- Polygon
- BNB Smart Chain
- Avalanche
- Sonic
- Linea
- Scroll
- zkSync Era
- Mantle
- Gnosis
- Celo
- Berachain
- Monad
- Unichain
- Kaia
- PulseChain
- World Chain
- Ronin
- Abstract
- ApeChain
- MegaETH
- Fantom
- Lisk
- Hemi
- X Layer
- BOB
- Plasma
- Fraxtal
- Zora
- Story
- Soneium
- Sei
- Hyperliquid
- Taiko
- Morph
- Ink
- Katana
- Ethereum Classic
- opBNB
- Mode
- Flare
- Core
- Chiliz
- Telos EVM
- Tempo
- Cronos
- Manta Pacific
- Shibarium
- Boba Network
- Arbitrum Nova
- Immutable zkEVM
Frequently asked questions
Does Optimism support eth_getTransactionReceipt?
Yes. eth_getTransactionReceipt answered on the SwiftNodes Optimism endpoint when our weekly probe called it through the customer path (2026-11-29).
How do I get the total fee of a transaction on Optimism?
Add the receipt's l1Fee to gasUsed × effectiveGasPrice.
Why is the Optimism receipt null?
The transaction is not in a block yet, or the hash is unknown to the node. Keep polling with a timeout.
Optimism endpoints, live block height and WebSocket status are on the Optimism RPC page.
One key covers every chain we serve, and SwiftNodes has a free tier.