# Account Abstraction

#### Why Account Abstraction&#x20;

* limtations of EOAs
  * can only sign txns
  * only support one elliptic curve (secp256k1)
  * difficult seed phrase management
  * no txn batching - gas is expensive
* multi-sigs on L1
  * e.g. gnosis safe
  * cant start or sign txns
  * second class citizen on ethereum
  * limited support and flexibility
* goal of account abstraction (4337) is to make smart contract wallets first class citizens
  * customized signature verification (can use different elliptic curves)
  * transaction bundling (multicall)
  * paying fees with non-native tokens
  * payment delegation
* differences between AA on Ethereum and Starknet
  * ethereum: application layer, starknet: protocol layer
  * both support custom signatures
  * fee delegation: ethereum has paymaster smart contract, starknet has metatransactions
* signature verification and tx execution logic defined as a smart contract
* process of having to sign multiple transactions to conduct a single function (e.g. swap) exposes user to potential MEV attacks & other inefficiencies
* multicall on starknet
  * multiple steps (user operations) as a single transaction
  * create a bundle with all req. txns, and execute entire bundle at the same time in one block

<figure><img src="https://3023085841-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPx19QJfp3ypeVgsH4aV5%2Fuploads%2FOexpSv8vQoeckcc5Oyle%2Fimage.png?alt=media&#x26;token=00eac0f9-7022-4933-9319-7400d665dd3f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3023085841-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPx19QJfp3ypeVgsH4aV5%2Fuploads%2FTyn2BFYuywQm51llTqgH%2Fimage.png?alt=media&#x26;token=eb430230-ea58-44d8-a767-18cff3fc01ed" alt=""><figcaption></figcaption></figure>

* with AA, user accounts are smart contracts
* to deploy a smart contract, you need to pay gas fees
* but to pay gas fees you need a user account
* how does one deploy a user account if you dont have a user account to pay gas fees?
* solution: counterfactual deployments
  1. calculate the address off-chain
  2. send funds to the address
  3. deploy your user account
  4. starknet OS deducts gas fees
