Seyed Masoud Hosseini · Overview · Study log · Ideas · Transcript · RSS feed

Bitcoin & Cryptocurrency Technologies · Lecture 4 of 12 · 1:21:12

Lecture 4: How to Store and Use Bitcoins

Lecture 4 — How to Store and Use Bitcoins on YouTube

Study guide

What this lecture covers

Storing Bitcoin is really about storing secret keys, since the coin's public information already lives on the blockchain. This lecture works through the practical side of Bitcoin ownership: how to keep a signing key available, secure, and convenient at the same time, and how that tension shapes real-world storage schemes. It then extends into the businesses built around key management and payments — exchanges, payment processors, and transaction fee mechanics — and closes with an economic model of the Bitcoin-to-dollar exchange rate.

After watching, you'll understand the trade-offs between local storage, hot/cold splitting, hierarchical wallets, secret sharing, and multisig; how Bitcoin exchanges function like unregulated banks and the risks that follow from that; how a merchant accepts Bitcoin payments through a payment service without taking on exchange-rate or security risk; how transaction fees are actually set; and a simple supply-and-demand model explaining what drives the Bitcoin price.

Key ideas

  • Availability, security, convenience: the three competing goals any key storage scheme has to balance.
  • Hot and cold storage: keeping a small spending balance in an online "hot" wallet and the bulk of funds in an offline "cold" wallet, similar to carrying pocket money versus a savings account.
  • Hierarchical wallets: a cryptographic trick (supported by ECDSA) that lets a hot wallet generate unlimited fresh addresses from address-generation info alone, without learning any private keys or needing repeated contact with cold storage.
  • Secret sharing: splitting a key into n shares so that any k reconstruct it but fewer than k reveal nothing, using polynomial interpolation; underlies practices like requiring 3-of-4 co-founders to sign for company funds (multisig).
  • Bitcoin exchanges as banks: they accept Bitcoin and fiat deposits and promise to pay out on demand, carrying bank-like risks (runs, fraud, cyberattacks) without bank-like regulation.
  • Proof of reserve: an exchange can cryptographically prove it holds at least a claimed amount of Bitcoin, and that a customer's account is included in its total, using a self-payment transaction and an augmented Merkle tree.
  • Payment services: intermediaries like Coinbase let a merchant receive dollars while a customer pays in Bitcoin, absorbing exchange-rate and security risk for a fee.
  • Transaction fees: paid to the miner who includes a transaction, currently based on transaction size, output value, and an age-weighted priority formula.
  • Exchange-rate model: at equilibrium, price is proportional to transaction-mediation demand (in dollars) divided by the circulating supply available for that purpose, so Bitcoin held as investment reduces effective supply and pushes price up.

Walkthrough

Simple Local Storage (0:27)

The lecture frames Bitcoin storage as key storage, since coin identity and value live on the public blockchain while only the secret signing key is truly at risk. It evaluates keeping a key file on a personal device against availability, security, and convenience: convenient, but as available and secure as the device itself, so losing or compromising the device loses or exposes the coins. Wallet software manages this in practice and encourages using a separate address and key per coin for privacy, hiding that complexity from the user.

Hot and Cold Storage (6:28)

To balance the local-storage trade-off, the lecture introduces splitting funds between a hot wallet (online, convenient, holds spending money) and cold storage (offline, holds savings). It explains hierarchical wallets: a hierarchical key-generation operation produces address-generation info and private-key-generation info separately; the address-generation info can be handed to the hot side once, after which it can generate unlimited fresh addresses on its own without ever learning private keys or needing further contact with cold storage. It then covers four ways to physically store cold information: locked devices, brain wallets (passphrase-encrypted), paper wallets (including a demonstrated example with a sealed private key), and tamper-proof hardware devices that never reveal their key.

Splitting and Sharing Keys (19:52)

