How dfinity/oisy-wallet works
Project Type and Purpose
• OISY is a full-stack decentralized wallet application.
• Its goal is to provide a network-custodial wallet with multi-chain support (ICP, ICRC-1, ETH, ERC20, BTC – with more coming) utilizing features unique to the Internet Computer such as chain-key signatures and Internet Identity.
• The README emphasizes trust minimization and on-chain web serving, underpinning the secure, decentralized nature of the wallet.
Main Components
• Backend Canister: Written in Rust (under src/backend) and deployed as a canister on the Internet Computer. It handles critical operations such as tECDSA-based signatures, state management, migration routines, and token transactions.
• Frontend: Written entirely in Svelte (found under src/frontend), it consists of a rich set of UI components – from token management and exchange to wallet connectivity (including WalletConnect support). It calls upon on-chain canister APIs using JavaScript.
• Declarations and Shared Libraries: The “src/declarations” directory contains interface definitions (DID files, TypeScript definitions) that standardize communication between the frontend and backend as well as other canisters.
• Integration Modules: There are specialized folders (src/icp, src/eth, src/sol, src/cycles_ledger) that suggest dedicated modules for interacting with different blockchain networks, each containing API integrations, service layers, providers, and utilities.
• Testing and Scripts: The numerous test suites (e2e, frontend tests, backend tests) and deployment/build scripts show that the project follows a rigorous CI/CD and testing process.
• Infrastructure: Dockerfiles, dfx.json, and environment configuration files indicate containerization, local deployment, and integration with the Internet Computer Development Ecosystem.
Relationships and Interactions
• Frontend → Backend Communication: The browser-based frontend communicates with the backend canister through well-defined APIs (DID interfaces) for wallet operations, token transactions, and key management.
• Blockchain Services: The backend leverages ICP’s chain-key signature system and threshold ECDSA for distributed key custody. It calls Internet Identity for user authentication.
• External Services: The frontend also makes calls to centralized endpoints (such as Infura or Alchemy for Ethereum) – though future architecture may shift these calls to HTTP outcalls from the backend.
• Shared Modules: Libraries and shared utilities (in the “src/shared” folder) are used by both the frontend and backend canisters to standardize token formats, configuration, and cryptographic operations.
• Continuous Integration: The numerous GitHub workflows and scripts illustrate automated building, deployment, and testing processes.
Architectural Patterns and Design Principles
• Separation of Concerns: Clear division between frontend (UI/UX) and backend (business logic and cryptographic operations).
• Modular Design: Each supported blockchain (ICP, ETH, SOL, BTC, etc.) has its own dedicated modules and integration components.
• On-Chain Design: The architecture leverages ICP’s ability to serve both backend and frontend from canisters, emphasizing decentralization.
• Standardized Interfaces: Use of DID files and TypeScript declarations to ensure consistency between canister and browser communication.
• CI/CD and Testing: The inclusion of comprehensive tests and deployment scripts indicates a robust deployment pipeline.
Elements
– Frontend Canister (Svelte UI)
– Backend Canister (Rust, tECDSA, chain-key, migration)
– Blockchain Integration Modules (ICP, ETH, SOL, BTC, cycles ledger)
– Shared Libraries/Declarations (API interfaces, type schemas)
– External Services (Internet Identity, WalletConnect endpoints, centralized Ethereum providers)
– Testing & Deployment (CI/CD pipelines, Docker, dfx commands)
Final Suggestions
• Communication channels (HTTP calls, canister calls) to clearly show how the user’s actions in the browser translate to cryptographic operations and blockchain interactions.