Wallet Standards
Interfaces and guidance for Lux wallet interoperability across chains and dApps
Abstract
Defines interfaces and guidance for Lux wallet interoperability across chains and dApps.
Motivation
Consistent wallet behavior and interfaces reduce integration friction, improve UX, and enhance security across the ecosystem.
Specification
This LP's normative content is the set of algorithms, data models, and parameters described herein. Implementations MUST follow those details for interoperability.
Implementation
Wallet Standard Contracts
Location: ~/work/lux/standard/src/wallets/
(~/work/lux/standard/contracts/wallets)
Core Wallet Interfaces:
ILuxWallet.sol- Base wallet interfaceIMultiChainWallet.sol- Cross-chain wallet supportIWalletFactory.sol- Wallet deployment factory
Testing:
cd ~/work/lux/standard
forge test --match-contract WalletTest
forge coverage --match-contract Wallet
Rationale
Design choices favor simplicity and reliability while meeting Lux performance and ecosystem requirements.
Backwards Compatibility
Additive change; existing APIs and formats remain valid. Adoption is opt-in.
Security Considerations
Consider typical threat models (input validation, replay/DoS resistance, key handling). Apply recommended safeguards outlined in the text:
- Strict input validation for all external calls
- Replay protection via nonces and chain IDs
- Secure key derivation using BIP-39/BIP-44 standards
- Hardware wallet support via standard signing interfaces
Test Cases
Unit Tests
-
Component Initialization
- Verify correct initialization of all components
- Test configuration validation
- Validate error handling for invalid configurations
-
Core Functionality
- Test primary operations under normal conditions
- Verify expected outputs for standard inputs
- Test edge cases and boundary conditions
-
Error Handling
- Verify graceful handling of invalid inputs
- Test recovery from transient failures
- Validate error messages and codes
Integration Tests
-
Cross-Component Integration
- Test interaction between related components
- Verify data flow across module boundaries
- Validate state consistency
-
Performance Tests
- Benchmark critical operations
- Verify performance under load
- Test resource utilization limits