{"eip":7645,"title":"Alias ORIGIN to SENDER","description":"Eliminate ORIGIN tech debt to lay groundwork for account abstraction and close security holes","authors":["Cyrus Adkisson (@cyrusadkisson)","Eirik Ulversøy (@EirikUlversoy)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2024-03-03","discussionsTo":"https://ethereum-magicians.org/t/eip-7645-alias-origin-to-sender/19047","repo":"EIPs","label":"EIP-7645","officialUrl":"https://eips.ethereum.org/EIPS/eip-7645","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7645.md","url":"https://eips.huatuo.xyz/eip-7645/","tldr":{"en":"Proposed making the ORIGIN opcode (tx.origin) return the same value as CALLER (msg.sender), removing a long-discouraged feature that complicates account abstraction and enables phishing.","ja":"ORIGIN opcode（tx.origin）が CALLER（msg.sender）と同じ値を返すようにする提案。アカウントアブストラクションを複雑にし、フィッシングを可能にする、長らく非推奨とされてきた機能を取り除く。","ko":"ORIGIN opcode(tx.origin)가 CALLER(msg.sender)와 같은 값을 반환하도록 하자는 제안. 계정 추상화를 복잡하게 하고 피싱을 가능케 하는, 오래전부터 권장되지 않던 기능을 없앤다.","zh":"提议让 ORIGIN opcode（tx.origin）返回与 CALLER（msg.sender）相同的值，移除一个长期不被鼓励、会使账户抽象复杂化并助长钓鱼的特性。"},"tags":["evm","opcode","tx-origin","account-abstraction","security"],"explainers":{"en":{"lang":"en","tldr":"Proposed making the ORIGIN opcode (tx.origin) return the same value as CALLER (msg.sender), removing a long-discouraged feature that complicates account abstraction and enables phishing.","tags":["evm","opcode","tx-origin","account-abstraction","security"],"related":[4337,3074,7377,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7645/","markdown":"## What problem does it solve?\n\nThe EVM has two \"who called me?\" opcodes:\n\n- `CALLER` (`0x33`, Solidity `msg.sender`): the immediate caller of the current frame.\n- `ORIGIN` (`0x32`, Solidity `tx.origin`): the EOA that signed the whole transaction, no matter how many contracts sit in between.\n\nUsing `tx.origin` for authorization has been discouraged since 2016. A malicious contract you interact with can call another contract that checks `tx.origin == owner`, and the check passes. It also clashes with account abstraction. In [ERC-4337](/eip-4337/), `tx.origin` is the **bundler** for every bundled user operation, so anything the bundler is authorized for via `tx.origin` could be hijacked by any of them. Every AA design has to decide what `ORIGIN` should mean.\n\nEIP-7645 proposes ending the question by aliasing `ORIGIN` to `CALLER`.\n\n## How it works\n\n- In every execution context, `ORIGIN` pushes exactly what `CALLER` would push: the current frame's sender.\n- Transaction format and validation are unchanged; only the opcode's result changes.\n- In a direct EOA-to-contract call, nothing visibly changes, because origin and sender are already equal. In multi-hop calls (`CALL`, `STATICCALL`, `DELEGATECALL`, `CALLCODE`), `ORIGIN` would now equal the immediate caller at every depth.\n\n## Sample code\n\nHow common patterns would behave:\n\n```solidity\ncontract Example {\n    // Pattern 1: \"only EOAs may call me\" (blocks contracts / flash-loan bots)\n    function onlyEOA() external view {\n        require(tx.origin == msg.sender, \"no contracts\");\n        // Today: fails when called through a contract.\n        // Under EIP-7645: tx.origin == msg.sender always holds, so this check stops doing anything.\n    }\n\n    // Pattern 2: phishable owner check\n    address owner;\n    function withdraw() external {\n        require(tx.origin == owner);   // vulnerable today\n        // Under EIP-7645: behaves like msg.sender == owner, closing the phishing hole.\n        payable(msg.sender).transfer(address(this).balance);\n    }\n}\n```\n\n## Things to know\n\n- Status: **Stagnant**. It has not been scheduled for any upgrade, and `ORIGIN` keeps its current meaning on mainnet.\n- It is **not fully backwards compatible**: contracts that rely on `tx.origin != msg.sender`, such as \"EOA-only\" checks, would silently lose that protection. The spec text also contains a contradictory \"No backward compatibility issues found\" line.\n- The spec suggests going further, outside this EIP, by banning `ORIGIN` in tooling or at deploy time.\n- Account abstraction for EOAs has since moved forward through [EIP-7702](/eip-7702/), which leaves `ORIGIN` as is. Under 7702, an EOA with delegated code can make calls from code, so `tx.origin == msg.sender` is no longer a reliable \"not a contract\" test either.\n- Earlier AA proposals that the spec cites as running into the same issue: [EIP-3074](/eip-3074/) and [EIP-7377](/eip-7377/).\n"},"ja":{"lang":"ja","tldr":"ORIGIN opcode（tx.origin）が CALLER（msg.sender）と同じ値を返すようにする提案。アカウントアブストラクションを複雑にし、フィッシングを可能にする、長らく非推奨とされてきた機能を取り除く。","tags":["evm","opcode","tx-origin","account-abstraction","security"],"related":[4337,3074,7377,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7645/","markdown":"## 何を解決するのか\n\nEVM には「誰が自分を呼んだのか」を返す opcode が 2 つあります。\n\n- `CALLER`（`0x33`、Solidity の `msg.sender`）：現在のフレームの直接の呼び出し元。\n- `ORIGIN`（`0x32`、Solidity の `tx.origin`）：間に何個のコントラクトがあっても、トランザクション全体に署名した EOA。\n\n認可に `tx.origin` を使うことは 2016 年から非推奨とされています。やり取りしている悪意あるコントラクトが、`tx.origin == owner` を確認する別のコントラクトを呼び出すと、そのチェックは通ってしまいます。また、アカウントアブストラクションとも衝突します。[ERC-4337](/eip-4337/) では、まとめられたすべてのユーザーオペレーションについて `tx.origin` は**バンドラー**になるため、`tx.origin` を通じてバンドラーに与えられた権限は、そのバンドラーのどのオペレーションからでも乗っ取られる可能性があります。あらゆる AA 設計は `ORIGIN` が何を意味すべきかを決めなければなりません。\n\nEIP-7645 は、`ORIGIN` を `CALLER` のエイリアスにすることでこの問題に終止符を打つことを提案します。\n\n## 仕組み\n\n- あらゆる実行コンテキストで、`ORIGIN` は `CALLER` がプッシュするものとまったく同じ、現在のフレームの送信者をプッシュします。\n- トランザクションの形式と検証は変わりません。変わるのは opcode の結果だけです。\n- EOA からコントラクトへの直接呼び出しでは、origin と sender はすでに等しいため、目に見える変化はありません。複数ホップの呼び出し（`CALL`、`STATICCALL`、`DELEGATECALL`、`CALLCODE`）では、`ORIGIN` はあらゆる深さで直接の呼び出し元に等しくなります。\n\n## サンプルコード\n\n一般的なパターンがどう振る舞うか：\n\n```solidity\ncontract Example {\n    // Pattern 1: \"only EOAs may call me\" (blocks contracts / flash-loan bots)\n    function onlyEOA() external view {\n        require(tx.origin == msg.sender, \"no contracts\");\n        // Today: fails when called through a contract.\n        // Under EIP-7645: tx.origin == msg.sender always holds, so this check stops doing anything.\n    }\n\n    // Pattern 2: phishable owner check\n    address owner;\n    function withdraw() external {\n        require(tx.origin == owner);   // vulnerable today\n        // Under EIP-7645: behaves like msg.sender == owner, closing the phishing hole.\n        payable(msg.sender).transfer(address(this).balance);\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。どのアップグレードにもスケジュールされておらず、メインネットでは `ORIGIN` は現在の意味のままです。\n- **完全な後方互換性はありません。** 「EOA のみ」のチェックのように `tx.origin != msg.sender` に依存するコントラクトは、黙ってその保護を失います。仕様の文章には、矛盾する「後方互換性の問題は見つからなかった」という一文も含まれています。\n- 仕様は、この EIP の範囲外で、ツールやデプロイ時に `ORIGIN` を禁止することでさらに踏み込むことを示唆しています。\n- EOA のアカウントアブストラクションはその後 [EIP-7702](/eip-7702/) を通じて前進し、`ORIGIN` はそのままです。7702 では、委任されたコードを持つ EOA がコードから呼び出しを行えるため、`tx.origin == msg.sender` も、もはや「コントラクトではない」ことの確かなテストではありません。\n- 仕様が同じ問題に直面したものとして挙げている以前の AA 提案：[EIP-3074](/eip-3074/) と [EIP-7377](/eip-7377/)。\n"},"ko":{"lang":"ko","tldr":"ORIGIN opcode(tx.origin)가 CALLER(msg.sender)와 같은 값을 반환하도록 하자는 제안. 계정 추상화를 복잡하게 하고 피싱을 가능케 하는, 오래전부터 권장되지 않던 기능을 없앤다.","tags":["evm","opcode","tx-origin","account-abstraction","security"],"related":[4337,3074,7377,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7645/","markdown":"## 어떤 문제를 해결하나요?\n\nEVM에는 \"누가 나를 호출했나?\"를 알려 주는 opcode가 두 가지 있습니다.\n\n- `CALLER`(`0x33`, Solidity의 `msg.sender`): 현재 프레임의 직접 호출자.\n- `ORIGIN`(`0x32`, Solidity의 `tx.origin`): 사이에 컨트랙트가 몇 개 끼어 있든 트랜잭션 전체에 서명한 EOA.\n\n인가에 `tx.origin`을 쓰는 것은 2016년부터 권장되지 않았습니다. 여러분이 상호작용하는 악성 컨트랙트가 `tx.origin == owner`를 확인하는 다른 컨트랙트를 호출하면 그 검사는 통과합니다. 계정 추상화와도 충돌합니다. [ERC-4337](/eip-4337/)에서 `tx.origin`은 묶인 모든 사용자 오퍼레이션에 대해 **번들러**이므로, `tx.origin`을 통해 번들러에게 부여된 권한은 그중 어느 오퍼레이션이든 가로챌 수 있습니다. 모든 AA 설계는 `ORIGIN`이 무엇을 의미해야 하는지 정해야 합니다.\n\nEIP-7645는 `ORIGIN`을 `CALLER`의 별칭으로 만들어 이 문제를 끝내자고 제안합니다.\n\n## 어떻게 동작하나요?\n\n- 모든 실행 컨텍스트에서 `ORIGIN`은 `CALLER`가 푸시하는 것과 정확히 같은 값, 즉 현재 프레임의 발신자를 푸시합니다.\n- 트랜잭션 형식과 검증은 바뀌지 않으며, opcode의 결과만 바뀝니다.\n- EOA가 컨트랙트를 직접 호출하는 경우에는 origin과 sender가 이미 같으므로 눈에 보이는 변화가 없습니다. 여러 단계를 거치는 호출(`CALL`, `STATICCALL`, `DELEGATECALL`, `CALLCODE`)에서는 `ORIGIN`이 모든 깊이에서 직접 호출자와 같아집니다.\n\n## 샘플 코드\n\n일반적인 패턴이 어떻게 동작하게 되는지:\n\n```solidity\ncontract Example {\n    // Pattern 1: \"only EOAs may call me\" (blocks contracts / flash-loan bots)\n    function onlyEOA() external view {\n        require(tx.origin == msg.sender, \"no contracts\");\n        // Today: fails when called through a contract.\n        // Under EIP-7645: tx.origin == msg.sender always holds, so this check stops doing anything.\n    }\n\n    // Pattern 2: phishable owner check\n    address owner;\n    function withdraw() external {\n        require(tx.origin == owner);   // vulnerable today\n        // Under EIP-7645: behaves like msg.sender == owner, closing the phishing hole.\n        payable(msg.sender).transfer(address(this).balance);\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. 어떤 업그레이드에도 일정이 잡히지 않았고, 메인넷에서 `ORIGIN`은 현재의 의미를 유지합니다.\n- **완전히 하위 호환되지는 않습니다.** \"EOA 전용\" 검사처럼 `tx.origin != msg.sender`에 의존하는 컨트랙트는 조용히 그 보호를 잃습니다. 명세 본문에는 모순되는 \"No backward compatibility issues found\"라는 줄도 있습니다.\n- 명세는 이 EIP 밖에서 도구나 배포 시점에 `ORIGIN`을 금지하는 방식으로 더 나아갈 것을 제안합니다.\n- EOA의 계정 추상화는 이후 [EIP-7702](/eip-7702/)를 통해 진전되었고, 이는 `ORIGIN`을 그대로 둡니다. 7702에서는 위임된 코드를 가진 EOA가 코드에서 호출을 할 수 있으므로, `tx.origin == msg.sender`도 더 이상 \"컨트랙트가 아니다\"라는 믿을 만한 테스트가 아닙니다.\n- 명세가 같은 문제에 부딪혔다고 인용하는 이전 AA 제안: [EIP-3074](/eip-3074/)와 [EIP-7377](/eip-7377/).\n"},"zh":{"lang":"zh","tldr":"提议让 ORIGIN opcode（tx.origin）返回与 CALLER（msg.sender）相同的值，移除一个长期不被鼓励、会使账户抽象复杂化并助长钓鱼的特性。","tags":["evm","opcode","tx-origin","account-abstraction","security"],"related":[4337,3074,7377,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7645/","markdown":"## 它解决什么问题？\n\nEVM 有两个\"谁调用了我？\"的 opcode：\n\n- `CALLER`（`0x33`，Solidity 的 `msg.sender`）：当前调用帧的直接调用者。\n- `ORIGIN`（`0x32`，Solidity 的 `tx.origin`）：对整个交易签名的 EOA，无论中间隔了多少个合约。\n\n自 2016 年以来，一直不鼓励使用 `tx.origin` 做授权。你交互的恶意合约可以调用另一个检查 `tx.origin == owner` 的合约，检查会通过。它还与账户抽象冲突。在 [ERC-4337](/eip-4337/) 中，对每个被打包的用户操作而言，`tx.origin` 都是 **bundler**，因此凡是通过 `tx.origin` 授权给 bundler 的东西，都可能被其中任何一个操作劫持。每种 AA 设计都必须决定 `ORIGIN` 应该意味着什么。\n\nEIP-7645 提议通过把 `ORIGIN` 设为 `CALLER` 的别名来终结这个问题。\n\n## 它如何运作\n\n- 在每个执行上下文中，`ORIGIN` 压入的值与 `CALLER` 完全相同：当前调用帧的发送者。\n- 交易格式和验证保持不变；只有 opcode 的结果改变。\n- 在 EOA 直接调用合约时，没有可见的变化，因为 origin 和 sender 本来就相等。在多跳调用（`CALL`、`STATICCALL`、`DELEGATECALL`、`CALLCODE`）中，`ORIGIN` 在每一层深度都将等于直接调用者。\n\n## 示例代码\n\n常见模式的行为会如何：\n\n```solidity\ncontract Example {\n    // Pattern 1: \"only EOAs may call me\" (blocks contracts / flash-loan bots)\n    function onlyEOA() external view {\n        require(tx.origin == msg.sender, \"no contracts\");\n        // Today: fails when called through a contract.\n        // Under EIP-7645: tx.origin == msg.sender always holds, so this check stops doing anything.\n    }\n\n    // Pattern 2: phishable owner check\n    address owner;\n    function withdraw() external {\n        require(tx.origin == owner);   // vulnerable today\n        // Under EIP-7645: behaves like msg.sender == owner, closing the phishing hole.\n        payable(msg.sender).transfer(address(this).balance);\n    }\n}\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。它没有被排入任何升级，`ORIGIN` 在主网上保持当前含义。\n- 它**并非完全向后兼容**：依赖 `tx.origin != msg.sender` 的合约（例如\"仅限 EOA\"的检查）会悄无声息地失去这种保护。规范文本中还包含一句自相矛盾的 \"No backward compatibility issues found\"。\n- 规范建议在本 EIP 之外走得更远，在工具中或部署时禁止 `ORIGIN`。\n- EOA 的账户抽象此后通过 [EIP-7702](/eip-7702/) 向前推进，而它保持 `ORIGIN` 不变。在 7702 下，带有委托代码的 EOA 可以通过代码发起调用，因此 `tx.origin == msg.sender` 也不再是可靠的\"不是合约\"的测试。\n- 规范引用的、遇到同样问题的早期 AA 提案：[EIP-3074](/eip-3074/) 和 [EIP-7377](/eip-7377/)。\n"}}}
