Introduction
Bitcoin wallet development is one of the most technically demanding areas of software engineering in the blockchain space. The stakes are high — a bug in key management or transaction signing can result in permanent, irreversible loss of funds. The standards are exacting. And the user expectations, particularly in markets like Nigeria where Bitcoin is used for real economic activity rather than speculation, are unforgiving.
This guide covers the core technical concepts every developer needs to understand before building a Bitcoin wallet, the product decisions that determine whether a wallet actually serves its users, and the specific considerations that matter when building for African markets.
The fundamentals: keys, addresses, and UTXOs
A Bitcoin wallet does not store Bitcoin. It stores the private keys that prove ownership of Bitcoin recorded on the blockchain. Understanding this distinction is the foundation of everything else in wallet development.
A private key is a 256-bit number generated from a cryptographically secure random source. From the private key, a public key is derived using elliptic curve multiplication. From the public key, a Bitcoin address is derived through hashing. The address is what you share to receive funds. The private key is what you use to authorize spending them. The private key must never leave the secure environment where it was generated.
Bitcoin uses a UTXO model — Unspent Transaction Outputs. Your balance is not a single number stored somewhere. It is the sum of all unspent outputs from previous transactions that your keys can spend. When you send Bitcoin, you are consuming one or more UTXOs and creating new ones. A wallet must track all UTXOs associated with its keys, select the right ones for each transaction, and handle change outputs correctly.
HD wallets and key derivation
Modern Bitcoin wallets use hierarchical deterministic key derivation, defined in BIP32 and extended by BIP44. From a single seed — typically represented as a 12 or 24-word mnemonic phrase under BIP39 — an entire tree of key pairs can be derived deterministically. This means a single backup of the seed phrase recovers all keys and all funds.
For wallet developers, this means implementing BIP32 derivation correctly, following the BIP44 path structure for account and address separation, and generating new addresses for each transaction to preserve privacy. The mnemonic generation must use a cryptographically secure entropy source — this is not a place for shortcuts.
- BIP39: mnemonic phrase generation and seed derivation
- BIP32: hierarchical deterministic key derivation from seed
- BIP44: multi-account path structure (m/44'/0'/account'/change/index)
- BIP84: native SegWit (bech32) address derivation for lower transaction fees
Transaction construction and signing
Building a valid Bitcoin transaction requires selecting UTXOs to spend, constructing the transaction inputs and outputs, calculating the fee, signing each input with the corresponding private key, and broadcasting the signed transaction to the network.
Fee estimation is one of the most practically important and frequently mishandled parts of transaction construction. Bitcoin fees are denominated in satoshis per virtual byte (sat/vB). A transaction that underpays the fee may sit unconfirmed for hours or days. A transaction that overpays wastes the user's money. Good wallets query mempool fee estimates in real time and give users meaningful control over the speed/cost tradeoff.
For African users specifically, fee sensitivity matters more than in markets where Bitcoin amounts are large relative to fees. A wallet that charges 5,000 satoshis in fees on a 50,000 satoshi transaction is charging 10% — unacceptable for regular use. Implementing SegWit and eventually Taproot transaction formats reduces the byte size of transactions and therefore the absolute fee for the same fee rate.
Custody models: custodial vs non-custodial
The most consequential product decision in wallet development is the custody model. A custodial wallet holds private keys on behalf of users — the wallet provider controls the funds. A non-custodial wallet generates and stores keys on the user's device — the user controls the funds.
Custodial wallets are easier to build, easier to recover from user error, and easier to integrate with compliance requirements. They are appropriate for exchange-integrated wallets and products where the user base is not technically sophisticated enough to manage seed phrases safely.
Non-custodial wallets give users full sovereignty over their funds. They cannot be frozen, seized, or lost due to a provider's insolvency. They are appropriate for users who understand the responsibility that comes with key custody and for use cases where censorship resistance matters.
For Nigerian users, the choice is not purely technical. It reflects a real tradeoff between the risk of user error (losing a seed phrase) and the risk of counterparty failure (an exchange going insolvent or freezing withdrawals). Both risks are real and have materialized in the Nigerian market.
Building for African users: specific considerations
- Low-bandwidth environments: wallet sync must work on 3G connections. Light client implementations (SPV or Electrum protocol) are more appropriate than full node sync for mobile wallets.
- Offline transaction signing: in areas with intermittent connectivity, the ability to construct and sign transactions offline and broadcast when connectivity is available is a meaningful feature.
- Local currency display: users think in naira, not satoshis. Real-time naira/BTC conversion using reliable price feeds is a baseline expectation.
- Fee transparency: users need to understand what they are paying and why before they confirm a transaction. Opaque fee structures erode trust.
- Recovery UX: seed phrase backup and recovery must be designed for users who may not have prior experience with cryptographic key management. Clear, patient onboarding is not optional.
Security requirements
- Private keys must be stored in the device's secure enclave or equivalent hardware-backed keystore — never in plain application storage
- Mnemonic entropy must come from a cryptographically secure random number generator
- Transaction signing must happen in an isolated environment with no network access at the moment of signing
- All communication with nodes and APIs must use TLS with certificate pinning
- The application must implement jailbreak/root detection and respond appropriately
- Clipboard access for address pasting must be handled carefully to prevent address substitution attacks