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.
This article examines EIP-1153, which introduces low-cost temporary storage that persists only for the duration of a transaction.
This explanation translates, summarizes, and expands on the original proposal.
I have also written about other EIPs.
Abstract
EIP-1153 introduces two opcodes, TLOAD (0x5c) and TSTORE (0x5d), for transient storage.
Transient storage can be accessed similarly to persistent storage, but its contents are discarded at the end of the transaction. Because its values do not require persistent disk reads or writes, the gas cost is substantially lower than persistent storage operations.
Writes through TSTORE are also exempt from the gas-stipend check that EIP-2200 imposes on SSTORE.
This gives smart contracts a storage-like structure for exchanging temporary data cost-effectively.
Motivation
Ethereum transactions can contain nested execution contexts, or frames, created through calls such as CALL. When a contract is invoked repeatedly within a transaction, including through reentrancy, it needs a safe and efficient way to share data across frames.
Traditionally, there have been two main approaches to inter-frame communication:
- Passing arguments and return values through
CALL. - Sharing information indirectly through persistent storage (
SSTOREandSLOAD).
The former can expose data to manipulation or disclosure by untrusted intermediary contracts, while the latter can incur high gas costs. EIP-3529 limits total gas refunds to 20% of gas consumed by a transaction, so even temporary use of persistent storage can be expensive.
For more about EIP-3529, see the following article.
[EIP3529] Reducing gas refunds on Ethereum
Transient storage addresses these problems:
- Values are discarded at the end of the transaction, so persistent-state cleanup is unnecessary.
- The storage refund limit does not apply.
- It avoids persistent disk I/O, enabling low-cost access.
Use cases include reentrancy locks, transaction-scoped token approvals (temporaryApprove), communication through proxies, and passing arguments during contract creation with CREATE2.
The design also allows languages such as Solidity to expose transient storage through a data-location modifier such as transient, alongside memory and storage.
Specification
Transient storage specification
New opcodes: TLOAD and TSTORE
The EVM introduces TLOAD (opcode 0x5c) and TSTORE (opcode 0x5d). Their stack arguments match those of SLOAD (0x54) and SSTORE (0x55), but they access transient storage, whose contents are discarded when the transaction ends.
TLOAD pops one 32-byte word from the stack, interprets it as a storage key, retrieves the corresponding 32-byte transient storage value, and pushes it onto the stack.
TSTORE pops two 32-byte words: the storage key and the value to store. It writes the value into the corresponding transient storage slot.
Like persistent storage, transient storage uses word-addressed slots.
Gas costs
TLOAD costs 100 gas, equivalent to a warm SLOAD.
TSTORE also costs 100 gas, equivalent to a warm write to a dirty persistent storage slot. This reflects the fact that transient storage must support rollback on revert and is therefore more costly than ordinary memory access.
Lifecycle and access restrictions
All transient storage values are discarded when the transaction ends. No transient values carry over to subsequent transactions.
The storage is private in the same ownership sense as persistent storage: only execution in the owning contract's context can access it. All frames belonging to that contract within a transaction share the same transient storage. This is closer to persistent storage than to frame-local memory. The term private does not imply confidentiality from blockchain observers.
Behavior under CALL and DELEGATECALL
With DELEGATECALL or CALLCODE, code from another contract executes in the caller's context. The caller owns the transient storage, just as it owns the persistent storage in that context.
With CALL or STATICCALL, the callee owns the transient storage.
Reverts
If a frame writes to transient storage through TSTORE and then reverts, the writes made since entry to that frame are rolled back. This includes changes made through nested calls, following the same rollback principles as persistent storage.
Restrictions under STATICCALL
Executing TSTORE in a static context causes an exception because STATICCALL prohibits state changes. TLOAD is read-only and is permitted in that context.
Differences from EIP-2200
EIP-2200 specifies that SSTORE fails if the remaining gas is at or below the gas stipend of 2300 gas.
TSTORE is exempt from this particular check. It still requires sufficient gas to pay its own execution cost. This enables more flexible transaction-scoped storage operations.
Rationale
Comparing alternative approaches
One alternative for inter-frame communication is to lower the cost of transient uses of existing persistent storage opcodes, SSTORE and SLOAD. EIP-2200 introduced adjustments along these lines.
However, EIP-3529 subsequently limited storage-related gas refunds to 20% of total gas consumption. Temporary persistent-storage usage can consequently fail to recover much of the gas paid for writes.
Another option would be to exempt transient storage usage from the refund limit or track it separately from ordinary storage. This would complicate both implementation and reasoning about gas. For example, mixing transient and non-transient usage makes it difficult to determine which refund limits apply.
A separate transient storage mechanism that does not depend on refunds is simpler and more adaptable to future upgrades.
Addressing model
Some developers have suggested that byte-addressed access, similar to memory, might be more appropriate than the word-addressed interface exposed by TLOAD and TSTORE.
Transient storage, however, is often used for temporary keyed data such as ERC-20 approvals, where mappings keyed by pairs like (address, address) are useful. Linear memory makes such access less straightforward and complicates gas accounting and rollback.
A memory-like interface backed by a map would introduce a third model, distinct from both memory and storage, adding complexity for compilers and clients. The storage-like interface is a practical alternative.
The misconception about transaction IDs
A suggested alternative is to assign each transaction a unique ID and use that ID in persistent storage keys instead of introducing transient storage.
This does not address the underlying issues of refund limits and rollback complexity. Transaction IDs and transient storage serve different purposes and are not interchangeable.
Costs of introducing transient storage
Transient storage requires new client implementation code, even though existing contract behavior need not change. It also introduces concepts that must be added to Ethereum's Yellow Paper.
Benefits
The design provides several benefits:
- It is independent of the refund cap introduced by proposals such as EIP-3529.
- Clients need not load original persistent storage values.
- Writes do not incur the additional initial persistent-storage costs.
- The semantics of existing storage operations remain unchanged.
- Persistent storage slots do not need to be cleared after temporary use.
- Gas calculations become simpler and more predictable.
- The mechanism need not affect future persistent storage designs, including Verkle trees.
These properties make transient storage a practical way to improve EVM efficiency and enable new contract patterns.
Backward compatibility
EIP-1153 adds TLOAD and TSTORE without changing the semantics of SLOAD or SSTORE. Previously deployed contracts and existing code are unaffected by the new opcodes unless they use them.
Introducing opcodes requires a hard fork.
Test cases
Test suites are available to check behavior against the specification. They cover transaction-scoped writes, restoring values after a revert, and isolating or sharing state according to nested call contexts.
These tests verify expected behavior; their availability alone does not prove that every implementation is correct.
Reference implementation
Transient storage must support reverts, not merely record values. Temporary writes made during a contract call must be restored accurately if that execution fails.
The reference approach uses three structures:
current- A map holding the current transient storage state.
journal- A log recording changes.
checkpoints- Records of rollback boundaries, represented by journal lengths.
This approach allows reads and writes in O(1) time, with O(N) work when undoing N journaled changes. It resembles the state-journaling mechanisms already used by Ethereum clients.
Security considerations (DoS resistance)
A concern is that numerous transient writes followed by a revert() might impose excessive work on the EVM. Persistent storage already presents a comparable rollback problem, and Ethereum clients have safeguards for that case.
The original article includes the following persistent-storage example to illustrate the workload:
pragma solidity =0.8.13;
contract TryDOS {
uint256 slot;
constructor() {
slot = 1;
}
function tryDOS() external {
uint256 i = 1;
while (gasleft() > 5000) {
unchecked {
slot = i++;
}
}
revert();
}
}The example repeatedly writes values while gas remains above its threshold, then reverts. Existing clients already handle comparable state-journal rollback workloads. The transient storage design must likewise account for these costs.
Security
TSTORE as a new allocation mechanism
TSTORE provides a way to store 32 bytes for 100 gas per operation. It therefore enables relatively inexpensive allocation of temporary keyed storage.
Using the original proposal's illustrative transaction budget of approximately 30,000,000 gas, the theoretical capacity is about 9.15 MB of transient data, ignoring other instruction costs. This is greater than the roughly 3.75 MB of ordinary memory that the same gas budget could expand using MSTORE.
The original analysis also considers repeated calls that reset memory expansion costs: at approximately 700 KB per million gas, cumulative ordinary memory allocation can approach 20 MB across calls. These are illustrative estimates under the historical gas assumptions, not current network limits.
Developers and client implementers must account for the gas limit and the different allocation behavior of transient storage and memory.
Understanding the transient storage lifecycle
Transient storage is automatically discarded when the transaction ends. A developer might therefore assume there is no reason to reset a value to zero before returning from a function.
That can be a dangerous assumption. A reentrancy lock left set, for example, can prevent legitimate subsequent calls to the same contract within the transaction. Unintentionally retained nonzero values can also cause unexpected behavior.
Leave a nonzero transient value only when its lifetime and intended reuse within the same transaction are explicit. Otherwise clear temporary state as appropriate when the operation finishes.
Cautions when using transient storage instead of memory
Developers may consider transient storage a substitute for ordinary memory when implementing in-memory mappings. This is discouraged.
Ordinary EVM memory is local to an execution frame and discarded when the frame ends. Transient storage survives across successful calls within the same transaction and can be accessed by later frames belonging to the same storage owner. Writes left behind inadvertently can affect subsequent calls and introduce reentrancy-related bugs.
TSTORE is also more expensive per operation than MSTORE. Memory-based structures can often be implemented using alternatives such as sorted lists, and the proposal notes relatively few use cases requiring full in-memory mappings in the EVM.
Citation
Alexey Akhunov (@AlexeyAkhunov), Moody Salem (@moodysalem), "EIP-1153: Transient storage opcodes," Ethereum Improvement Proposals, no. 1153, June 2018. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1153.
Conclusion
EIP-1153 introduces transaction-scoped transient storage, providing a low-cost data area for communication across execution frames without persisting values between transactions.
If you have questions, feel free to contact me via Twitter.
I also share technical content on the following platforms.



