Wallets
JuliaOS provides comprehensive wallet integration features, allowing users and agents to interact with various blockchain networks securely and efficiently.
Multi-Chain Support: Comprehensive wallet support for multiple blockchain networks including Ethereum, Polygon, and Solana.
Multiple Providers: Integration with various wallet providers including MetaMask, Phantom, and Rabby.
Private Key Management: Secure private key management with encryption and key derivation.
Hardware Wallet Support: Integration with hardware wallets for enhanced security.
Transaction Signing: Robust transaction signing with support for different transaction types and formats.
Balance Tracking: Real-time balance tracking across multiple chains and tokens.
Address Management: Management of multiple addresses with labeling and organization features.
Transaction History: Comprehensive transaction history with filtering and search capabilities.
Gas Estimation: Accurate gas estimation for EVM transactions with fee optimization.
Nonce Management: Automatic nonce management to prevent transaction failures.
Concept
In the context of blockchains, a "wallet" is software or hardware that manages a user's cryptographic keys (public and private keys). The public key derives the blockchain address (where assets are held), and the private key is required to authorize transactions (sending assets, interacting with contracts).
Wallet Architecture in JuliaOS
JuliaOS implements a dual-layer wallet architecture to balance security, flexibility, and autonomy:
1. Client-Side Wallet Management (@juliaos/wallets
package)
@juliaos/wallets
package)Purpose: Allow end-users to connect their existing browser extension wallets (like Metamask, Phantom, Rabby)
Implementation: Fully implemented in TypeScript/JavaScript
Functionality: Provides a
WalletManager
class that handles:Detecting and connecting to installed browser wallets
Retrieving the user's connected address and current chain
Requesting the wallet to sign messages
Requesting the wallet to sign and send transactions (private keys never leave the user's wallet)
Handling events like account or chain changes
Multi-chain support for different wallet types
Security: High security as users maintain control of their private keys within their own wallet software
Use Case: User-initiated actions, managing personal portfolios connected to JuliaOS
2. Backend Wallet Management (Wallet.jl
module)
Wallet.jl
module)Purpose: Allow the JuliaOS backend or automated agents to manage wallets directly
Implementation: Fully implemented in Julia with comprehensive security measures
Functionality: Includes functions for:
Creating and importing wallets (from private key, seed phrase, keystore)
Securely storing encrypted private keys
Signing transactions for multiple chains
Managing wallet balances and transaction history
HD wallet derivation and management
Hardware wallet integration
Security: Implements strong encryption (AES-256), secure key storage, and optional hardware wallet support
Use Case: Automated agent operations, system-controlled accounts, trading bots
Supported Wallet Types
JuliaOS supports multiple wallet types to meet different security and usability requirements:
Client-Side Wallets
Browser Extension Wallets:
Metamask and other EVM-compatible wallets (Rabby, Frame, etc.)
Phantom for Solana
Keplr for Cosmos ecosystem
Rabby for multi-chain support
WalletConnect for mobile wallet integration
Features:
Non-custodial (user controls private keys)
Easy connection via browser extensions
Familiar user experience
Transaction confirmation in the wallet UI
Backend-Managed Wallets
Local Encrypted Wallets:
Private keys stored locally with AES-256 encryption
Password protection with PBKDF2 key derivation
Support for keystore file import/export
HD Wallets:
BIP-39 mnemonic phrase generation and recovery
BIP-32/44 derivation paths for multiple chains
Account and address management
Hardware Wallets:
Ledger integration (Nano S, Nano X)
Trezor integration (Model T, Model One)
Transaction signing on device
Address verification
In-Memory Wallets:
Temporary wallets for testing or specific operations
Keys never persisted to disk
Supported Chains
JuliaOS wallet functionality extends to multiple blockchain networks:
EVM-Compatible Chains:
Ethereum (mainnet and testnets)
Layer 2 solutions (Arbitrum, Optimism, Base, Polygon)
Alternative EVM chains (BSC, Avalanche, Fantom)
Solana:
Mainnet, Devnet, Testnet
SPL token support
Program interaction
Experimental Support:
Aptos
Sui
Cosmos ecosystem (via Keplr)
Implementation Details
Key Management
Encryption: AES-256 for stored keys
Key Derivation: PBKDF2 with high iteration count
Storage: Encrypted keystore files compatible with standard formats
Memory Protection: Secure memory handling to prevent key exposure
Transaction Signing
EVM Chains:
Support for legacy, EIP-1559, and EIP-2930 transactions
EIP-712 typed data signing
Personal message signing
Solana:
Transaction and message signing
Versioned transaction support
Partial signing for multi-signatures
Security Measures
Encryption at Rest: All private keys are encrypted when stored
Secure Input: Password input is handled securely
Timeout: Automatic session timeout for decrypted keys
Audit Logging: All wallet operations are logged (without sensitive data)
Hardware Security: Option to use hardware wallets for critical operations
Using Wallets
Client-Side Wallets (JavaScript/TypeScript)
Backend Wallets (Julia)
Python Interface
CLI Usage
Integration with Agents and Swarms
Wallets in JuliaOS are tightly integrated with agents and swarms, allowing for automated blockchain interactions:
Security Best Practices
Use Hardware Wallets for high-value operations
Strong Passwords for local wallet encryption
Backup Seed Phrases securely offline
Separate Wallets for different purposes
Regular Audits of wallet activity
Limited Permissions for agent-controlled wallets
Test Transactions before sending large amounts
Future Enhancements
Multi-signature Wallet Support: For enhanced security in automated operations
MPC (Multi-Party Computation): For distributed key management
Additional Hardware Wallet Support: Expanding hardware wallet options
Enhanced Key Recovery: Additional recovery options for lost keys
Wallet Monitoring: Real-time monitoring and alerts for wallet activity
See also:
Wallets API (Frontend) - Client-side wallet integration
Managing Wallets (CLI) - CLI wallet management
Adding New Wallet Integrations - Extending wallet support
Last updated