IMPERSONATECALL Opcode - EVM - Ethereum Research Ethereum Research IMPERSONATECALL Opcode EVM SergioDemianLerner September 24, 2020, 7:52pm 1 I would like to open the discussion about a proposal for a new opcode named IMPERSONATECALL that calls other contracts and replaces the msg.sender at the same time. It saves gas and simplifies several use cases regarding meta-transactions and sponsored wallets. You can read the proposal here: github.com ethereum/EIPs/blob/716fadffb103dd9e491d7ca6cb98b3f98036ea71/EIPS/eip-IMPERSONATECALL.md --- eip: title: IMPERSONATECALL Opcode author: Sergio Demian Lerner (sergio.d.lerner@gmail.com) category: Core type: Standards Track status: Draft created: 2020-09-24 --- ### Overview Add a new opcode, `IMPERSONATECALL` at `0xf6`, which is similar in idea to `CALL`, except that it impersonates a sender, i.e. the callee sees a sender different from the real caller. To prevent collisions with other deployed contract or externally owned accounts, the impersonated sender address is derived from the real caller address and a salt. ### Specification `IMPERSONATECALL`: `0xf6`, takes 7 operands: - `gas`: the amount of gas the code may use in order to execute; - `to`: the destination address whose code is to be executed; This file has been truncated. show original The idea is that a contract can impersonate child contracts (created with a derivation similar, but not equal, to CREATE2). Therefore there is no practical risk that the caller impersonates a third party contract. This opcode enables the creation of multi-user wallets, where each user is given a separate non-custodial smart-wallet having its own address for storing ethers and tokens, yet no contract code is deployed, and a main-wallet contract retains the common functionality (i.e. social private key recovery). Wallets are accessed by a meta-transaction system (i.e using EIP-712) embedded in the multi-user wallet contract. Even if the same functionality can be achieved by using counterfactual contract creation, this solution is attractive because: It’s much simpler to design and less error prone. It provides the sponsor huge gas savings, removing the need for the deployment of thousands of wallets. I’m sure there are plenty more use cases that can benefit from this opcode. 3 Likes SergioDemianLerner September 24, 2020, 11:46pm 2 As IMPERSONATECALL sounds like a risky thing (it’s not), somebody suggested I rename it CALLFROM. 3 Likes SergioDemianLerner October 9, 2020, 10:28pm 3 The EIP has been assigned a final number and, after reviews, it was accepted to the EIP repository. You can read the latest version here: github.com ethereum/EIPs/blob/930e456484589a403cee7bbb94539a096182ed6e/EIPS/eip-2997.md --- eip: 2997 title: IMPERSONATECALL Opcode author: Sergio Demian Lerner (@SergioDemianLerner) discussions-to: https://ethresear.ch/t/impersonatecall-opcode/8020 category: Core type: Standards Track status: Draft created: 2020-09-24 --- ## Abstract Add a new opcode, `IMPERSONATECALL` at `0xf6`, which is similar in idea to `CALL (0xF1)`, except that it impersonates a sender, i.e. the callee sees a sender different from the real caller. The impersonated sender address is derived from the real caller address and a salt. ## Motivation This proposal enables native multi-user wallets (wallets that serve multiple users) that can be commanded by EIP-712 based messages and therefore enable meta-transactions. Multi-user wallets also enable the aggregation of transfer operations in batches similar to rollups, but maintaining the same address space as normal onchain transactions, so the sender's wallet does not need to be upgraded to support sinding ether or tokens to a user of a multi-user wallet. Additionally, many times a sponsor company wants to deploy non-custodial smart wallets for all its users. The sponsor does not want to pay the deployment cost of each user contract in advance. Counterfactual contract creation enables this, yet it forces the sponsor to create the smart wallet (or a proxy contract to it) when the user wants to transfer ether or tokens out of his/her account for the first time. This proposal avoids this extra cost, which is at least 42000 gas per user. This file has been truncated. show original matt October 10, 2020, 2:42am 4 https://ethereum-magicians.org is usually the preferred place for EIP discussions 1 Like SergioDemianLerner October 10, 2020, 2:34pm 5 thanks for the tip! The discussion has been moved to : Fellowship of Ethereum Magicians – 10 Oct 20 EIP-2997: IMPERSONATECALL Opcode I would like to open the discussion about a proposal for a new opcode named IMPERSONATECALL that calls other contracts and replaces the msg.sender at the same time. It saves gas and simplifies several use cases regarding muti-user wallets, sponsored... Please follow that link while I correct the EIP link. Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled