1 of 18

Safe + EIP-7702

Scan for slides

Akshay Patel

Senior Solidity Engineer @ Safe

2 of 18

Intro EIP-7702

EOA as Smart account

  • Batch transactions
  • Gas sponsorship
  • Granular permissions to account

Impact

  • More users will be comfortable using smart account.
  • Hopefully more Smart account users than EOA users

Title

  • Add a new tx type that permanently sets the code for an EOA

3 of 18

Use cases

Improved UX for users

    • Sponsored transactions
    • Easier on-ramping
    • Combined approve and transfer
    • Grant partial access to the account
    • Sign only once to use Dapp
    • Bring session keys to EOA wallets
    • And many more…

Why enable these features?

  • Onboarding to web3 becomes easier

4 of 18

Possible

Approaches

Approach 1

Modified Safe Proxy

Approach 2

Modified Safe Singleton

Approach 3

SafeLite

5 of 18

Modified Safe Proxy

Drawbacks

  • Requires deploying a proxy contract
  • Requires a slightly modified Safe singleton so that address(this) can be owner
  • Requires calling setup(...) function

Features

  • Sign only once
  • Almost compatible with Safe Wallet and existing infrastructure

How it works?

  • Address of proxy depends on initializer data
  • User signs authorization that delegates to this Safe proxy

Approach 1

6 of 18

Modified Safe Proxy

Approach 1

EOA

0x1122…

Proxy

0x3344…

Safe Singleton

0x5566…

7 of 18

Modified Safe Proxy

Approach 1

8 of 18

Modified Safe Proxy

Approach 1

9 of 18

Demo

Approach 1

10 of 18

Modified Safe Singleton

EOA

0x1122…

Safe Singleton

0x5566…

Approach 2

11 of 18

Modified Safe Singleton

Advantages

  • Compatible with Safe wallet
  • Has all features like existing Safe
  • Does not need use of proxy contract

Drawbacks

  • Heavy resource investment
  • Requires new audit and adjustment of formal verification

Approach 2

How will it look like?

  • A modified version of Safe singleton that is compatible with EIP-7702
  • User signs authorization that delegates to this Safe Singleton
  • User signs setup data

12 of 18

SafeLite

Tailored for EIP-7702 EOA accounts

  • EOA is by default owner
  • Supports: ERC-1271, ERC-4337
  • Not a full transition to Smart account.
  • Only to facilitate migration

Drawbacks

  • Not compatible with Safe wallet UI and existing infrastructure
  • Heavy resource investment
  • Requires new audit and adjustment of formal verification

in ~150 lines

Approach 3

Advantages

  • No setup function needed
  • Supports batching
  • Supports relaying

13 of 18

SafeLite

Approach 3

14 of 18

Challenges

Migrations from non-Safe accounts

  • Managing storage slots
  • ERC-7779

EOA Wallet support for signing authorizations

  • Authorization requires signing of a special method, which is currently not exposed by Wallets

Use of EOA private key after delegation

  • EOA private key can always be used to override/bypass Safe logic
  • Recovery is possible if the private key is lost if a recovery setup is in place
  • Not protected from theft

15 of 18

Value proposition

Entering EOA wallet ecosystem with battle tested contracts.

16 of 18

Code

Code walkthrough

17 of 18

Recap

  • EIP-7702 and its benefits
  • Approaches for EIP-7702 + Safe

1. Modified Safe Proxy

2. Modified Safe Singleton

3. SafeLite

  • Challenges

18 of 18

Thank you