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:

  1. WalletManager - Core wallet management functionality

  2. KeyManager - Cryptographic key management

  3. 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 OASISResult wrappers

  • Error Handling: Comprehensive error management

  • Future-Proof: Easy to extend for new providers

Fallback Chain:

  1. WalletManager - Direct wallet lookup (safest)

  2. Avatar.ProviderWallets - Fallback to avatar's provider wallets

  3. 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

  1. Private Keys: Only accessible to logged-in avatar

  2. Encryption: Private keys are encrypted in storage

  3. Access Control: Proper authentication required

  4. 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

Examples

Complete Transaction Example

Troubleshooting

Common Issues

  1. Wallet Not Found: Check if avatar has linked wallets for the provider

  2. Private Key Access Denied: Ensure you're using the logged-in avatar's ID

  3. Provider Not Supported: Verify the provider type is correct

  4. Network Issues: Check HTTP client configuration for fallback

Debug Tips

  1. Enable Logging: Use OASIS logging to track wallet operations

  2. Check Error Messages: Always check OASISResult.Message for detailed error information

  3. Verify Provider: Ensure the provider is properly configured

  4. Test Fallback: Test the fallback chain by disabling primary methods

Support

For additional support and questions:


Last updated: December 2024 Version: 1.0

Last updated