Ready to Build Your Crypto Wallet?
Get expert guidance on building a secure, production-grade crypto wallet.
Complete Guide
Quick Answer
Non-custodial wallets generate keys on-device using BIP-39 (12/24 word mnemonic), BIP-32 (HD wallets), and BIP-44 (derivation paths). Keys are stored in iOS Keychain with Secure Enclave or Android Keystore. Cost: $47,000–$120,000 for mobile. Custodial wallets use HSM or MPC infrastructure, hot/cold wallet splits (2-5% hot, 95-98% cold), and multi-sig for withdrawals. Cost: $120,000–$250,000+.
Non-Custodial Wallet Architecture
Key generation:
Generate entropy (256 bits of randomness from the device's secure random number generator)
Convert to BIP-39 mnemonic (12 or 24 words)
Derive seed from mnemonic using BIP-39 PBKDF2 function
Derive master key from seed using BIP-32
Derive account keys using BIP-44 derivation path (e.g., m/44'/60'/0'/0/0 for first Ethereum account)
Key storage on device:
iOS: iOS Keychain with `.secureEnclave` protection flag (keys stored in Secure Enclave — hardware-backed, never accessible to the operating system or applications even with physical access)
Android: Android Keystore with `setUserAuthenticationRequired(true)` (biometric-protected, hardware-backed on devices with StrongBox)
Never store keys in: SharedPreferences, UserDefaults, plain database, or application storage
Multi-chain support:
EVM chains (Ethereum, Polygon, Arbitrum, etc.): same key pair, different chain ID in transactions
Bitcoin: different derivation path (m/44'/0'/0'/0/0) and different transaction format
Solana: different key format (Ed25519, not secp256k1)
Transaction signing flow:
User initiates send → app constructs unsigned transaction
Decrypt private key from Secure Enclave using biometric authentication
Sign transaction with decrypted key
Broadcast signed transaction to RPC node
Immediately clear key from memory
Custodial Wallet Architecture
Key management infrastructure:
HSM (Hardware Security Module): Keys generated and stored in FIPS 140-2 Level 3+ certified hardware. AWS CloudHSM or on-premise Thales Luna. Never exposed to software.
MPC (Multi-Party Computation) alternative: Fireblocks, Curv (now part of PayPal), or Sepior. Key shares distributed between parties — no single complete key exists.
Hot/cold wallet split:
Hot wallet: 2–5% of total assets. HSM-backed. Online for withdrawal processing.
Cold wallet: 95–98% of total assets. Offline MPC or multi-sig. Requires M-of-N human approval for withdrawal.
Automated rebalancing: When hot wallet drops below 2% of total assets, automatically queue a cold→hot transfer with human approval.
User authentication:
Username + password (bcrypt hashed minimum, Argon2 preferred)
TOTP 2FA (Google Authenticator compatible, TOTP RFC 6238)
Email confirmation for new device
Withdrawal address whitelist with 24-hour delay for new addresses
Cost Reference
Non-custodial mobile wallet (iOS + Android): $47,000–$120,000. Custodial exchange wallet infrastructure: $120,000–$250,000+ (includes HSM or MPC).