Back to How-To Guides
HOW-TO10 min read2025-06-23

How to Build a Crypto Wallet — Non-Custodial vs Custodial Architecture Guide

Building a crypto wallet requires choosing between custodial (you hold keys) and non-custodial (user holds keys) architecture — and this choice determines every subsequent technical decision. Here is the complete technical guide for each model.

ClickMasters Team
Step-by-step implementation
Expert Assistance

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).

Frequently Asked Questions

Common questions before following this guide

Clear answers to the most common practical, technical, and implementation questions.

2

Answers

What BIP standards do production wallets use?

BIP-32 (HD wallet key derivation), BIP-39 (mnemonic seed phrases), BIP-44 (multi-account HD wallet derivation paths), BIP-49 (P2SH-P2WPKH Bitcoin compatibility), BIP-84 (native segwit Bitcoin), BIP-141 (SegWit). For Ethereum specifically: EIP-55 (checksum addresses), EIP-155 (chain replay protection), EIP-1559 (transaction fee structure).

Should I build or use WalletConnect?

For a custom wallet app that users will use to interact with dApps: integrate WalletConnect 2.0. Without WalletConnect, your wallet cannot connect to any external dApp — severely limiting its utility.

Expert Assistance

Ready to Build Your Crypto Wallet?

Get expert guidance on building a secure, production-grade crypto wallet.