LPsLux Proposals
Wallets & Identity
LP-41

Wallet Standards

Implemented

Interfaces and guidance for Lux wallet interoperability across chains and dApps

Category
Interface
Created
2025-01-23

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:

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

  1. Component Initialization

    • Verify correct initialization of all components
    • Test configuration validation
    • Validate error handling for invalid configurations
  2. Core Functionality

    • Test primary operations under normal conditions
    • Verify expected outputs for standard inputs
    • Test edge cases and boundary conditions
  3. Error Handling

    • Verify graceful handling of invalid inputs
    • Test recovery from transient failures
    • Validate error messages and codes

Integration Tests

  1. Cross-Component Integration

    • Test interaction between related components
    • Verify data flow across module boundaries
    • Validate state consistency
  2. Performance Tests

    • Benchmark critical operations
    • Verify performance under load
    • Test resource utilization limits