Skip to main content

Transactions, Mining, and Consensus

How a Blockchain Stays Honest

· 3 min read

In my last post, I covered what a blockchain is conceptually: a distributed ledger that enables trust without a central authority. Now I want to dig into how it actually works. Understanding the mechanics helps explain why the system is hard to cheat.

Transactions, Mining, and Consensus

A blockchain transaction follows a specific lifecycle. It starts when someone initiates an action, whether that's sending cryptocurrency, recording a property transfer, or logging any other event the system is designed to track.

Before the transaction joins the blockchain, the network needs to verify it. The nodes, which are just computers running the blockchain software, check the transaction against the chain's history. Does this person have the funds they're trying to send? Is the data properly formatted? If the checks pass, the transaction gets approved.

Verified transactions don't go directly onto the chain. They get grouped together into a block, which you can think of as a page in the ledger. This is where mining comes in.

Mining is the process of adding a new block to the chain, and it's designed to be computationally expensive. Miners compete to solve a cryptographic puzzle related to the block. The puzzle is hard to solve but easy to verify once solved. The first miner to crack it broadcasts the solution, the network confirms it's valid, and the block gets added. The successful miner typically receives cryptocurrency as a reward.

Blockchain Transaction

This approach is called Proof of Work (PoW), and it's the original consensus mechanism that Bitcoin uses. The computational cost is a feature, not a bug. It makes it expensive to tamper with the chain because you'd need to redo the work for every block you wanted to change, plus outpace everyone else adding new blocks.

The downside is energy consumption. PoW requires enormous computational power, which has drawn environmental criticism.

Proof of Stake (PoS) emerged as an alternative. Instead of competing through computation, validators are selected based on how much cryptocurrency they're willing to lock up as collateral. The more you stake, the higher your chance of being chosen to validate the next block. It achieves similar security guarantees with a fraction of the energy cost.

Some blockchains use Byzantine Fault Tolerance (BFT) mechanisms, which require a supermajority of nodes to agree before any decision is made. The name comes from the Byzantine Generals Problem in distributed computing, which asks how you can coordinate action when some participants might be unreliable or malicious.

Once a block is added and confirmed by the network, the transaction is final. The data becomes part of an immutable record, secured by the collective agreement of everyone running the system.

The elegance of this design is that no single entity controls the outcome. Truth emerges from consensus, and the consensus is enforced by math and economic incentives.

In the final post of this series, we'll look at what blockchain can do beyond cryptocurrency, and where the technology still falls short.