# Primer on AA and its security implications silur@web3fc --- ## [silur@web3fc]$ whoami - Forbes 30/30 Independent consultant and developer - Quantum/Cryptography Researcher @ Wigner's institute - Ethical hacker - Co-founder @ Defaince.ai & QANplatform.com & Altcoinist.com - Co-organizer of CCTF --- ## Agenda - Account types on ETH and their shortcomings - Prior work before AA - Choosing the middle-ground - Lifecycle breakdown - Current state of AA - Usecases - Security issues solved - Security issues to remain - New security issues introduced --- ![](https://hackmd.io/_uploads/H1klu9Ykp.png) <small>source: https://takenobu-hs.github.io/</small> --- ### Contract accounts are not new Been used for Access control, recurring crypto payments etc forever, but they have UX and fee drawbacks. --- ## Goal is to combine the two account types while keeping functionality - :question: [EIP-3074 Account delegation](https://eips.ethereum.org/EIPS/eip-3074) - :heavy_check_mark: [EIP-4337 Account abstraction](https://eips.ethereum.org/EIPS/eip-4337) --- ## Prior work ![](https://hackmd.io/_uploads/ryNMzA5k6.png) <small>Source https://arxiv.org/pdf/2309.00448</small> --- ## Middle ground All EIPs so far introduce high complexity, sigcheck modifications or other components subject to miner acceptance X_X --- ## Second mempool approach ![](https://hackmd.io/_uploads/rkFABAq1a.png) --- We need a contract wallet, but a generic one so we don't have to re-implement every functionality: ```solidity! struct UserOperation { address to; bytes data; uint256 value; uint256 gas; uint256 nonce; bytes sig; } contract Wallet { function executeOp(UserOperation op); } ``` --- What about gas? ![](https://hackmd.io/_uploads/Bk4HPRcya.png) <small>Source: alchemy.com</small> --- What if you swallow my refund? ![](https://hackmd.io/_uploads/r1FmuRc1T.png) <small>Source: alchemy.com</small> --- Cherries on top: - Tx batching (BLS using BN254) - Paymasters :tada: - pay your gas in ERC20 or even fiat when combined with SIWE --- Major usecases: - Batching - Multisig - Intent-based txs - Gas-free transactions - Social recovery of lost keys - Recurring payment - Onchain subscriptions - Asset lending --- ## Current state of AA ![](https://hackmd.io/_uploads/r15BYA9yT.png) <small>source: dune.com</small> --- ![](https://hackmd.io/_uploads/rkowtRck6.png) <small>source: dune.com</small> --- ![](https://hackmd.io/_uploads/SkLFYCq1a.png) <small>source: dune.com</small> --- ![](https://hackmd.io/_uploads/B1ExaRqJa.png) Visa is heavily experimenting with the paymaster functionality --- ## Security issues solved - Tx ordering & MEV - Bundler - Timestamp randomness - Bundler - Address validation - Entrypoint - Gas bounds - Paymaster - Reentrancy :tada: - Paymaster - Trapdoor contracts - Bundler - Selfdestructs - Entrypoint - origin manipulation - Bundler --- ## Security isses to remain - Business logic bugs - Block hash manipulation & other randomness - Empty account DoS (https://eips.ethereum.org/EIPS/eip-158) - Stack limit DoS - Uninitialized vars & inconsistent returns - Type errors --- ## New security issues introduced - Mutually untrusted parties change state in the same Tx - Authentication is split between the entrypoint and offchain code - Paymasters follow a reputation system which is always gamified - AA wallets need their own replay protection - More difficult to calculate exact gas cost of UserOps - Gamification of locked funds --- - Paymaster failures can still induce charges on wallets :warning: - Possible to DoS the paymasters if `postOp` hooks are not run - Trapdoor paymasters could spend locked funds :warning: - Token Transfers can fail with no trace :warning: --- ## Conclusion - AA could be the missing key to mass adoption with better UX - But as usual, better UX implies more complex security and threat models - Time-to-market is a strong force, and security always comes last - == Expect a bunch of AA hacks :smirk: --- ## Thanks for your attention! Slides are online: ![](https://hackmd.io/_uploads/HyGq6MjJ6.png) https://silur.dev ![tg](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Telegram_Logo.webp/200px-Telegram_Logo.webp.png =32x) @Huohuli
{"title":"Primer on AA and its security implications","description":"talk slides at web3fc 2023","contributors":"[{\"id\":\"f4d4af67-750e-4c99-b33e-c04b6d99a6c6\",\"add\":4435,\"del\":125}]"}
    140 views