Hub Asset Manager
System Design
Core Components
The hub asset manager maintains several key components:- Connection Module: Handles cross-chain message verification
- Wallet Factory: Generates deterministic user wallets on the hub chain
- Asset Tokens: Manages wrapped versions of spoke chain assets
- Network Mappings: Maps spoke chain asset managers and their assets
State Variables
Transfer Data Structure
Core Operations
- Receiving Cross-Chain Transfers
- Initiating Cross-Chain Transfers
Spoke Asset Manager Specification
Required Implementation
Spoke chains must implement an asset manager that can:- Receive and verify cross-chain messages from the hub
- Lock/unlock native assets
- Send properly formatted messages to the hub
- Enforce rate limits on withdrawals
Required Functions
- Receive Message
- Send Transfer
Security Considerations
- Hub Chain
- Only authorized spoke managers can send messages
- Asset tokens must be properly wrapped/unwrapped
- Wallet hooks must be properly validated
- Spoke Chains
- Must verify messages come from hub
- Must properly lock/unlock native assets
- Must implement proper access controls
- Must enforce rate limits on withdrawals
- Must use consistent function naming (recvMessage)
- Cross-Chain
- Asset mappings must be carefully managed
- Withdrawal limits must be properly configured and enforced