Private & Public Key Pairs

At the core of every crypto wallet is a key pair generated using public-key cryptography (specifically elliptic curve cryptography for Bitcoin and Ethereum). The process works like this:

  1. A private key is generated — a random 256-bit number, essentially a very large random number.
  2. A public key is mathematically derived from the private key using the elliptic curve algorithm. This is a one-way process — you cannot reverse-engineer the private key from the public key.
  3. A wallet address is created by hashing the public key (for Bitcoin, through SHA-256 and RIPEMD-160; for Ethereum, through Keccak-256).

One-way math: The relationship between private and public key is mathematically one-directional. Even with all the world's computers, deriving a private key from a public address is computationally infeasible.

Transaction Signing

When you want to send cryptocurrency, your wallet doesn't transmit your private key — it uses it to sign a transaction message:

  1. You initiate a transaction: "Send 0.5 ETH to address 0xABC..."
  2. Your wallet creates a digital signature using your private key and the transaction data.
  3. The signed transaction is broadcast to the blockchain network.
  4. Nodes verify the signature using your public key — confirming you authorized the transaction without ever seeing your private key.
  5. Once verified, miners/validators include it in a block.

Hierarchical Deterministic (HD) Wallets

Modern wallets use a BIP-32/BIP-44 standard called HD (Hierarchical Deterministic) wallets. Instead of generating random individual keys, an HD wallet generates a tree of keys from a single master seed:

  • One seed phrase (12 or 24 words) generates billions of key pairs.
  • Each blockchain can have its own derivation path (e.g., m/44'/60'/0'/0 for Ethereum).
  • Back up just one seed phrase — recover all your accounts on any HD-compatible wallet.

Connecting to the Blockchain

Your wallet needs to communicate with the blockchain to check balances and broadcast transactions. It does this by connecting to one of:

  • Full node — Downloads the entire blockchain. Most private but resource-intensive.
  • Light client (SPV) — Verifies transactions without downloading everything. Used by most mobile wallets.
  • RPC provider — Connects to a third-party node (e.g., Infura, Alchemy). Convenient but requires trust in the provider.

Gas Fees and Transaction Priority

Most blockchains require a fee (called "gas" on Ethereum) to process transactions. Your wallet calculates and lets you set:

  • Base fee — Set by the network, burned on Ethereum (EIP-1559).
  • Priority fee (tip) — Optional incentive for validators to include your transaction faster.

Higher fees = faster confirmation. During network congestion, fees can spike significantly.