OASIS Wallet Management System
Overview
The OASIS Wallet Management System provides a comprehensive solution for managing wallets, cryptographic keys, and wallet addresses across multiple blockchain providers. This system is designed to be secure, scalable, and easy to use for developers.
Architecture
The wallet management system consists of three main components:
WalletManager - Core wallet management functionality
KeyManager - Cryptographic key management
WalletHelper - Generic helper with fallback chain for wallet lookup
Components
1. WalletManager
The WalletManager is the core component for managing wallet objects and wallet addresses across different providers.
Key Features:
Wallet Address Management: Get wallet addresses for avatars
Provider Support: Works with all OASIS blockchain providers
Default Wallet Selection: Automatically selects the best wallet for transactions
Cross-Provider Support: Manages wallets across multiple blockchain networks
Main Methods:
Usage Example:
2. KeyManager
The KeyManager handles cryptographic keys (public and private keys) for secure operations.
Key Features:
Key Management: Manages public and private keys
Security: Private keys are encrypted and only accessible to logged-in avatar
Provider Support: Works with all OASIS blockchain providers
Authentication: Handles key-based authentication
Main Methods:
Usage Example:
3. WalletHelper
The WalletHelper is a generic helper class that provides a robust fallback chain for wallet lookup across all providers.
Key Features:
Generic: Works across all OASIS providers
Robust Fallback: 3-tier fallback chain for maximum reliability
OASIS Standards: Proper
OASISResultwrappersError Handling: Comprehensive error management
Future-Proof: Easy to extend for new providers
Fallback Chain:
WalletManager - Direct wallet lookup (safest)
Avatar.ProviderWallets - Fallback to avatar's provider wallets
HTTP Client - Final fallback to WEB4 OASIS API
Main Methods:
Usage Example:
Best Practices
When to Use Each Component
🏆 Use WalletHelper for Wallet Addresses
Best for: Getting wallet addresses for transactions
Benefits: Robust fallback, cross-provider support, error handling
Use Case: Transaction sending, wallet lookup, cross-provider operations
🔑 Use KeyManager for Cryptographic Keys
Best for: Signing transactions, encryption, authentication
Benefits: Secure key management, encrypted storage
Use Case: Transaction signing, key-based authentication
💰 Use WalletManager for Direct Wallet Management
Best for: When you need full wallet objects
Benefits: Direct access to wallet properties
Use Case: Wallet management, detailed wallet information
Security Considerations
Private Keys: Only accessible to logged-in avatar
Encryption: Private keys are encrypted in storage
Access Control: Proper authentication required
Error Handling: Comprehensive error management
Error Handling
All components use OASISResult<T> wrappers for consistent error handling:
Integration with Providers
The wallet management system is integrated with all OASIS blockchain providers:
EthereumOASIS - Ethereum blockchain
SOLANAOASIS - Solana blockchain
ArbitrumOASIS - Arbitrum Layer 2
PolygonOASIS - Polygon blockchain
OptimismOASIS - Optimism Layer 2
BNBChainOASIS - BNB Smart Chain
FantomOASIS - Fantom blockchain
AvalancheOASIS - Avalanche blockchain
EOSIOOASIS - EOSIO blockchain
TRONOASIS - TRON blockchain
HashgraphOASIS - Hashgraph blockchain
AptosOASIS - Aptos blockchain
BitcoinOASIS - Bitcoin blockchain
CardanoOASIS - Cardano blockchain
NEAROASIS - NEAR Protocol
CosmosOASIS - Cosmos blockchain
PolkadotOASIS - Polkadot blockchain
ActivityPubOASIS - ActivityPub protocol
Related Documentation
Examples
Complete Transaction Example
Troubleshooting
Common Issues
Wallet Not Found: Check if avatar has linked wallets for the provider
Private Key Access Denied: Ensure you're using the logged-in avatar's ID
Provider Not Supported: Verify the provider type is correct
Network Issues: Check HTTP client configuration for fallback
Debug Tips
Enable Logging: Use OASIS logging to track wallet operations
Check Error Messages: Always check
OASISResult.Messagefor detailed error informationVerify Provider: Ensure the provider is properly configured
Test Fallback: Test the fallback chain by disabling primary methods
Support
For additional support and questions:
GitHub Issues: OASIS GitHub Issues
Documentation: OASIS Documentation
Community: OASIS Community
Last updated: December 2024 Version: 1.0
Last updated