A transaction receipt is the definitive, immutable record of a transaction's execution on a blockchain, generated by a network node after a transaction has been included in a block and processed by the Ethereum Virtual Machine (EVM) or equivalent execution layer. Unlike the transaction itself, which contains the intent (e.g., sender, recipient, value, data), the receipt provides the outcome, including its success or failure status, the amount of gas used, and the logs generated by any smart contracts it interacted with. This data is crucial for applications to verify the results of on-chain operations.
Transaction Receipt
What is a Transaction Receipt?
A transaction receipt is a cryptographically verifiable data structure generated by a blockchain node to record the outcome of a processed transaction.
The receipt contains several key fields essential for developers and network analysis. The status field (a 0 for failure or 1 for success) indicates whether the transaction's execution was reverted. The cumulativeGasUsed and gasUsed fields detail the computational resources consumed, which directly determines the transaction fee. Most importantly, the receipt contains logs, which are structured events emitted by smart contracts; these logs are the primary mechanism for decentralized applications (dApps) to track state changes and trigger off-chain actions via indexers or listeners.
From a technical perspective, transaction receipts are stored in a Merkle Patricia Trie alongside the block header, with the root hash of this receipts trie being included in the block header as the receiptsRoot. This cryptographic commitment allows for efficient and secure light client verification: one can prove that a specific transaction receipt is valid for a given block without needing to download the entire blockchain. This property is fundamental for scalability solutions, cross-chain bridges, and wallet balance checks that rely on Simplified Payment Verification (SPV).
For developers, accessing a transaction receipt is a fundamental API call. Using libraries like web3.js or ethers.js, one typically calls a method such as getTransactionReceipt after a transaction hash is known. The receipt's logs are parsed using the Application Binary Interface (ABI) of the relevant smart contract to decode the emitted event data into human-readable information. This process is the backbone of front-end updates, database indexing, and automated business logic in the Web3 stack.
Understanding the difference between a transaction and its receipt is critical. A pending transaction only has a hash; a confirmed transaction is included in a block; but only with the receipt can you definitively know its effect. Failed transactions still produce a receipt, which logs the revert reason and consumed gas (which is not refunded). This makes receipts indispensable for debugging, auditing, accounting, and building resilient applications that react accurately to on-chain state changes.
Key Features of a Transaction Receipt
A transaction receipt is a cryptographically verifiable record generated by a blockchain network to confirm the final state and outcome of a submitted transaction.
Transaction Status
The status field is a boolean value (1 for success, 0 for failure) that definitively indicates whether the transaction was executed successfully by the Ethereum Virtual Machine (EVM). A status of 0 signifies the transaction reverted, often due to insufficient gas, a failed condition, or a smart contract error.
Cumulative Gas Used
This field shows the total amount of gas consumed by the transaction. It is crucial for calculating the transaction fee (gas used * gas price). In the context of a block, it represents the sum of gas used by all transactions in the block up to and including this one.
Contract Address (for Creations)
If the transaction was a contract creation (a transaction with no to address but containing init code), this field contains the address of the newly deployed smart contract. For all other transaction types, this field is null.
Logs and Events
The logs field contains an array of log entries emitted by the transaction. These logs are the primary mechanism for smart contracts to communicate results and state changes off-chain, forming the basis for event indexing by decentralized applications (dApps) and blockchain explorers.
- Each log contains the emitter's address, topics (indexed event parameters), and data.
Block Hash and Number
These fields permanently anchor the receipt to a specific location in the blockchain. The blockHash is the cryptographic hash of the block containing the transaction, and the blockNumber is its sequential height. This provides immutable proof of inclusion and timestamp context.
Transaction Hash and Index
The transactionHash is the unique identifier (Keccak-256 hash) of the transaction itself. The transactionIndex is its positional order within the block. Together, they allow for precise retrieval and verification of the transaction's data and execution trace.
How a Transaction Receipt is Generated
A transaction receipt is a cryptographically verifiable record produced by an Ethereum Virtual Machine (EVM) blockchain to confirm the outcome of a transaction. Its generation is a core part of the state transition process.
A transaction receipt is generated by an Ethereum Virtual Machine (EVM) node immediately after a transaction is executed within a block. This process begins once the block's transactions are sequentially processed. For each transaction, the EVM computes the new world state, consumes gas, and produces execution logs. The receipt is the formal record of this execution, containing critical data such as the cumulative gas used, the success status, and the bloom filter derived from any emitted event logs.
The generation process is deterministic and integral to consensus. Every validator node on the network independently executes the transaction and generates an identical receipt. This receipt is then hashed and included in the block's receipts root, which is part of the block header. This cryptographic commitment allows light clients to efficiently verify that a specific transaction was executed and its outcome, without needing the full transaction history or state data.
Key components stored in a standard receipt include the status code (1 for success, 0 for failure), the total gasUsed, the logsBloom filter for efficient log queries, and an array of logs themselves. For example, a failed transaction due to an out-of-gas error will have a status of 0 and a gasUsed value equal to the transaction's gas limit, permanently recorded on-chain. This immutable record is essential for dApps, indexers, and wallets to reliably determine finality and react to on-chain events.
Technical Details & Data Structure
This section details the core data objects that form the immutable record of blockchain state changes, focusing on the transaction receipt and its critical components.
A transaction receipt is a cryptographically verifiable data structure generated by an Ethereum Virtual Machine (EVM) client after a transaction is executed and included in a block. It serves as the definitive proof of the transaction's outcome, containing key execution metadata such as the final status (success or failure), total gas used, the set of logs emitted by smart contracts, and the cumulative gas used in the block up to that point. Unlike the transaction itself, which is a request, the receipt is the authoritative record of what actually happened on-chain. It is stored in a Merkle Patricia Trie, and its root hash is included in the block header for verification.
Visual Explainer: The Receipt in the Blockchain
A transaction receipt is the definitive, immutable record of a transaction's outcome on a blockchain, providing cryptographic proof of execution and state changes.
A transaction receipt is a cryptographically verifiable data structure generated by a blockchain node after a transaction has been executed and included in a block. It serves as the authoritative proof of the transaction's outcome, detailing not just the event but its effects on the network's state. Unlike the transaction itself, which is a request, the receipt is the result, containing critical post-execution information such as the cumulative gas used, the set of logs emitted by smart contracts, and the final status (success or failure). This makes it an indispensable tool for developers and applications to verify and react to on-chain events.
The receipt's structure is standardized within protocols like Ethereum. Key fields include the status code (1 for success, 0 for failure), the cumulativeGasUsed, the contractAddress (for contract creation transactions), and a Bloom filter—a space-efficient data structure that allows for efficient filtering of the logs contained within. These logs are indexed events emitted by smart contracts using the LOG opcodes, which applications can later query to track specific occurrences like token transfers or governance votes without scanning the entire blockchain history.
For developers, the receipt is the primary interface for confirming transaction success and processing its side effects. Wallets and explorers use the status and gas fields to display transaction outcomes to users. More importantly, decentralized applications (dApps) rely on parsing the logs within a receipt to trigger off-chain logic, update user interfaces, or maintain indexed databases. The receipt's cryptographic link to the block header, via the transaction hash and Merkle proofs, allows any party to independently and trustlessly verify that a specific event occurred and was finalized on the chain.
Understanding the distinction between a transaction and its receipt is crucial. A transaction is a signed message proposing a state change, broadcast to the network. The receipt is the network's answer to that proposal. It is generated deterministically by every validating node during block processing, ensuring consensus on the outcome. This mechanism is fundamental to the blockchain's ability to provide a verifiable and tamper-proof history of execution, forming the bedrock for reliable smart contract interactions and audit trails.
Ecosystem Usage: Who Uses Transaction Receipts?
A transaction receipt is a critical data object generated after a transaction is executed on-chain. Its structured proof of execution is consumed by various actors across the blockchain ecosystem.
Wallets & User Interfaces
Wallets monitor for transaction receipts to provide user feedback. They use the status field to display a transaction as "Confirmed" or "Failed," and the gasUsed to calculate the final transaction cost. Advanced wallets may also parse event logs from the receipt to show context, such as "Swapped 1 ETH for 3200 USDC" based on a Swap event.
Analytics & Auditing Firms
Analysts use receipts for forensic accounting and compliance. The immutable record within a receipt allows them to trace asset flows via event logs, verify contract state changes, and audit protocol behavior. The cumulativeGasUsed and block number provide a timestamp and cost basis for economic analysis of network activity.
Layer 2 & Rollup Protocols
Optimistic and ZK Rollups use transaction receipts as proof of execution on the parent chain (e.g., Ethereum Mainnet). They batch receipts from their own chains and post them as calldata or state roots. The validity proofs in ZK-Rollups or the fraud challenge windows in Optimistic Rollups ultimately rely on the verifiability of the underlying receipt data.
Oracle Networks & Keepers
Decentralized oracle networks like Chainlink use transaction receipts to confirm that on-chain conditions have been met before delivering data or executing functions. An off-chain keeper service will poll for a receipt containing a specific event (e.g., AuctionEnded) before triggering the next step in a smart contract workflow, enabling secure automation.
Practical Examples & Use Cases
A transaction receipt is the immutable, machine-readable proof of a transaction's final outcome on-chain. These examples illustrate how developers and analysts use this critical data structure.
Event Logging & DApp State Updates
Smart contracts emit events (e.g., Transfer, Approval) which are stored as logs within the transaction receipt. DApp frontends listen for these logs to update user interfaces in real-time without polling the chain.
- A DeFi dashboard uses the
Swapevent log to display a user's successful trade. - An NFT marketplace listens for
Transferlogs to update ownership and listings instantly.
Gas Analysis & Fee Optimization
The receipt's gasUsed and effectiveGasPrice fields provide precise cost data for executed transactions. Developers use this to:
- Profile and optimize smart contract functions to reduce gas consumption.
- Calculate the exact transaction fee paid (
gasUsed * effectiveGasPrice). - Set accurate gas limits for subsequent transactions to avoid out-of-gas errors or overpayment.
Transaction Finality & Confirmation
The status field (1 for success, 0 for failure) is the definitive on-chain confirmation of a transaction's outcome. This is critical for:
- Payment processors confirming a transfer is finalized before releasing goods or services.
- Bridges and cross-chain protocols that require incontrovertible proof of an asset burn or lock on the source chain before minting on the destination chain.
Debugging Failed Transactions
When a transaction fails (status: 0), the receipt does not contain revert reason data. However, combined with the transaction's input data and a local node, developers can:
- Replay the transaction locally to simulate execution and identify the failing condition.
- Inspect the gasUsed; if it's close to the gas limit, an out-of-gas error is likely.
- Use the blockHash and transactionIndex to trace all state changes leading to the failure.
Indexing & Blockchain Analytics
Receipts are the primary data source for blockchain indexing services (like The Graph) and analytics platforms. They extract:
- Event logs to build queryable databases of trades, mints, or governance votes.
- Cumulative gas used per block to analyze network congestion and demand.
- Contract interaction patterns by tracking
toandfromaddresses across receipts.
Proof Generation for Layer 2s
In Optimistic Rollups, transaction receipts on Layer 1 are used to generate fraud proofs or confirm state roots during the challenge period. In zk-Rollups, receipts validate the correctness of zero-knowledge proofs submitted to the main chain. The receipt's immutable data is the anchor for these scaling solutions' security.
Common Misconceptions
Clarifying frequent misunderstandings about blockchain transaction receipts, their purpose, and the data they contain.
No, a transaction receipt is not proof of success; it is proof of execution. A receipt is generated for every transaction that is included in a block, regardless of whether the transaction's intended operation succeeded or failed. The key indicator is the status field: a value of 1 (or 0x1) indicates success, while 0 (or 0x0) indicates the transaction was reverted. A receipt for a failed transaction still contains critical data like gas used and logs, proving the EVM attempted to process it.
Key Takeaway: Always check the status field in the receipt to determine if the transaction achieved its intended outcome.
Comparison: Transaction vs. Transaction Receipt
A structural and functional comparison between the two primary data objects representing a blockchain operation and its outcome.
| Feature | Transaction | Transaction Receipt |
|---|---|---|
Primary Purpose | Represents a request for state change | Represents the outcome of a processed request |
Created By | User or smart contract (via EOA) | The network (validator/miner) |
Contains Execution Proof | ||
Contains State Changes (Logs) | ||
Contains Gas Used & Effective Gas Price | ||
Hash (Identifier) | Transaction Hash (txHash) | Derived from block hash and transaction index |
Status Field | None (only implied by nonce/gas) | status (1 for success, 0 for failure) |
On-Chain Storage | In the block's transaction list | In the block's receipt trie |
Frequently Asked Questions (FAQ)
Answers to common technical questions about blockchain transaction receipts, their structure, and how they are used for verification and event logging.
A transaction receipt is a cryptographically verifiable data structure generated by a blockchain node after a transaction has been executed and included in a block. It serves as proof of the transaction's outcome, containing critical execution details not present in the transaction itself. The receipt includes fields like the status (success or failure), the total amount of gas used, the cumulative gas used up to that point in the block, the logs generated by smart contract events, and the contract address for contract creation transactions. Unlike the transaction, which is a request, the receipt is the authoritative record of what actually happened on-chain. It is a fundamental component for dApp front-ends, indexers, and analytics tools to verify outcomes and react to on-chain events.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.