Skip to content

How Blockchain Works: Transactions, Blocks and Consensus

Learn how signed transactions become blocks, how consensus selects an accepted history, and where blockchain security, decentralization and scaling have limits.

How does blockchain work? A blockchain is a replicated digital ledger in which cryptographically signed transactions are validated under shared rules, grouped into ordered records and linked to prior history. Participants use consensus and fork-choice rules to decide which valid history the network accepts.

That definition is more precise than calling blockchain an “unchangeable database.” Blockchains are designed to be tamper evident and tamper resistant, but their security depends on software, cryptography, incentives, governance and the distribution of control. Different networks make different trade-offs.

How blockchain works at a glance

  1. A user or application constructs a transaction.
  2. The controlling account or key signs the required data.
  3. The transaction is sent to one or more network nodes.
  4. Nodes check signatures, balances or spendable inputs and other protocol rules.
  5. A miner, validator or designated producer proposes a block.
  6. Other participants verify the block and apply the consensus rules.
  7. The accepted block updates the ledger state and references prior history.
  8. Later blocks or finality votes increase confidence that the transaction will not be reorganized.

The exact sequence varies. Bitcoin uses proof of work and an unspent-transaction-output model. Ethereum uses proof of stake and an account-based state model. Permissioned business ledgers may use identified validators and different consensus protocols.

What information does a blockchain record?

A blockchain records transactions or state transitions according to its protocol. A block normally contains a header with metadata, a reference to a prior block and a commitment to the included transactions. It may also contain timestamps or slot information, validator data and other network-specific fields.

The ledger does not necessarily store ordinary names, legal ownership records or the full files associated with a token. An address is usually pseudonymous, and off-chain facts require external data sources. A blockchain can prove that certain bytes were recorded under its rules; it cannot independently prove that an external claim was truthful.

Step 1: creating and signing a transaction

A wallet or application constructs a transaction containing network-specific fields. These may include a destination, amount, fee settings, account nonce, references to previous outputs and optional smart-contract data.

The user’s private key creates a digital signature over the defined transaction message. Nodes use the corresponding public-key information to verify authorization without learning the private key. The transaction is not generally encrypted; its contents may become public.

Our guide to public and private keys explains this distinction in detail.

Step 2: broadcast and independent validation

The wallet submits the signed transaction to a node, which checks it against protocol rules. A Bitcoin node may verify that referenced outputs exist, remain unspent and can be unlocked by the supplied data. An Ethereum node checks the signature, nonce, fee fields and whether the sender can cover the transaction’s maximum cost.

A valid pending transaction can be shared with peer nodes and held in local memory pools. There is no single universal mempool: nodes may see different pending transactions, apply different relay policies or drop transactions under load.

Validity does not guarantee rapid inclusion. Block producers choose transactions under protocol limits and economic policies. Users may compete for limited block space through fees, as explained in our blockchain gas-fee guide.

Step 3: building a block

A selected or successful block producer chooses valid transactions and orders them. It computes the resulting data commitments or state changes and constructs a candidate block. Other nodes do not simply trust this producer; they recheck the block before accepting it.

ComponentRole
TransactionsAuthorized requests or records processed in a defined order
Previous-block referenceCryptographically links the candidate to an earlier block
Transaction commitmentAllows nodes to verify the included transaction set
Consensus dataProof-of-work value, validator signature, attestations or other protocol fields
State commitmentOn some networks, summarizes the resulting account or contract state

Step 4: hashes link the history

A cryptographic hash function maps data to a fixed-length output. Changing the block data changes its hash with overwhelming probability. Because a later block references its parent, altering an earlier block breaks the references that follow it.

This makes tampering detectable, not magically impossible. An attacker attempting to rewrite history must also satisfy the network’s consensus rules and overcome the honest chain’s work, stake or validator decisions. The cost and feasibility depend on the network’s design and control distribution.

Step 5: consensus selects an accepted history

Consensus is the combination of rules that lets distributed participants converge on valid ledger history despite delays, faults and competing proposals. It covers more than checking individual transactions: nodes need a way to choose between valid branches and determine when a result is sufficiently settled.

Proof of work

In proof of work, miners repeatedly hash candidate block data while changing a nonce or related fields. A block is eligible when its hash satisfies the network difficulty target. Nodes verify the proof cheaply and follow the protocol’s chain-selection rule, commonly summarized as the valid chain with the most accumulated work.

Mining is not solving a useful algebra problem or manually validating each transaction. Specialized hardware performs a competitive search. Energy use, hardware concentration and mining-pool coordination are important trade-offs.

Proof of stake

Proof of stake uses locked economic value and protocol-selected validators rather than mining work. It is inaccurate to say the richest holder simply creates every block. Selection, committees, attestations, penalties and finality rules vary by protocol.

On Ethereum, validators deposit ETH, one proposer is selected for a slot and other validators attest to valid blocks. Conflicting or dishonest behavior can trigger penalties or slashing. Our staking guide covers the user-facing risks.

Confirmations, reorganizations and finality

