How metamask/metamask-extension works
• UI → Background Process
• Content Script → Background Process
• Background Process → Controllers
• Inter-controller Communications
• Extension → Ethereum Networks
• Extension → Hardware Wallets
• Extension → Web3 Sites
• Extension → API Services
a. Security & Privacy
• LavaMoat Security Layer
• Encryption Systems
• Permission Management
• Phishing Detection
b. Transaction Management
• Gas Fee Estimation
• Transaction Queue
• Signature Management
• Network Switching
c. Account Management
• Wallet Creation/Import
• Account Recovery
• Address Book
• Token Management
Architecture Specifics
a. Extension Architecture
• Popup UI (React/Redux)
• Background Service
• Content Scripts
• Injected Provider
b. State Management
• Redux Store
• Background State
• Persistence Layer
• State Synchronization
Integration Points
Connection points for:
• Dapp Interactions
• RPC Endpoints
• Hardware Wallets
• External Services
Security Boundaries
• Trusted Extension Context
• Untrusted Webpage Context
• Secure Storage Areas
• External Communication Boundaries
• UI Layer (React/Redux)
• Extension Architecture (Background/Content Scripts)
• Core Controllers
• External Integrations
Clear distinction between
• User-facing components
• Background processes
• Security boundaries
• External communications
Security features
• LavaMoat protection
• Encryption systems
• Permission management
• Phishing protection
Important flows
• Transaction processing
• Account management
• Network switching
• State synchronization
• Nested components
• Clear labeling
• Grouping of related components