How does a blockchain work?

Blockchain, a type of distributed ledger built from chains of blocks, is one of the most significant technologies of recent decades. It appeared with the launch of Bitcoin in 2009, but it is now used well beyond cryptocurrencies: in decentralized financial systems, digital assets, smart contracts, traceability and other kinds of shared record-keeping. It is more than a distributed database. A blockchain combines cryptography, peer-to-peer networks, consensus mechanisms and data structures so that many participants can keep the same version of information without relying on a central authority.

The problem it solves

When several people share a record, someone has to decide which information is valid and which changes are legitimate. In a traditional database, a company, institution or administrator that controls the system plays that role. A blockchain spreads the record across many participants in a network instead. Each one can keep a copy and use predefined rules to check whether new operations meet the required conditions.

Chained blocks

Data is grouped into blocks that are linked to each other cryptographically. Each block holds a set of transactions or records plus a mathematical reference to the block before it. That reference comes from a hash function, an algorithm that turns any amount of data into a fixed-length string of characters. Change the data even slightly and the hash changes. Because every block includes the hash of the previous one, altering any part of the chain breaks the cryptographic links of every block that follows. A blockchain is not absolutely immutable, but on a sufficiently decentralized network rewriting its history is extremely difficult.

1 A user signs a transaction 2 It is broadcast to the network’s nodes 3 Nodes check that it is valid 4 Consensus puts it into a block 5 The block is added to the chain
The simplified path of a transaction, from signature to its record on the blockchain.

Consensus

New blocks are created through a consensus mechanism. With no central authority deciding which version of the record to accept, participants need a way to agree on which transactions are valid, in what order they go in and what the network's next state will be. Blockchains reach that agreement in very different ways, and the method chosen directly affects a network's security, speed, resource use and degree of decentralization.

Bitcoin uses Proof of Work. Participants called miners compete to solve a computational problem tied to creating a new block. Finding a valid solution takes enormous numbers of calculations, while checking it afterward is fairly easy. The energy and money this costs protects against certain attacks, because taking control of a large network's history would require a huge amount of computing power.

Other networks use Proof of Stake. Instead of competing with computing power, participants lock up assets as collateral to take part in validating blocks, and the protocol can financially penalize behavior it treats as fraudulent. This model has spread because it can cut the energy needed for consensus sharply, although it brings its own dynamics around governance, incentives and how power is distributed in the network.

Cryptography and nodes

Cryptography runs through the whole process. Cryptographic keys show that a person has the authority to move certain assets or act on a given address. In a cryptocurrency transaction, for example, the user signs with a private key, and network nodes check the signature with the matching public key without ever seeing the private key. The system can confirm that an operation was authorized without revealing the secret behind the authorization.

Nodes are the devices connected to the network that receive, pass on and verify information according to the protocol's rules. Depending on the blockchain, they may do different jobs and store different amounts of data. When a transaction is broadcast, the nodes that receive it can check that the signature is valid, that the funds are available and that it follows the protocol's rules. Operations that fail these checks can be rejected before they reach the shared history.

Once valid transactions are in a block the network accepts, they become part of the record. When a transaction counts as final depends on the blockchain's design. On some networks, the chance that it stays permanent grows as more blocks are added; others have mechanisms that give more explicit finality. This matters for financial applications, because being included in a block does not always mean the protocol treats the transaction as practically irreversible.

Decentralization and smart contracts

In theory, a blockchain can run without any central server controlling it. In practice, how decentralized a network is varies a lot. The number of participants, how validators are spread out, the technical requirements for running a node, how concentrated resources are and how governance is organized all shape who really has control. Saying a blockchain is decentralized does not tell you how power is distributed within it.

Some blockchains can also run smart contracts, programs stored on the chain that apply rules automatically when certain conditions are met. Ethereum made this popular by turning the blockchain into programmable infrastructure for decentralized applications. The chain then does more than record transfers of value: it keeps track of state and runs instructions that network participants can verify. This has led to digital markets, exchange systems, financial platforms and new ways of representing ownership and assets.

Limits

A blockchain does not automatically solve every problem of trust or security. Wrong information can be recorded just as permanently as correct information, so a history that is hard to change is not proof that the original data were true. There are also risks from programming errors, lost private keys, attacks on applications built on the network and badly designed economic mechanisms. The technology moves some trust onto software, mathematics, economic incentives and consensus rules, but you still need to look at who designed the system and under what conditions it runs.

A blockchain is a coordinated system for keeping a shared record among participants who do not need to fully trust one another. It brings together cryptographic structures, communication between nodes, transaction validation and mechanisms for agreeing on the network's legitimate state, which explains both what it can do and where it falls short. Its long-term importance will depend on which concrete problems it solves efficiently and whether its technical and economic costs are worth it compared with more traditional alternatives.