Two valid blocks can occasionally compete at the same height because network messages take time to propagate. Nodes apply fork-choice rules and one branch may be abandoned. Transactions in an abandoned block can return to a pending state or appear in the winning branch.

For proof-of-work chains, each block added after a transaction usually increases the work an attacker would need to replace its history. “Six confirmations” is a convention in some Bitcoin contexts, not a universal guarantee for every value and threat model.

Some proof-of-stake protocols add explicit economic finality. Ethereum validators vote on checkpoints, and finalizing conflicting history would require severe protocol violations and large slashable stake. Applications choose their own acceptance threshold based on risk.

What nodes actually do

  • Full nodes independently verify blocks and transactions according to protocol rules.
  • Archive nodes retain additional historical state useful for complex queries.
  • Light clients verify selected commitments and request data without storing or executing everything.
  • Miners or validators participate in block production and consensus, but they cannot make invalid blocks acceptable to correctly verifying nodes.
  • RPC providers give applications network access; relying on one provider reintroduces a service dependency.

A blockchain can be distributed without being meaningfully decentralized in every dimension. Node count, validator concentration, client diversity, governance, hosting and bridge dependencies all affect control.

Smart contracts and tokens

A smart contract is code stored and executed under a blockchain’s rules. A transaction can call a contract, which reads state, checks conditions and writes permitted changes. Every validating node reaches the same result for deterministic execution.

Smart contracts do not know real-world facts unless an oracle or authorized participant supplies them. Bugs, privileged upgrade keys, governance attacks and incorrect oracle data can produce valid but unwanted outcomes. Blockchain consensus confirms execution; it does not certify that the application is safe or fair.

This distinction is central to decentralized finance, where users may interact directly with contracts but still rely on code, interfaces, stablecoins, bridges and governance.

Public, permissioned and hybrid ledgers

ModelTypical accessMain trade-off
Public permissionlessAnyone can usually read, submit transactions and run a verifying nodeOpen participation with performance, privacy and governance constraints
Public permissionedPublic read access, but selected entities validateEasier coordination with more concentrated control
Private consortiumApproved organizations operate and access the ledgerBusiness privacy and throughput, but trust rests in known members
HybridSome data or proofs are public while sensitive records stay elsewhereComplex integration and boundary assumptions

Scaling beyond the base chain

Base layers limit block size, computation or data throughput so ordinary participants can verify the system. Higher demand can increase fees and delay inclusion. Scaling approaches include more efficient base-layer execution, payment channels, sidechains and rollups.

A layer 2 may execute transactions elsewhere and post data or proofs to the base chain. Users must understand the system’s sequencer, fraud- or validity-proof design, data availability, bridge and withdrawal rules. “Uses Ethereum” does not mean every layer 2 has identical security.

What blockchain is good at—and what it is not

Potential strengthImportant limitation
Shared transaction history across organizationsParticipants still need governance and accurate inputs
Independent verificationRunning verification has hardware, bandwidth and expertise costs
Programmable settlementCode defects and privileged controls remain risks
Tamper-evident recordsFalse data can be recorded faithfully
Open asset transferPrivacy, compliance, usability and key recovery can be difficult

A conventional database is often better when one trusted organization controls the process, records must be edited or deleted, privacy is essential, or high throughput and simple recovery matter most. Blockchain is useful when multiple parties need a shared rule set and the cost of distributed verification is justified.

Security misconceptions

  • “Blockchain cannot be hacked.” Protocols, bridges, wallets, contracts and services can all fail or be compromised.
  • “Every node stores everything forever.” Storage roles and pruning policies vary.
  • “Consensus proves a claim is true.” Consensus proves participants accepted data under protocol rules.
  • “Public means anonymous.” Addresses are usually pseudonymous and activity can be analyzed.
  • “Decentralized means no intermediaries.” Interfaces, RPC services, custodians, oracles and bridges may remain central dependencies.

Frequently asked questions

Can old blockchain data be changed?

Changing accepted history requires producing an alternative history that wins under the network’s rules. The difficulty increases with accumulated work, stake-backed finality and honest participation, but it is better described as tamper resistant than absolutely immutable.

Who controls a blockchain?

Control is divided among software developers, node operators, miners or validators, users, exchanges and governance bodies. The balance differs by network. No single metric proves decentralization.

Why do blockchains need fees?

Fees ration limited block space, compensate participants under some protocols and discourage spam. The exact allocation and calculation depend on the network.

Is a blockchain the same as cryptocurrency?

No. A blockchain is a ledger and consensus design. A cryptocurrency is an asset or accounting unit used by a network. Some distributed ledgers are permissioned and do not expose a public cryptocurrency.

Conclusion

Blockchain works by combining signed transactions, independent validation, cryptographic links, replicated state and consensus rules. Those components make accepted history costly or procedurally difficult to rewrite while allowing participants to verify the same system without trusting one database operator.

The design does not eliminate trust or guarantee good data. It moves trust into software, cryptography, incentives, governance and the distribution of participants. NIST’s Blockchain Technology Overview and Ethereum’s block documentation provide deeper technical references.

Comments

Leave a Reply