---
eip: 3520
label: EIP-3520
title: Transaction Destination Opcode
status: Stagnant
type: Standards Track
category: Core
created: 2021-04-16
requires: 3508
official: https://eips.ethereum.org/EIPS/eip-3520
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3520.md
canonical: https://eips.huatuo.xyz/eip-3520/
lang: en
tldr: "A stagnant proposal for an ENTRYPOINT opcode that returns the transaction's original `to` address, so contracts could inspect which top-level call they are part of."
tags: [evm, opcodes, introspection, core]
---

# EIP-3520: Transaction Destination Opcode

> Provide access to the original recipient of a transaction.

**TL;DR:** A stagnant proposal for an ENTRYPOINT opcode that returns the transaction's original `to` address, so contracts could inspect which top-level call they are part of.

## What problem does it solve?

A contract deep inside a call chain knows who called it (`CALLER`) and who signed the transaction (`ORIGIN`), but not **which contract the transaction was sent to** or what that first call was trying to do. A token, for example, cannot tell whether a transfer is part of adding liquidity to a DEX or opening a loan.

EIP-3520 adds the missing piece: the address the transaction entered through. Paired with [EIP-3508](/eip-3508/), which proposed opcodes to read the original transaction's calldata, a contract could reconstruct the top-level intent and react to it.

## How it works

- New opcode **`ENTRYPOINT`** at `0x4a`. It takes no stack inputs and pushes the transaction's original `to` address, left-padded to 256 bits.
- It costs `G_base`, the same as `ORIGIN` (`0x32`).
- During contract creation there is no `to`, so it returns the zero address.
- Interaction with [EIP-3074](/eip-3074/)'s `AUTHCALL`: if an `AUTHCALL` is on the call stack, `ENTRYPOINT` returns the target of the nearest `AUTHCALL` instead. This prevents the opcode from being used to tell externally owned accounts and contracts apart (for example by checking `ENTRYPOINT == ADDRESS`).
- The author states that `ENTRYPOINT` should only be introduced together with EIP-3508's `ORIGINDATA*` opcodes; alone it has little value.

## Sample code

Illustrative EVM assembly (the opcode was never adopted, so no compiler supports it): revert unless the transaction entered through a trusted router.

```text
ENTRYPOINT            ; 0x4a (proposed) -> original tx `to`, or nearest AUTHCALL target
PUSH20 <router>       ; trusted, immutable entry contract
EQ
PUSH1 ok
JUMPI
PUSH0
PUSH0
REVERT
ok:
JUMPDEST
; ... continue, optionally inspecting the original calldata via EIP-3508's ORIGINDATALOAD
```

## Things to know

- Status is **Stagnant**, and so is its companion [EIP-3508](/eip-3508/). Neither was scheduled for a fork.
- [EIP-3074](/eip-3074/), whose `AUTHCALL` this proposal defers to, was **Withdrawn**; account delegation went to [EIP-7702](/eip-7702/) instead.
- Byte `0x4a` is now used by `BLOBBASEFEE`, so this opcode number is no longer free.
- The spec warns that introspection is only meaningful for pre-approved, immutable contracts: a user-supplied entry contract can make the transaction look like anything.
- Test cases were never written.


---

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