Introduction
The shift from Externally Owned Accounts (EOA) to Smart Contract Accounts (SCA) is gaining momentum, embraced by enthusiasts like Vitalik Buterin. Despite the excitement, SCA adoption faces challenges such as bear markets, migration concerns, signing issues, gas overheads, and engineering difficulties.
Modular Account Abstraction (Modular AA) emerges as a solution, separating smart accounts from their custom functions to create a modular, secure, and interoperable structure. This article explores:
- What Modular Account Abstraction is.
- How accounts interact with modules.
- The sequence of calling modules.
- Open discovery and verification of modules.
A Brief Review of Account Abstraction
SCA Landscape
Traditional EOAs introduce challenges like seed phrases, gas fees, and cross-chain complexities. Account Abstraction leverages smart contract accounts for programmable validation and execution, improving user experience (e.g., gas abstraction, session keys), cost efficiency (e.g., batched transactions), and security (e.g., social recovery, multi-sig).
Current Approaches to AA
- Protocol Layer: Native AA support in protocols like ZKsync and Starknet.
- Contract Layer: ERC-4337 enables AA on Ethereum and L2s without consensus-layer changes. Projects like Stackup, Alchemy, and Safe are building infrastructure.
๐ Learn more about AA and ERC-4337
The Dilemma of SCA Adoption
Despite discussions since 2015, SCA adoption lags due to:
- Bear Market Impact: Educated EOA users dominate, reducing incentives for dApps/wallets.
- Migration Obstacles: Secure asset migration from EOAs remains challenging.
- Signing Issues: SCAs lack private keys, complicating message signing.
- Gas Overheads: Higher deployment and execution costs deter adoption.
- Engineering Difficulties: Fragmented standards and integration hurdles.
This article focuses on engineering challenges and Modular AA as a solution.
Modular Smart Contract Account Architecture
Modular AA addresses:
- Fragmentation: Standardized interfaces prevent vendor lock-in.
- Security: Independent audits mitigate risks.
- Upgradability: Reusable cores and proxy contracts enable seamless updates.
Key Components
- Proxy Contracts: Delegates calls to logic contracts for upgradability.
- Modules: Plugins, hooks, and validators customize functionality.
Modular Structures in Practice
Safe Architecture
- Proxy Account: Delegates calls to a singleton contract.
- Modules: Plugins, hooks, and handlers enable composability.
๐ Explore Safeโs modular design
ERC-2535 Diamond Proxies
- Diamond Proxy: Calls multiple stateless facets.
- Flexibility: Dynamic upgrades via
diamondCut.
Comparison
| Feature | Safe Architecture | Diamond Proxies |
|---|---|---|
| Upgradability | Singleton redeploy | Direct diamondCut |
| Security | Centralized logic | Risk of collisions |
| Cost Efficiency | High | Variable |
Modules Sequence: Validation, Execution, and Hooks
ERC-6900 standardizes:
- Validation: Authenticates transactions.
- Execution: Custom logic (e.g., payments).
- Hooks: Pre/post-execution checks.
Example flow:
- Validate โ Execute โ Hook.
- Standardization reduces ecosystem fragmentation.
Modules Discovery and Security
Safe{Core} Protocol
- Registries: App stores for verifiable modules.
- Attestations: Auditors verify security.
Rhinestone Design
- Schema-Based Modules: Custom logic via resolvers.
- Decentralized Attestations: Cross-chain verification.
Closing Thoughts
Modular SCAs unlock:
- Developer Freedom: Focus on UX, not maintenance.
- User Customization: Easy upgrades and module swaps.
Challenges remain:
- Balancing flexibility/security.
- Advancing modular standards.
- Cross-chain SCA synchronization.
The future hinges on L2 support, robust bundlers, and intent-based transactions.
FAQs
1. What is Modular Account Abstraction?
Modular AA separates smart accounts from their functions, enabling customizable, secure, and interoperable wallets.
2. How do proxy contracts work?
Proxy contracts delegate calls to logic contracts, enabling upgradability without redeployment.
3. Whatโs the role of ERC-6900?
It standardizes module interfaces (validation, execution, hooks) to reduce fragmentation.
4. How are modules discovered?
Registries (e.g., Safe{Core}) act as app stores for audited modules.
5. Can modules be upgraded?
Yes, via proxy mechanisms like diamondCut (Diamond) or singleton redeploys (Safe).