How Bitcoin Works - 21 Lectures Learn

How Bitcoin Works

Understanding how Bitcoin works is essential for grasping its revolutionary impact on finance. Bitcoin operates on a decentralized ledger called the blockchain, which records all transactions. Miners validate transactions and secure the network through a process called Proof of Work. Users interact with Bitcoin using wallets, which store private keys granting access to their funds. Transactions are verified using cryptographic keys, ensuring security and transparency. By leveraging blockchain technology, Bitcoin offers a secure, decentralized, and transparent alternative to traditional financial systems.

Blockchain:

The blockchain is part of the basis and foundation of the Bitcoin network. It’s the ledger that tracks all transactions and interactions within the network. As the name suggests, the chain is made up of blocks connected with each other through a number hashing functionality. 

Each of them has a maximum capacity of data it can store. These blocks are being added to the chain by the miners. There is a 10-minute timeframe for each block, and if a miner successfully finds such a block, the pending transactions that users are broadcasting will be processed and added to the chain. 


This way, the blockchain becomes an eternal ledger that tracks everything that happens, and you can verify each action. Because each block has a dedicated number, the blockchain also functions as a timestamp and can link to specific events using the numbering system. 

Such events might be the Genesis block, the first-ever block in the network, or a dedicated block with a particular historical event. Think of this as a time tracking method, which also emerged in the Bitcoin community as the block-time, an alternative way to measure what is happening worldwide.

The blockchain is also the connector of all the important aspects – mainly the miners, node runners, wallets, and the consensus mechanism – that secure decentralisation for the entire network and ensure no centralised entity is abusing it. 

Wallets: 

Like your physical wallet, bitcoin wallets store access to your bitcoin. However, the bitcoin in there is not actually stored; rather, your private key provides you with access to the location of your UTXOs on the Bitcoin blockchain. 

There are different types of bitcoin wallets out there. They’re differentiated by how you access your private key and if the wallet is connected to the internet. Next to the connection, there is also the possibility to secure your wallet further with physical devices and multiple signatures to operate the wallet.

Hot Wallets: 

With a hot wallet, you’re connected to the internet and most likely use this wallet in your day-to-day business. It’s similar to a current account, which you use to spend. 

Hot wallets can be created on the fly and used on your computer or mobile device. You can always additionally secure them with a dedicated passphrase. However, it’s recommended not to use these types of wallets for larger sums. 

Cold Wallets: 

Cold wallets have the same functionality as hot wallets. However, they’re not always connected to the internet and (most of them) are additionally secured with a hardware device. Depending on the connection – there are methods to connect via cable, SD-card, or air-gapped with QR codes – cold wallets secure the private key through a simple, dedicated computer. 

Most have secure elements that sign offline transactions, meaning you must physically use the device and command the signature. Instead of entering the private keys to such wallets through a connected interface, you often can enter the seed on that hardware device and create the wallet offline.


Such devices can also be backed up and stored in a safe place, a tresor, for example, and safeguard the wallet this way. To spend the bitcoin in that wallet, you would need physical access. 

Single-Signature Wallets: 

Derived from private and public key cryptography, each wallet needs to sign transactions and inputs. It uses the private key to verify if the output is valid and broadcasts that to the network. 

Single-signature wallets only require one signature to broadcast a transaction or action within the wallet. The signature might need some physical input, depending on whether it’s a hot or cold wallet. But one signature is enough to use the wallet. 

Multi-Signature Wallets: 

Multi-signature wallets are an additional security measure to safeguard one’s bitcoin. Instead of relying on one signature to use the wallet, a user can create a setup with which you require a specific number of signatures to control the wallet. There is no limit as to how many signatures you want to use. This setup is especially interesting if you would like to mitigate risk within an organisation or further secure your bitcoin. 

How Private and Public Keys Work: 

Public and private key cryptography, a fundamental concept in bitcoin, is crucial for ensuring secure transactions and ownership of digital assets. At its core, this cryptographic system involves two types of keys: public and private keys, enabling secure digital interactions.

Private Key: 

This is a long, randomly generated string of numbers and letters akin to a complex password. It’s known only to the owner and is kept secret. The private key is central to the security of a bitcoin wallet. It’s used to sign transactions, providing mathematical proof that the transaction has come from the wallet’s owner. This signature also ensures that no one can alter the transaction once it’s been issued and verified on the blockchain. 

Public Key: 

Derived mathematically from the private key, the public key can be shared with anyone. It ensures that you own an address that can receive funds. In the Bitcoin network, the public key is transformed into a bitcoin address—a shorter, more usable version of the key.

When a transaction occurs, the sender uses the recipient’s public key to encrypt the transaction information. The recipient then uses their private key to decrypt this information and access the funds. This process ensures that only the intended recipient can access the sent bitcoin, providing a high level of security.

Furthermore, since the private key is never transmitted or revealed to anyone during the transaction, it mitigates the risk of theft or interception. This dual-key system forms the backbone of the cryptographic system that secures bitcoin, allowing for secure and trustless transactions in the digital world.

In summary, bitcoin’s public and private key cryptography enables secure transactions by allowing users to digitally sign their transactions with their private key and receive funds through addresses derived from their public key, ensuring security and user privacy.

UTXOs:

A UTXO, or Unspent Transaction Output, is a fundamental concept in the functioning of the Bitcoin network, essentially representing the currency a user can spend. Imagine Bitcoin as a digital version of cash. When you perform a transaction with cash, you hand over bills and usually receive some change back. In the Bitcoin world, UTXOs are akin to these bills and coins.

Here’s how it works: Every Bitcoin transaction consists of inputs and outputs. The inputs are the source of the funds, which are previous transaction outputs. The outputs are the destination of the funds, which could be another user’s Bitcoin address or change returning to you. A UTXO is an output from a past transaction that hasn’t been spent yet. It’s the “change” in your digital wallet waiting to be used in future transactions.

The value of a UTXO is discrete and indivisible. If you have a UTXO worth 1 BTC and want to send 0.5 BTC, the entire 1 BTC UTXO must be used. The transaction will create two new outputs: 0.5 BTC to the recipient and the remaining 0.5 BTC (minus any transaction fees) as a new UTXO, returning to your wallet as change.

Each UTXO is unique and can only be used once. The Bitcoin network keeps track of all UTXOs, and this collection of UTXOs at any given time is known as the UTXO set. This set is crucial for verifying new transactions. When you initiate a transaction, the network checks if the UTXOs you want to spend are valid and unspent. This ensures that the same bitcoins aren’t spent twice, maintaining the currency’s integrity and solving the double-spend problem.