Smart Contract Wallet - Account Abstraction

As I wrap up my work, the main limitation found is o1js’s lack of a msg.sender equivalent: it is not possible to guarantee that the caller to some function is a given AccountContract. This in turn means that making a zkApp that uses account abstraction is not possible without:

  1. Implementing a custom AccountContract that executes the logic of the given zkApp.
  2. Adapting the zkApp logic to accept such calls.

By simply adding a msg.sender equivalent to o1js, much of the added complexity of the current design could be removed. In turn, it could be possible to define an almost general-purpose UserOperationCallData that can be used for any application. Such a design could look like the following:

class UserOperationCallData extends Struct({
    address: PublicKey,
    dataFields: Array<Field>(n),
}) {}

Where the address is the contract being called, and the dataFields is an array of n fields that acts as the calldata. Each smart contract would then have to define an additional method to parse the dataFields into the appropriate arguments. This would allow for the creation of a general-purpose UserOperationCallData that can be used for many applications, abstracting away much of the added complexity of the current design.

1 Like