{"eip":5003,"title":"Insert Code into EOAs with AUTHUSURP","description":"Allow migrating away from ECDSA by deploying code in place of an externally owned account.","authors":["Dan Finlay (@danfinlay)","Sam Wilson (@SamWilsn)"],"status":"Withdrawn","type":"Standards Track","category":"Core","created":"2022-03-26","requires":[3074,3607],"discussionsTo":"https://ethereum-magicians.org/t/eip-5003-auth-usurp-publishing-code-at-an-eoa-address/8979","repo":"EIPs","label":"EIP-5003","officialUrl":"https://eips.ethereum.org/EIPS/eip-5003","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5003.md","url":"https://eips.huatuo.xyz/eip-5003/","tldr":{"en":"A withdrawn proposal for an AUTHUSURP opcode that would deploy contract code at an EOA's address, letting users migrate off their original private key for good.","ja":"EOA のアドレスにコントラクトコードをデプロイする AUTHUSURP opcode の撤回された提案。ユーザーが元の秘密鍵から恒久的に移行できるようにするもの。","ko":"EOA 주소에 컨트랙트 코드를 배포하는 AUTHUSURP opcode에 대한 철회된 제안. 사용자가 원래의 개인키에서 영구적으로 벗어날 수 있게 하려는 것이었다.","zh":"一个已撤回的提案，设想用 AUTHUSURP opcode 在 EOA 的地址上部署合约代码，让用户永久脱离其原始私钥。"},"tags":["account-abstraction","eoa","opcodes","core","withdrawn"],"explainers":{"en":{"lang":"en","tldr":"A withdrawn proposal for an AUTHUSURP opcode that would deploy contract code at an EOA's address, letting users migrate off their original private key for good.","tags":["account-abstraction","eoa","opcodes","core","withdrawn"],"related":[3074,3607,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5003/","markdown":"## What problem does it solve?\n\nMost value on Ethereum sits in externally owned accounts (EOAs), which are controlled by a single ECDSA key. EOAs cannot rotate a key, batch actions, use other signature schemes or add social recovery. If the key leaks, the only fix is moving every asset to a new address, one transaction at a time, and some rights (e.g. a hard-coded owner in a contract) cannot be moved at all.\n\n[EIP-3074](/eip-3074/) would have let an EOA delegate authority to an \"invoker\" contract, but the original key would still have full power. EIP-5003 added the missing step: turn the EOA into a contract account in place, so the old key stops being able to send transactions.\n\n## How it works\n\nIt introduces one opcode, `AUTHUSURP` (`0xf8`), which builds on EIP-3074's `AUTH`:\n\n- Stack input: `offset`, `length` of initcode in memory. Output: the address deployed to, or zero on failure.\n- It behaves like `CREATE`, except the initcode runs at, and code is deployed to, the address in EIP-3074's `authorized` context variable, i.e. the EOA that signed the `AUTH` message.\n- It is invalid if no address is authorized. It skips the nonce check, because the EOA has already sent transactions.\n- Base cost is 32,000 gas for an empty account, otherwise 7,000.\n- It fails (returns zero) if the initcode returns empty code, or if the account already has code by the time deployment happens. This prevents usurping the same address twice.\n\nCombined with [EIP-3607](/eip-3607/), which rejects transactions from senders that have code, the original key can no longer originate transactions once code is deployed.\n\n## Sample code\n\nIllustrative invoker logic (EIP-3074 + EIP-5003 opcodes never existed in Solidity, so this is pseudocode):\n\n```text\n; user signs an EIP-3074 AUTH message committing to this invoker\nAUTH(authority = userEOA, commit, signature)   ; sets `authorized = userEOA`\n\n; copy wallet initcode into memory at `ptr`\nCODECOPY(ptr, walletInitcodeOffset, walletInitcodeLen)\n\n; deploy the smart-wallet code at userEOA itself\naddr = AUTHUSURP(ptr, walletInitcodeLen)\nif addr == 0: revert                              ; empty code or already has code\n; from now on userEOA is a contract; EIP-3607 blocks txs signed by the old key\n```\n\n## Things to know\n\n- Status: **Withdrawn**, superseded by [EIP-7702](/eip-7702/), which lets an EOA set delegated code through a new transaction type and is live on mainnet. Its prerequisite EIP-3074 was also withdrawn.\n- The authors flagged that the old key would still work *outside* transactions: anything verifying ECDSA signatures (for example ERC-2612 `permit`) would keep accepting it unless `ecrecover` itself were changed. This is the same class of concern that applies to delegated EOAs today.\n- For accounts that start out as contracts, [ERC-4337](/eip-4337/) provides account abstraction without protocol changes.\n"},"ja":{"lang":"ja","tldr":"EOA のアドレスにコントラクトコードをデプロイする AUTHUSURP opcode の撤回された提案。ユーザーが元の秘密鍵から恒久的に移行できるようにするもの。","tags":["account-abstraction","eoa","opcodes","core","withdrawn"],"related":[3074,3607,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5003/","markdown":"## 何を解決するのか\n\nEthereum の価値の大半は外部所有アカウント（EOA）にあり、これは単一の ECDSA 鍵で管理されています。EOA は鍵のローテーション、アクションのバッチ処理、他の署名方式の利用、ソーシャルリカバリーの追加ができません。鍵が漏えいした場合、唯一の対処法はすべての資産を新しいアドレスへ 1 トランザクションずつ移すことで、一部の権利（コントラクトにハードコードされたオーナーなど）はそもそも移せません。\n\n[EIP-3074](/eip-3074/) は、EOA が権限を「invoker」コントラクトに委任できるようにするものでしたが、元の鍵は依然として完全な権限を持ち続けます。EIP-5003 は欠けていた手順を加えました。EOA をその場でコントラクトアカウントに変え、古い鍵ではトランザクションを送れないようにするというものです。\n\n## 仕組み\n\nEIP-3074 の `AUTH` を土台とする opcode `AUTHUSURP`（`0xf8`）を 1 つ導入します。\n\n- スタック入力: メモリ上の initcode の `offset` と `length`。出力: デプロイ先のアドレス、失敗時は 0。\n- `CREATE` と同様に動作しますが、initcode は EIP-3074 の `authorized` コンテキスト変数にあるアドレス、つまり `AUTH` メッセージに署名した EOA で実行され、コードもそのアドレスにデプロイされます。\n- 認可されたアドレスがない場合は無効です。EOA はすでにトランザクションを送信済みなので、nonce のチェックはスキップします。\n- 基本コストは、空のアカウントの場合 32,000 gas、それ以外は 7,000 gas です。\n- initcode が空のコードを返す場合、またはデプロイ時点でそのアカウントにすでにコードがある場合は失敗します（0 を返します）。これにより、同じアドレスを 2 度乗っ取ることを防ぎます。\n\nコードを持つ送信者からのトランザクションを拒否する [EIP-3607](/eip-3607/) と組み合わせることで、コードがデプロイされた後は、元の鍵ではトランザクションを発行できなくなります。\n\n## サンプルコード\n\ninvoker のロジックの例です（EIP-3074 と EIP-5003 の opcode は Solidity には存在しないため、擬似コードです）:\n\n```text\n; user signs an EIP-3074 AUTH message committing to this invoker\nAUTH(authority = userEOA, commit, signature)   ; sets `authorized = userEOA`\n\n; copy wallet initcode into memory at `ptr`\nCODECOPY(ptr, walletInitcodeOffset, walletInitcodeLen)\n\n; deploy the smart-wallet code at userEOA itself\naddr = AUTHUSURP(ptr, walletInitcodeLen)\nif addr == 0: revert                              ; empty code or already has code\n; from now on userEOA is a contract; EIP-3607 blocks txs signed by the old key\n```\n\n## 知っておくべきこと\n\n- ステータス: **Withdrawn**。[EIP-7702](/eip-7702/) に取って代わられました。EIP-7702 は、新しいトランザクションタイプを通じて EOA に委任コードを設定でき、メインネットで稼働しています。前提となる EIP-3074 も Withdrawn になりました。\n- 著者らは、古い鍵がトランザクションの*外*では引き続き使えることを指摘しました。ECDSA 署名を検証するもの（たとえば ERC-2612 の `permit`）は、`ecrecover` 自体が変更されない限り、古い鍵を受け入れ続けます。これは、現在の委任された EOA にも当てはまるのと同じ種類の懸念です。\n- 最初からコントラクトであるアカウントには、[ERC-4337](/eip-4337/) がプロトコル変更なしでアカウント抽象化を提供します。\n"},"ko":{"lang":"ko","tldr":"EOA 주소에 컨트랙트 코드를 배포하는 AUTHUSURP opcode에 대한 철회된 제안. 사용자가 원래의 개인키에서 영구적으로 벗어날 수 있게 하려는 것이었다.","tags":["account-abstraction","eoa","opcodes","core","withdrawn"],"related":[3074,3607,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5003/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움의 가치 대부분은 단일 ECDSA 키로 제어되는 외부 소유 계정(EOA)에 있습니다. EOA는 키를 교체하거나, 동작을 일괄 처리하거나, 다른 서명 방식을 쓰거나, 소셜 복구를 추가할 수 없습니다. 키가 유출되면 유일한 해결책은 모든 자산을 트랜잭션 하나씩 새 주소로 옮기는 것이고, 일부 권한(예: 컨트랙트에 하드코딩된 owner)은 아예 옮길 수 없습니다.\n\n[EIP-3074](/eip-3074/)는 EOA가 권한을 \"invoker\" 컨트랙트에 위임하도록 해 주었겠지만, 원래의 키는 여전히 모든 권한을 가집니다. EIP-5003은 빠져 있던 단계를 더했습니다. EOA를 그 자리에서 컨트랙트 계정으로 바꿔, 이전 키로는 더 이상 트랜잭션을 보낼 수 없게 하는 것입니다.\n\n## 어떻게 동작하나요?\n\nEIP-3074의 `AUTH`를 바탕으로 하는 opcode `AUTHUSURP`(`0xf8`) 하나를 도입합니다.\n\n- 스택 입력: 메모리에 있는 initcode의 `offset`, `length`. 출력: 배포된 주소, 실패하면 0.\n- `CREATE`와 비슷하게 동작하지만, initcode가 EIP-3074의 `authorized` 컨텍스트 변수에 있는 주소, 즉 `AUTH` 메시지에 서명한 EOA에서 실행되고 코드도 그 주소에 배포됩니다.\n- 인가된 주소가 없으면 무효입니다. EOA는 이미 트랜잭션을 보낸 적이 있으므로 nonce 검사는 건너뜁니다.\n- 기본 비용은 빈 계정이면 32,000 gas, 그 외에는 7,000 gas입니다.\n- initcode가 빈 코드를 반환하거나, 배포 시점에 계정에 이미 코드가 있으면 실패합니다(0을 반환). 이는 같은 주소를 두 번 가로채는 것을 막습니다.\n\n코드를 가진 발신자의 트랜잭션을 거부하는 [EIP-3607](/eip-3607/)과 결합하면, 코드가 배포된 뒤에는 원래의 키로 더 이상 트랜잭션을 발생시킬 수 없습니다.\n\n## 샘플 코드\n\ninvoker 로직 예시입니다(EIP-3074와 EIP-5003의 opcode는 Solidity에 존재한 적이 없으므로 의사 코드입니다).\n\n```text\n; user signs an EIP-3074 AUTH message committing to this invoker\nAUTH(authority = userEOA, commit, signature)   ; sets `authorized = userEOA`\n\n; copy wallet initcode into memory at `ptr`\nCODECOPY(ptr, walletInitcodeOffset, walletInitcodeLen)\n\n; deploy the smart-wallet code at userEOA itself\naddr = AUTHUSURP(ptr, walletInitcodeLen)\nif addr == 0: revert                              ; empty code or already has code\n; from now on userEOA is a contract; EIP-3607 blocks txs signed by the old key\n```\n\n## 알아둘 점\n\n- 상태: **Withdrawn**. [EIP-7702](/eip-7702/)로 대체되었습니다. EIP-7702는 새 트랜잭션 유형으로 EOA에 위임 코드를 설정할 수 있게 하며 메인넷에서 동작 중입니다. 선행 조건이던 EIP-3074도 Withdrawn되었습니다.\n- 작성자들은 이전 키가 트랜잭션 *밖에서는* 여전히 동작한다고 지적했습니다. ECDSA 서명을 검증하는 모든 것(예: ERC-2612 `permit`)은 `ecrecover` 자체가 바뀌지 않는 한 계속 그 키를 받아들입니다. 이는 오늘날 위임된 EOA에도 해당하는 것과 같은 종류의 우려입니다.\n- 처음부터 컨트랙트인 계정에는 [ERC-4337](/eip-4337/)이 프로토콜 변경 없이 계정 추상화를 제공합니다.\n"},"zh":{"lang":"zh","tldr":"一个已撤回的提案，设想用 AUTHUSURP opcode 在 EOA 的地址上部署合约代码，让用户永久脱离其原始私钥。","tags":["account-abstraction","eoa","opcodes","core","withdrawn"],"related":[3074,3607,7702,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5003/","markdown":"## 它解决什么问题？\n\n以太坊上的大部分价值存放在外部拥有账户（EOA）中，由单个 ECDSA 密钥控制。EOA 无法轮换密钥、批量执行操作、使用其他签名方案或添加社交恢复。如果密钥泄露，唯一的补救办法是把每项资产逐笔转移到新地址，而且有些权利（例如合约中硬编码的所有者）根本无法转移。\n\n[EIP-3074](/eip-3074/) 本可让 EOA 把权限委托给\"invoker\"合约，但原始密钥仍然拥有全部权力。EIP-5003 补上了缺失的一步：把 EOA 就地变成合约账户，使旧密钥无法再发送交易。\n\n## 它如何运作\n\n它引入了一个 opcode，`AUTHUSURP`（`0xf8`），建立在 EIP-3074 的 `AUTH` 之上：\n\n- 栈输入：内存中 initcode 的 `offset` 和 `length`。输出：部署到的地址，失败时为零。\n- 其行为类似 `CREATE`，只是 initcode 在 EIP-3074 的 `authorized` 上下文变量所指的地址上运行，代码也部署到该地址，即对 `AUTH` 消息签名的那个 EOA。\n- 如果没有已授权的地址，则无效。它跳过 nonce 检查，因为该 EOA 已经发送过交易。\n- 基础成本：空账户为 32,000 gas，否则为 7,000 gas。\n- 如果 initcode 返回空代码，或部署时该账户已有代码，则失败（返回零）。这可以防止同一个地址被两次篡夺。\n\n与拒绝来自带有代码的发送者的交易的 [EIP-3607](/eip-3607/) 结合后，一旦部署了代码，原始密钥就无法再发起交易。\n\n## 示例代码\n\ninvoker 逻辑示意（EIP-3074 和 EIP-5003 的 opcode 在 Solidity 中从未存在，因此这是伪代码）：\n\n```text\n; user signs an EIP-3074 AUTH message committing to this invoker\nAUTH(authority = userEOA, commit, signature)   ; sets `authorized = userEOA`\n\n; copy wallet initcode into memory at `ptr`\nCODECOPY(ptr, walletInitcodeOffset, walletInitcodeLen)\n\n; deploy the smart-wallet code at userEOA itself\naddr = AUTHUSURP(ptr, walletInitcodeLen)\nif addr == 0: revert                              ; empty code or already has code\n; from now on userEOA is a contract; EIP-3607 blocks txs signed by the old key\n```\n\n## 需要注意\n\n- 状态：**Withdrawn**，已被 [EIP-7702](/eip-7702/) 取代；EIP-7702 允许 EOA 通过新的交易类型设置委托代码，并已在主网上线。其前置条件 EIP-3074 也已被撤回。\n- 作者指出，旧密钥在交易*之外*仍然有效：任何验证 ECDSA 签名的地方（例如 ERC-2612 的 `permit`）都会继续接受它，除非 `ecrecover` 本身被修改。这与如今被委托的 EOA 所面临的是同一类问题。\n- 对于一开始就是合约的账户，[ERC-4337](/eip-4337/) 无需更改协议即可提供账户抽象。\n"}}}
