Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
Background
EIP-2718 defines a way for Ethereum to introduce new transaction types through typed envelopes.
This article translates, summarizes, and expands on the proposal below.
I also cover other Ethereum proposals.
Overview
EIP-2718 extends Ethereum's transaction and receipt formats so they can accommodate future protocol features.
A receipt records the result of a transaction.
-
A typed transaction takes the form
TransactionType || TransactionPayload.TransactionTypeidentifies the transaction format.TransactionPayloadcontains the transaction data. Each type's EIP defines how to interpret it.
-
A typed receipt takes the form
TransactionType || ReceiptPayload.TransactionTypeidentifies the receipt format.ReceiptPayloadcontains the receipt data. Each type's EIP defines this format as well.
Ethereum can introduce new transaction and receipt formats as it adds protocol features, while preserving the existing formats for compatibility.
Motivation
Before typed envelopes, introducing a transaction type while preserving backward compatibility meant using the encoded transaction payload to distinguish new and old transactions. Types could not overlap because clients needed to determine unambiguously which rules to apply to a given transaction.
EIP-155 illustrates this constraint. It introduced the chain ID for replay protection but preserved the legacy transaction layout by encoding the chain ID in the existing v field.
For more on EIP-155, see the following article.
[EIP-155] How Ethereum protects against replay attacks
In other words, EIP-155 reused an existing field to represent a new value. The approach works, but repeating this technique for each new transaction type would complicate the design and limit the types Ethereum can add.
Bit packing stores several values in one data structure by giving each value only the bits it needs. This can reduce the size of the structure.
Suppose a one-byte structure has eight bits and needs to store two values. One fits in two bits (0 through 3), and the other fits in three bits (0 through 7). Both fit in one byte, leaving three bits available for future use.
Ethereum originally used the transaction's v to help recover the signer from the signature. EIP-155 repurposed that field to encode both the chain ID and signature parity. This is the example of packing multiple values into a field discussed here.
Bit packing makes storage more compact, but it can make an encoding harder to read and extend.
EIP-2718 solves the identification problem with an explicit TransactionType byte. Clients can identify the type without interpreting the payload's encoding. This simplifies the design of new types and leaves room for further extensions.
At the time of writing, proposals under discussion included letting an EOA execute code in its own context, allowing an account other than msg.sender to pay gas, and supporting native multisignature transactions at Layer 1. Defining those types together without an envelope would require proposal authors and clients to follow more complicated rules to avoid collisions.
The envelope defines a backward-compatible boundary with legacy transactions. New types can coexist as long as their TransactionType numbers do not collide.
- Adding new transaction types becomes simpler.
- Legacy transactions remain compatible.
- Clients need fewer rules to identify types.
- Client implementations become simpler.
- The protocol has more room to grow.
Translation note: Several passages in the Japanese article say EIP-2711, but the envelope and rules discussed here are from EIP-2718.
Specification
EIP-2718 changes how new transaction and receipt formats are represented, making it easier to add new types.
Transactions
Starting at FORK_BLOCK_NUMBER, the transaction root in the block header must be the root hash of patriciaTrie(rlp(Index) => Transaction).
A Patricia trie is a data structure Ethereum uses to store key–value pairs efficiently. The transaction trie uses the RLP-encoded transaction index as its key. RLP stands for Recursive Length Prefix.
For example, consider a block with three transactions.
- LegacyTransaction: rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])
- TransactionType: 0x01, TransactionPayload: 0xabcd...
- TransactionType: 0x02, TransactionPayload: 0xdef0...
They map to the following transaction trie entries.
- Key: rlp(0), value: LegacyTransaction
- Key: rlp(1), value: 0x01 || 0xabcd...
- Key: rlp(2), value: 0x02 || 0xdef0...
Here || means concatenation. The Japanese article describes these values as hashes. In the specification, the entries contain the encoded transactions themselves. The trie root hash is the commitment included in the block header.
The transaction root commits to the block's transactions and their positions, so a change to the transaction data can be detected.
If the block also includes a transaction of TransactionType 0x03, it adds another entry.
- Key: rlp(3), value: 0x03 || TransactionPayload
This trie can contain different transaction types in the same block. Storing its root hash in the header commits to the integrity of their data.
Index is the transaction's position in the block.
Transaction can be TransactionType || TransactionPayload or LegacyTransaction.
TransactionType is an unsigned one-byte type identifier in the range from 0 through 0x7f.
TransactionPayload is an opaque byte array whose interpretation depends on TransactionType and is defined in subsequent EIPs.
An opaque byte array is a byte sequence whose structure and meaning are unspecified at the layer consuming the envelope.
EIP-2718 treats TransactionPayload as such a sequence and delegates its interpretation to the corresponding TransactionType. Payload formats and contents may therefore vary between transaction types.
For example, the TransactionPayload for TransactionType 0x01 can use one format, while the TransactionPayload for TransactionType 0x02 can use a different format. EIP-2718 leaves both formats to their respective EIPs.
As a result, a future EIP can define a new TransactionType and its TransactionPayload format without major changes to the existing envelope mechanism.
The software processing a transaction, typically an Ethereum client, selects the rules for decoding and handling TransactionPayload based on TransactionType.
This separation gives future transaction types flexibility without changing the common envelope.
LegacyTransaction is rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s]).
Signatures for future types should include TransactionType as the first byte of the signed data. This helps prevent signatures meant for one transaction type from being accepted for another.
Receipts
Starting at FORK_BLOCK_NUMBER, the receipt root in the block header must be the root hash of patriciaTrie(rlp(Index) => Receipt).
Index refers to the position of the corresponding transaction in the block.
Receipt can be TransactionType || ReceiptPayload or LegacyReceipt.
TransactionType is an unsigned one-byte transaction type identifier in the range from 0 through 0x7f.
ReceiptPayload is an opaque byte array interpreted according to TransactionType as defined in future EIPs.
LegacyReceipt is rlp([status, cumulativeGasUsed, logsBloom, logs]).
The receipt's TransactionType must match that of the transaction at the same Index.
Giving transactions and receipts a TransactionType lets subsequent proposals add formats within the same envelope.
Additional Notes
Why TransactionType stops at 0x7f
EIP-2718 limits TransactionType to 0x7f. This range meets near-term needs and leaves room for possible extensions. It also avoids colliding with legacy transactions, whose RLP list encoding starts at 0xc0 or above.
Why TransactionType SHOULD be the first byte of signed data
Signing TransactionType as the first byte is strongly recommended to prevent signature reuse across transaction types, but the envelope does not require it universally.
For example, a wrapped legacy transaction that needs to remain compatible with the legacy signature scheme cannot change the data signed by the inner transaction. In addition, some future types may use a different validity mechanism, such as a zero-knowledge proof, in place of a conventional signature such as ECDSA. The recommendation may not apply in that case.
Why there is no TransactionType selection algorithm
EIP-2718 considered specifying how to assign TransactionType values, but treats the choice of algorithm as outside the scope of the envelope.
Why the payload is an opaque byte array
Making the bytes after the type byte opaque lets future transaction types use different encodings, including SSZ, LEB128, or fixed-width formats. This is more flexible than requiring every type to use a list encoded in RLP or another specific format.
The ORIGIN and CALLER opcodes
The proposal considered letting different transaction types change the behavior of ORIGIN and CALLER. It instead favors consistency for contracts and compatibility with existing contract code.
Every transaction type is expected to specify an address that can serve as the CALLER in the first EVM frame. In that frame, ORIGIN is expected to be the same address as CALLER. A transaction type that needs to expose more information to contracts would need a new opcode.
Compatibility
An Ethereum client can distinguish a typed transaction from a legacy one by checking its first byte. This preserves compatibility with existing transaction encodings.
[0, 0x7f]- Typed transaction.
[0xc0, 0xfe]- Legacy transaction.
Clients implementing EIP-2718 distinguish the formats by the first byte. A typed envelope cannot be decoded as a legacy RLP-list transaction. Clients that support the applicable types can process both formats.
The value 0xff is impractical as the first byte of an RLP-encoded Ethereum transaction, so it is reserved as a sentinel for possible future extensions. The first-byte ranges preserve compatibility while leaving space for new formats.
Security Considerations
EIP-2718 strongly recommends starting the signed payload with the transaction type when designing a new format.
The concern is signature reuse. If types A and B accept the same signed payload encoding, a signature generated for A might also be accepted for B. A user who intended to sign only type A could inadvertently authorize a type B transaction.
Including the type byte gives each type a distinct signing domain. For example, type A can sign 0x01 || data, where 0x01 identifies type A and data is its payload. Type B can sign 0x02 || data, where 0x02 identifies type B. A signature for one signing message then does not authorize the other.
This approach is not always possible. A wrapped legacy transaction may need to keep the original signature scheme, which makes adding a type byte to the signed data difficult. EIP-2718 therefore makes this a recommendation.
Citation
Micah Zoltu (@MicahZoltu), "EIP-2718: Typed Transaction Envelope," Ethereum Improvement Proposals, no. 2718, June 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2718.
Conclusion
EIP-2718 gives Ethereum a way to introduce transaction types through a type byte and type-specific payloads while keeping legacy transactions and receipts compatible.
If you have questions, feel free to send me a DM on Twitter.
I also publish in the following places.



