0.5 Blockchain: Bitcoin

Now that we understand cryptographic signatures and hashing, we can explore how these concepts come together to form Bitcoin, the first decentralized digital currency.

Bitcoin was introduced in 2009 by an anonymous entity known as Satoshi Nakamoto. The idea was simple yet revolutionary: a decentralized, peer-to-peer electronic cash system that allows users to transfer value without relying on a trusted third party, such as a bank. To achieve this, Bitcoin uses cryptographic techniques to ensure the security and integrity of transactions.

How Bitcoin Works

Bitcoin operates on a blockchain, a distributed ledger that records all transactions in a public and immutable way. Each transaction is broadcast to a network of computers (nodes), where it is verified, grouped into blocks, and added to the chain.

A Bitcoin transaction consists of the following:

  1. Sender and Receiver Addresses – Bitcoin addresses are derived from public keys using a cryptographic hashing function. When sending Bitcoin, a user references their address (public key hash) and specifies the recipient's address.

  2. Transaction Inputs and Outputs – As we'll see in next chapter, bitcoin transactions use an input-output model. Inputs reference previous transactions (unspent outputs), and outputs define new recipients.

  3. Digital Signatures – The sender signs the transaction with their private key, proving ownership of the Bitcoin being spent. The signature is verified using the sender’s public key.

  4. Transaction Fee – A small fee incentivizes miners to include the transaction in a block.

Mining and Proof of Work

Bitcoin relies on a Proof of Work (PoW) consensus mechanism to validate transactions and secure the network. Miners compete to solve complex mathematical problems using computational power. The first miner to solve the problem gets to add a new block to the blockchain and is rewarded with newly minted Bitcoin and transaction fees.

Here’s how mining works:

  1. Miners collect unconfirmed transactions from the network.

  2. They bundle these transactions into a candidate block.

  3. They attempt to find a nonce (a random number) that, when hashed with the block data using SHA-256, produces a hash below a predefined difficulty target, for instance ending with 30 zeros. which happens with probability p=230p=2^{-30} since we can assimilate output from cryptographic hash functions to random oracles.

  4. If a miner succeeds, the block is broadcast to the network and added to the blockchain.

  5. The miner receives a block reward, which halves every four years in an event called the halving.

Unlike fiat currencies, which can be printed at will, Bitcoin has a fixed supply of 21 million coins. This scarcity is enforced through the halving process, which reduces the mining reward every 210,000 blocks (approximately every four years). The predictable issuance schedule makes Bitcoin a deflationary asset.

Bitcoin’s security relies on decentralization. No single entity controls the network. Instead, thousands of nodes maintain copies of the blockchain and validate transactions independently. This prevents fraud, such as double-spending, where the same Bitcoin is spent twice.

Bitcoin introduced the world to the first trustless, decentralized financial system. By combining public-key cryptography, cryptographic hashing, and Proof of Work, Bitcoin creates a secure and tamper-resistant ledger.

If you want to learn about bitcoin in more depth, I'd advise starting with this video from 3Blue1Brown. In the next chapter, we will explore Bitcoin’s UTXO model.

Last updated