Asset Manager
Overview
This document outlines the design for a hub-and-spoke asset management system that enables cross-network asset transfers with optional execution of additional logic. The system consists of a central Hub Asset Manager (in Solidity) and multiple Spoke Asset Managers that can be implemented in any language/platform.
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
IConnection public connection; // Cross-chain messaging
IWalletFactory public walletFactory; // User wallet management
address public assetImplementation; // Asset token implementation
mapping(uint256 => bytes) public spokeAssetManager; // Authorized spoke managers
mapping(uint256 => mapping(bytes => address)) public assets; // Spoke assets to hub tokensTransfer 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
Last updated