How breadwallet/breadwallet-ios works
Main System Components
a. Core Components:
• Wallet Core (breadwallet/src/Wallet/)
• CoreSystem
• WalletInitializer
• Currency Management
• RescanCoordinator
b. Platform Services:
• Blockset Integration (External API)
• CloudKit Integration (for backup)
• Authentication Services
• Push Notification Services
c. User Interface Layer:
• View Controllers
• View Models
• Custom Views
• Widget Extension
Key Architectural Patterns to Highlight
a. Data Flow:
• How transactions flow from the blockchain through Blockset/SPV to the wallet
• Backup flow to iCloud
• Authentication flow with biometrics
b. Security Layer:
• Secure Enclave integration
• KeyStore management
• Encryption/Decryption flow
┌─ User Interface Layer ─────────────────────┐
• Home Screen │
• Transaction Views │
• Wallet Management │
• Settings & Security │
• Business Logic Layer ────────────────────┤
• Transaction Processing │
• Wallet Management │
• Currency Handling │
• Core Services Layer ────────────────────┤
• CoreSystem │
• KeyStore │
• Secure Storage │
• External Services Layer ─────────────────┤
• Blockset API │
• CloudKit │
• Push Notifications │
• ┘
Important Connections
• Secure Enclave ↔ KeyStore
• CoreSystem ↔ Blockset API
• Wallet ↔ Transaction Processing
• UI Layer ↔ Business Logic
• CloudKit ↔ Backup System
Additional Elements
• Version/environment indicators
• Critical security boundaries
• Backup paths
• User interaction points