How no-cash-7970/duckysigner works
Project type and purpose
• This is a full-stack desktop application prototype (“Ducky Signer Prototype”) built with Wails v3-alpha.
• Purpose: a simple Algorand wallet for signing transactions on the desktop (for testing, not production keys).
File structure
Top-level directories:
• frontend – the Svelte/TypeScript UI, packaged into the Wails desktop window
• kmd – customized Algorand Key Management Daemon (KMD) code and wallet drivers (SQLite, Ledger HID)
• services – Go “Wails services” that bridge frontend events to backend logic
• build – OS-specific build definitions and scripts for packaging the app on Windows/Linux/macOS
Files:
• main.go – Wails application bootstrapping
• go.mod/go.sum – Go module definitions
• Taskfile.yml – shortcut tasks for building/testing with wails3
Key insights from README
• Uses Wails v3-alpha to combine Go backend + web-UI frontend.
• Frontend tech: Svelte + Tailwind + Vite + Vitest.
• Backend: Go modules under kmd/, services/, main.go.
• KMD code handles wallet storage & cryptography; services expose high-level RPC endpoints.
Components
a. Frontend UI (Svelte)
– Components: pages for wallet list, import/create wallet, sign transaction, account view
– Bundled via Vite into static assets, served locally by Wails
b. Wails Runtime
– Embeds a Chromium webview
– Provides bidirectional RPC between JS/TS and Go
– Handles dev mode watcher and production build packaging
c. Go Backend
– main.go: initializes Wails app, binds services
– services package:
• DappConnectService – handshake + message signing for DApp interactions
• KmdService – wallet management operations (create, open, list)
• GreetService – example/test
– wallet_session.go: per-UI session context
d. KMD Module
– config: configuration loading, error definitions
– crypto: algorand key operations, multisig support
– wallet: high-level wallet functions; delegates to driver
– driver subpackage: concrete back ends
• sqlite – persistent key storage, encrypted with Memguard integration
• ledger (HID) – hardware wallet interaction
e. Storage
– SQLite file under user home for private keys
f. External Interfaces
– (Future) Algorand node or dApp endpoints via HTTP or WebSocket
– Ledger hardware via USB/HID
g. Build & CI
– build/Taskfile.*: packaging for Linux (AppImage), macOS (plist), Windows (manifest + exe)
Relationships and Data Flows
1. User clicks button in Svelte UI →
2. Wails RPC call to Go service (e.g., KmdService.CreateWallet) →
3. Go service calls into kmd/wallet to perform storage/encryption →
4. Driver (SQLite or Ledger) persists or fetches key →
5. Response bubbles back via Wails to UI →
6. UI updates state (e.g., new wallet listed)
For transaction signing:
UI → DappConnectService → Kmd crypto → Ledger or in-memory key → returns signed txn blob → UI or external dApp
Architectural patterns & design principles
• Layered architecture: UI layer, RPC/service layer, domain module (kmd), driver layer
• Dependency inversion: services depend on wallet abstractions, not concrete storage
• Single-responsibility per package: clear separation between config, crypto, storage, UI bindings
• ADR-driven decisions documented under docs/decisions