---
eip: 3508
label: EIP-3508
title: Transaction Data Opcodes
status: Stagnant
type: Standards Track
category: Core
created: 2021-04-16
official: https://eips.ethereum.org/EIPS/eip-3508
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3508.md
canonical: https://eips.huatuo.xyz/eip-3508/
lang: en
tldr: "A stagnant proposal for ORIGINDATALOAD/SIZE/COPY opcodes that let any contract in a call chain read the original transaction's data directly instead of having it passed along."
tags: [evm, opcodes, calldata, core, stagnant]
---

# EIP-3508: Transaction Data Opcodes

> Provide access to original transaction data.

**TL;DR:** A stagnant proposal for ORIGINDATALOAD/SIZE/COPY opcodes that let any contract in a call chain read the original transaction's data directly instead of having it passed along.

## What problem does it solve?

When a contract calls another contract, any large data the callee needs (a Merkle proof, a batch of orders, a layer-2 payload) has to be copied into the new call's calldata. In multi-contract systems the same bytes may be re-encoded and copied several times, burning gas at every hop.

EIP-3508 proposed letting any contract read the **original transaction's `data`** directly, the same way `ORIGIN` exposes the original sender. Contracts deep in a call chain could then pull what they need from the transaction payload instead of receiving it through every intermediate call.

## How it works

Three new opcodes mirroring the existing calldata ones:

| New opcode | Mirrors | Gas |
| --- | --- | --- |
| `ORIGINDATALOAD` (`0x47`) | `CALLDATALOAD` (`0x35`) | `G_verylow` |
| `ORIGINDATASIZE` (`0x48`) | `CALLDATASIZE` (`0x36`) | `G_base` |
| `ORIGINDATACOPY` (`0x49`) | `CALLDATACOPY` (`0x37`) | `G_base + G_verylow` per word |

They operate on the top-level transaction's data. If an `AUTHCALL` from [EIP-3074](/eip-3074/) is on the call stack, they instead see the calldata of the nearest `AUTHCALL`, so that contracts relying on origin data would not exclude sponsored or relayed calls.

## Sample code

Illustrative only: a contract deep in a call chain reads the first word of the transaction payload. `origindataload` is hypothetical; these opcodes were never activated and current Solidity will not compile this:

```solidity
// Hypothetical: ORIGINDATA* do not exist on any live network
function firstWordOfTx() external view returns (bytes32 w) {
    assembly {
        w := origindataload(0)   // like calldataload(0), but for tx.data
    }
}
```

Equivalent semantics in pseudocode:

```python
def origindataload(evm, offset):
    data = nearest_authcall_args(evm) or evm.tx.data
    evm.stack.push(int.from_bytes(data[offset:offset+32].ljust(32, b"\0"), "big"))
```

## Things to know

- Status is **Stagnant**; the opcodes were never adopted.
- The opcode numbers it chose are now used by other instructions: `0x47` is `SELFBALANCE`, `0x48` is `BASEFEE`, `0x49` is `BLOBHASH`. A revival would need new numbers.
- The spec assumed [EIP-3074](/eip-3074/) would ship in London; it did not, and 3074 was later withdrawn in favour of [EIP-7702](/eip-7702/).
- Security caveat from the spec: never assume `tx.data` equals your calldata. Anyone can wrap the call in an entry contract, so origin data alone is not a trustworthy introspection tool.
- The spec itself expects gas savings to be negligible for most real systems, since they mostly pass storage-derived values, not raw input.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-3508
