Skip to content

Conversation

@jaredvu
Copy link
Contributor

@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 Preview Comments Updated (UTC)
v4-staging Ready Ready Preview Comment Nov 26, 2025 10:29pm
v4-testnet Ready Ready Preview Comment Nov 26, 2025 10:29pm


const isCorrectWallet = localNobleWallet?.address === nobleAddress;

if (!isCorrectWallet || localNobleWallet == null) return undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant check since isCorrectWallet already checks

Derived,
}

export type EvmDerivedAddresses = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated

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.

2 participants