$ account unicity-sphere
Unicity Sphere is a self-custodial Web3 wallet and agent platform implemented as a React 19 single-page application. It provides wallet creation/restore (with mnemonic backup, password, and file import), direct messaging and group chat (via Nostr relays), a marketplace for agents and apps with reviews and quests, dApp connectivity through the Sphere Connect protocol (iframe agents and popup), and subscription-based quota management for aggregator API access. The architecture is a client-side SPA with a desktop-like shell (tabs, taskbar, wallet panel) using TanStack Query for server state, Framer Motion for animations, and Tailwind CSS for styling. Key entry points include the onboarding flow (CreateWalletFlow), the main wallet panel (WalletPanel), the Connect provider (ConnectProvider), and the desktop layout (DesktopLayout). External dependencies include the @unicitylabs/sphere-sdk for core wallet operations, a local @unicitylabs/sphere-ui package, REST APIs for marketplace and subscription gateway, and Sentry for error monitoring. The codebase has extensive unit and e2e test coverage with a strong focus on security invariants (duplicate send guards, settle shields, origin verification), though a security audit identified 131 findings including unencrypted seed storage and phishing risks. The project is actively maintained with frequent commits and issue triage, but exhibits tight coupling to the SDK and complex state machines that pose maintenance risks.
A comprehensive set of four self-contained example applications demonstrating the Sphere Connect protocol for integrating dApps with the Sphere wallet. The examples cover a browser dApp (React/Vite), a Node.js CLI dApp over WebSocket, an autonomous bot that runs its own wallet (direct SDK, no Connect), and a backend-auth flow where a frontend brokers a wallet signature and a backend verifies it cryptographically to issue a JWT. The codebase is a multi-package monorepo, each package pinned to the same SDK version (0.14.2), with extensive test coverage, CI/CD, and detailed documentation. The overall architecture is clean and well-structured, exhibiting high engineering craftsmanship in areas like money-safety (duck-typed detection of possibly-committed sends), exact string-based unit conversion, and byte-exact challenge reconstruction for signature verification.