Skip to content

refactor(onboarding): simplify onboarding side-effects and support QR code log in#1987

Open
jaredvu wants to merge 33 commits intomainfrom
jv/onboarding-refactor
Open

refactor(onboarding): simplify onboarding side-effects and support QR code log in#1987
jaredvu wants to merge 33 commits intomainfrom
jv/onboarding-refactor

Conversation

@jaredvu
Copy link
Collaborator

@jaredvu jaredvu commented Nov 17, 2025

Comparison

Aspect Old Architecture New Architecture
Encryption crypto-js with static key Web Crypto API with per-browser salt
Storage Format Encrypted signature (Redux) Encrypted private key (SecureStorage)
Restoration Decrypt signature → re-derive wallet Decrypt private key → recreate wallet directly
Import Methods Source wallet only Source wallet + Private key + Mnemonic
Cosmos Wallets Stored in state Derived on-demand
Security Static encryption key Per-browser dynamic salt
Auto-login Yes (via encrypted signature) Yes (via SecureStorage)
Logout Clear Redux state Clear SecureStorage + Redux state

Overview of Changes

Added 3 classes that help facilitate onboarding

OnboardingSupervisor

  • Central orchestrator for all wallet connection flows
  • Handles determinism checks for new users
  • Manages wallet restoration from SecureStorage
  • Coordinates between different wallet types (EVM, Cosmos, Solana, Turnkey)

DydxPersistedWalletService

  • Handles private key import, mnemonic import, and signature derivation
  • Manages SecureStorage persistence

SecureStorageService

  • Browser-native encryption using Web Crypto API
  • AES-GCM 256-bit encryption with PBKDF2 key derivation
  • Per-browser unique salt for enhanced security
  • Stores private keys encrypted in localStorage

Additional Items

  • Helpers to derive Cosmos Wallets
  • Derive using bech32 conversion where we need a cosmos wallet address instead of using in state local wallets

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
v4-staging Ready Ready Preview, Comment Jan 22, 2026 5:48pm
v4-testnet Ready Ready Preview, Comment Jan 22, 2026 5:48pm

Request Review

@jaredvu jaredvu changed the title refactor(onboarding): simplify onboarding side-effects and support permissioned key log in refactor(onboarding): simplify onboarding side-effects and support QR code log in Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant