Closed alvrs closed 1 year ago
I'm curious about what I imagine will be the most common use case: account delegation from EOA to burner wallet for an indefinite period of time.
I assume this path would mean extra gas via CALL
per action/transaction of the burner wallet? Are there ways we can reduce that or is this design already accounting for that?
account delegation from EOA to burner wallet for an indefinite period of time.
if the delegation is not limited to certain functions, the UNLIMITED_DELEGATION
can be used and no additional CALL
would be required. If it should be limited to certain functions it would have to happen via a CALL
to a delegation check in the current design. There is some overhead in that, but there are simply too many variants of limitations to hardcode some of them in the core function (eg. limit to all functions of a namespace, limit to all functions of a system, limit to a specific function, limit to a specific function with specific arguments). If the check happens via a CALL
the respective delegation check system can just perform the checks that are actually required, which saves some gas over doing more checks in the core function that might not be relevant for the specific type of limitation.
Ohh got it! I glossed over the unlimited delegation bit. 👌
from your perspective, what would be the most "ERC-4337" native way of doing this? The answer might be that there can't be any overlap and we have to roll everything on our own (apart from the trusted forwarder standard) and that's ok. But I am curious if there ways to re-use some of the infrastructure, like bundlers. Have you took a look at the spec?
from your perspective, what would be the most "ERC-4337" native way of doing this? The answer might be that there can't be any overlap and we have to roll everything on our own (apart from the trusted forwarder standard) and that's ok. But I am curious if there ways to re-use some of the infrastructure, like bundlers. Have you took a look at the spec?
In my mind this proposal is mostly orthogonal to ERC-4337. There are some overlapping use cases (e.g. “session wallets” could also be implemented as a type of 4337 account), but other use cases are different. Most notably the use case of temporary approvals for specific function calls isn’t really a design goal of 4337, while it’s one of the core design goals of callFrom (i.e. support “atomic swaps” with any system akin to ERC-20’s approve/transferFrom pattern, or allow modules to set up stuff in your name, or allow a system to call other lower level systems in your name). It would definitely be possible to create a 4337 account that implements logic to temporarily delegate access to certain functions to other accounts, but it wouldn’t be the most straightforward solution, and it would be outside the MUD protocol, so other protocol features couldn’t build on top of it.
Abstract
This proposal introduces a modular mechanism allowing accounts to delegate other accounts to execute functions on their behalf. By modularizing the delegation logic, we can cater to various use cases, from simple unlimited delegations to complex, conditional ones.
Design Goals
Sample use cases
approve
+transferFrom
mechanism.registerHook
without transferring namespace ownership.Proposed solution
Overview
callFrom
entry point.Implementation
Any contract implementing the
DelegationCheck
interface can be associated with a limited delegation.For efficiency, a constant (
address(1)
) can represent unlimited delegations, circumventing the need for contract calls in this case.Once a delegation is registered, the “grantee” can call functions on behalf of the “grantor” using
callFrom
. The world checks the validity of a delegation by calling the delegation check system registered for this grantee/grantor. There may be a different delegation check contract for each grantee, and/or a default delegation check for each grantor.With this setup in place delegation types such as limiting the number of calls can be added via a module.
registerLimitedDelegation
function to include a parameter for arbitrary bytes, which are passed to the system’s init function. This would simplify the UX of creating and initializing a limited delegationRelated issues