Single-location key storage creates a single point of failure, so the lecture introduces secret sharing: splitting a secret into n pieces such that any k reconstruct it, but fewer than k reveal nothing. It works through the arithmetic for a 2-of-2 scheme using modular addition of a random value, then generalizes to k-of-n using polynomial interpolation (a line for k=2, a quadratic for k=3, and so on). The trade-off is that reconstructing the secret to sign still requires bringing shares together at one vulnerable point, which motivates multisig, where separate keys sign independently without ever being combined — illustrated with an example of four co-founders requiring 3-of-4 signatures to move company funds.

Online Wallets and Exchanges (30:54)

Online wallets store keys in the cloud for convenience across devices, trading that for reliance on the provider's security. Bitcoin exchanges function like banks: they accept Bitcoin and fiat deposits and promise to pay out on demand, let users trade between the two, and internally settle trades between customers without touching the blockchain. Unlike regulated banks, exchanges lack reserve requirements or deposit insurance, and the lecture notes historical failure rates (citing roughly 45% of exchanges closing due to insolvency, fraud, or breach) with Mt. Gox as the most prominent example. It closes with proof of reserve: an exchange proves it holds at least a claimed reserve via a signed self-payment transaction, and proves how many deposits it owes using a Merkle tree augmented with running total values at each node, letting any customer verify their account and total balances without a regulator.

Payment Services (50:17)

Merchants want Bitcoin payments without taking on technology, security, or exchange-rate risk, so payment services like Coinbase sit between customer and merchant: the merchant embeds a generated "pay with Bitcoin" button, the customer pays the service in Bitcoin, and the service later deposits the equivalent dollars (minus a fee) into the merchant's account. The service absorbs all the risk and must constantly convert incoming Bitcoin into dollars on the exchange markets.

Transaction Fees (58:30)

A transaction fee is the difference between input and output value, paid to whichever miner includes the transaction, compensating for the relay and block-building cost. The lecture covers the fee-free conditions in place at the time of filming (small transaction size, sufficiently large outputs, and high priority based on input age times value, divided by transaction size) and the flat per-1000-byte fee otherwise. Most miners enforce this consensus fee structure and prioritize accordingly, though some will still process unfee'd transactions eventually.

Currency Exchange Markets (1:04:09)

The Bitcoin-dollar market works like other currency markets, priced by supply and demand across various exchanges and peer-to-peer trading sites. The lecture builds a simplified equilibrium model: with T as transaction-mediation demand in dollars per second, D as the time Bitcoins are held out of circulation to mediate a transaction, and S as the supply available for that purpose, equilibrium price works out to P = T * D / S. This implies price should scale with transaction-mediation demand, and that Bitcoin held as long-term investment reduces the effective supply S, pushing price up — a simplified model that leaves out investor expectations.

Before you watch

  • Watch Lecture 1 for digital signatures, key generation, and Merkle trees, and Lecture 3 for multisig and Bitcoin transaction structure — both are referenced directly here.

Check your understanding

  1. Why is storing Bitcoins really a question of storing keys rather than storing "coins"?
  2. Explain how a hierarchical wallet lets a hot wallet generate new addresses without ever learning the corresponding private keys.
  3. In a k-of-n secret sharing scheme, why does having fewer than k shares reveal nothing about the secret?
  4. Walk through how proof of reserve lets a customer verify their deposit is included in an exchange's total without trusting a regulator.
  5. Using the equilibrium formula P = T * D / S, explain why increased investment demand for Bitcoin tends to raise its price even without any change in transaction-mediation demand.

Chapters

From the YouTube description

Fourth lecture of the Bitcoin and cryptocurrency technologies online course.

For the accompanying textbook, including the free draft version, see: http://bitcoinbook.cs.princeton.edu/

In this lecture (click the time to jump to the section):
* Simple Local Storage 0:27
* Hot and Cold Storage 6:28
* Splitting and Sharing Keys 19:52
* Online Wallets and Exchanges 30:54
* Payment Services 50:17
* Transaction Fees 58:30
* Currency Exchange Markets 1:04:09

← Lecture 3: Mechanics of Bitcoin · Lecture 5: Bitcoin Mining →