Limited proving support: Due to receipt data being linearly hashed as part of the receipts_root Merkle-Patricia Trie (MPT), it is not possible to efficiently proof individual parts of receipts, such as logs. Requiring the full receipt data to be present can be prohibitive for smart contract based applications such as L2 fraud proofs or client applications verifying log data.
Unnecessary statefulness:EIP-658 replaced the intermediate post-state root from receipts with a boolean status code. However, cumulativeGasUsed is similarly stateful, unnecessarily complicating efforts to execute transactions in parallel. Furthermore, multiple receipts are required to verify the effective gas used by an individual transaction.
Incomplete data: JSON-RPC provides contractAddress in the receipt for a transaction creating a new contract, but the receipt does not contain the required information to verify it. Workarounds that rely on also fetching the transaction data may not be future-proof.
This EIP defines a universal receipt format based on SSZ to address these concerns.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Existing definitions
Definitions from existing specifications that are used throughout this document are replicated here for reference.
All receipts are represented as a single, normalized SSZ container. The definition uses the StableContainer[N] SSZ type and Optional[T] as defined in EIP-7495.
Name
Value
Description
MAX_TOPICS_PER_LOG
4
LOG0 through LOG4 opcodes allow 0-4 topics per log
MAX_LOG_DATA_SIZE
uint64(2**24) (= 16,777,216)
Maximum data byte length for a log
MAX_LOGS_PER_RECEIPT
uint64(2**21) (= 2,097,152)
Maximum number of entries within logs
MAX_RECEIPT_FIELDS
uint64(2**5) (= 32)
Maximum number of fields to which Receipt can ever grow in the future
When building a consensus ExecutionPayload, the receipts_root is now based on the Receipt type, changing the type of receipts_root from an MPT Hash32 to an SSZ Root.
Objects are encoded using SSZ and compressed using the Snappy framing format, matching the encoding of consensus objects as defined in the consensus networking specification. As part of the encoding, the uncompressed object length is emitted; the RECOMMENDED limit to enforce per object is MAX_CHUNK_SIZE bytes.
Rationale
SSZ merkleization allows verification of individual chunks of receipt data, reducing complexity for client applications and smart contracts. Additionally, SSZ StableContainer enables unification of the receipt format across all EIP-2718 transaction types and provides forward compatibility.
Backwards Compatibility
Applications that rely on the replaced MPT receipts_root in the block header require migration to the SSZ receipts_root.
Applications using verified cumulativeGasUsed values have to compute the value from prior receipts.