Metaexplorer
Blockchain fundamentals

What Is Blockchain and How Does It Work?

What this article covers

What this article explains
It explains what a blockchain is, how blocks are linked by hashes and how independent computers agree on one shared history.
What it does not cover
It gives no investment, financial, tax or legal advice. It describes no way to buy, sell or hold anything, and it compares no named products.
Who wrote it
Leyla Bektas, writing for Metaexplorer.
Last reviewed

A blockchain is a shared digital record that many independent computers store and verify at the same time. Records are grouped into blocks, and each block carries a cryptographic hash of the block before it. The blocks therefore form a chain in a fixed order. On a public network every participant keeps a complete copy, so no single operator controls the result.

A blockchain works by collecting proposed transactions, checking them against shared rules and storing them in numbered blocks. A consensus mechanism decides which block extends the chain, so the copies held by participants show the same order.

What is a blockchain?

A blockchain is a type of database that stores records in linked blocks and copies them to many independent computers. Each computer applies the same rules, which decide what is valid and how a new block joins the chain. A block is a set of validated records that the network accepts together, and it names the previous block by its hash.

Key points

  • Records are stored in blocks that reference each other in a fixed order.
  • Many independent computers hold the same records and verify them separately.
  • Earlier records remain in place, and corrections are added as new records.

How does blockchain work, step by step?

The mechanism has three parts: the creation and signing of a transaction, independent checking by many computers and selection of the block that stores it. No central server decides the outcome, because every computer applies the same published rules to the same data. The stages below describe that sequence in order.

  1. A participant's software creates a transaction, which is an instruction to change the recorded state.
  2. The software signs the transaction with a private key, and any computer can verify that signature.
  3. The signed transaction is transmitted to neighbouring computers on the network.
  4. Each computer checks the signature and the rules, and valid transactions wait in a local pool.
  5. The consensus mechanism selects which computer may propose the next block.
  6. That computer assembles pending transactions into a candidate block that includes the previous hash.
  7. Other computers verify the candidate block and add it to their copy of the chain.
  8. Later blocks extend the chain, and reversing the recorded order becomes progressively harder.

Key points

  • Validation occurs on many computers separately, not at one central point.
  • One participant proposes a block, and the others verify it.
  • Every accepted block stores the hash of the block before it.

What is inside a block?

A block contains a header and a body. The header describes the block, and the body holds the transactions that the block stores. Other blocks reference the header, because hashing the header commits to everything inside the block. Field names differ between networks, and the elements listed below describe the structure in general terms.

Previous block hash
The hash of the preceding header, which fixes this block's position in the sequence.
Timestamp
A value recording approximately when the block was produced.
Root hash of the transactions
One hash that summarises every transaction, so a change to any of them alters it.
Consensus data
Values required by the consensus mechanism, such as a counter or a validator signature.

Key points

  • The header identifies the block and links it to the previous block.
  • The body holds the transactions in a defined order.
  • A single summary hash commits to the whole transaction list.

What does a cryptographic hash do?

A cryptographic hash function converts data of any size into a short value of fixed length that identifies that exact input. The same input always produces the same output, and no practical method leads from the output back to the input. A block therefore commits to its contents, because any participant can recompute the hash.

The National Institute of Standards and Technology defines the SHA-256 function in its Secure Hash Standard. That standard specifies an output of 256 bits for the function. A hexadecimal representation of such an output has 64 characters. Changing a single bit of the input changes the output unpredictably.

Key points

  • A hash is a fixed-length value derived from data of any size.
  • The same input always yields the same hash value.
  • Any alteration of a record produces a different and unrelated hash.

What is a distributed ledger?

A distributed ledger is a record kept as identical copies by several independent participants rather than in one central system. Each participating computer is a node, which stores the ledger and applies the network rules. No copy is treated as the master copy. A blockchain is one way to build such a ledger, and a full node can verify every record for itself.

A permissionless ledger accepts any computer under the published rules, and a permissioned ledger restricts participation to approved organisations.

Key points

  • Identical copies of the record are held at many independent locations.
  • A full node stores the whole history and verifies it independently.
  • Permissionless and permissioned ledgers differ in who may operate a node.

How do participants agree on the same history?

Independent computers receive transactions at different moments, so they need a rule for choosing one order of blocks. A consensus mechanism is the procedure that decides which candidate block the network accepts next. When two valid blocks appear at the same position, a published selection rule decides which chain the network keeps.

Proof of work is a mechanism in which a computer must find a value that makes the block hash satisfy a difficulty condition. Proof of stake is a mechanism in which the protocol selects a proposer among participants who have locked units of the network's asset.

Key points

  • Consensus is a rule for selecting one order of blocks among several possibilities.
  • Proof of work makes block production depend on repeated computation.
  • Proof of stake makes block production depend on locked units of the network's asset.

How does a blockchain differ from a traditional database?

A traditional database is administered by one organisation that can add, edit and delete rows and that controls access. A blockchain distributes those functions among many operators and replaces administrative authority with published rules and repeated verification. The comparison below is conceptual rather than a comparison of products.

Concept-level comparison of a traditional database and a blockchain
PropertyTraditional databaseBlockchain
AdministrationOne organisation operates the system and grants access.Many independent operators run nodes under shared rules.
Changing a recordAn administrator may update or delete a row.Records are added, and earlier ones remain.
VerificationUsers rely on the operator's controls.Each node recomputes hashes and rechecks the rules.
Copies of the dataBackups are managed by the operator.Every full node holds a complete copy.
Visibility of contentsAccess can be restricted per user or role.On a public network, records are readable by anyone.

Key points

  • A database centralises administration, and a blockchain distributes it.
  • Records are added rather than overwritten.
  • Verification is repeated by many nodes instead of assumed from one operator.

What blockchain is not

Several beliefs about the technology are inaccurate, and correcting them helps a reader interpret other material. The chain structure protects the integrity of stored records, which is a narrower property than general safety. The points below state what a blockchain does not provide.

It is not anonymous
Addresses are identifiers rather than names, and analysis of public records can identify a person.
It is not automatically secure
Keys, devices and applications remain separate points of failure outside the chain structure.
It is not a guarantee of truth
A record shows that data was entered and has not changed, not that the data is accurate.
It is not a payment guarantee
A confirmed record is not reversed by an administrator, and a correction requires a further record made by the receiving party.
It is not one global system
Many separate networks exist, each with its own rules, history and participants.

Key points

  • Public records are pseudonymous rather than anonymous.
  • Integrity of the record and safety of a user are different properties.
  • An unchanged record can still contain an inaccurate statement.

Where are keys and wallets involved?

Control over what is recorded for an address on a public blockchain depends on a pair of related values. A private key is a secret value that authorises transactions from one blockchain address. The matching public key allows anyone to verify the signature that the private key produces. A wallet is software or a device that stores private keys and creates signatures, so a wallet holds keys while the ledger holds the recorded balance.

Possession of the private key therefore determines who can authorise a new record for the associated address. In a custodial arrangement another party holds the keys, and in a self-custodial arrangement the account holder holds them.

Key handling is a separate subject. A companion article on this site, MetaMask(メタマスク) Security Guide for Beginners, describes how key material is held in a self-custodial wallet.

Key points

  • A private key authorises new records, and the matching public key allows verification.
  • A wallet stores keys, while the ledger stores the balances.
  • Custodial and self-custodial arrangements differ in who holds the keys.

Glossary

Blockchain
A shared digital record that many independent computers store and verify at the same time; in Japanese, ブロックチェーン.
Block
A set of validated records that a network accepts together as one unit; in Japanese, ブロック.
Consensus mechanism
The procedure that decides which candidate block the network accepts next; in Japanese, コンセンサス.
Cryptographic hash function
A function that converts data of any size into a fixed-length value identifying that input; in Japanese, ハッシュ.
Distributed ledger
A record kept as identical copies by several independent participants rather than in one central system.
Node
A computer that stores a copy of the ledger and applies the network rules; in Japanese, ノード.
Private key
A secret value that authorises transactions from one blockchain address; in Japanese, プライベートキー.
Transaction
A signed instruction that changes the recorded state when the network accepts it; in Japanese, トランザクション.
Wallet
Software or a device that stores private keys and creates signatures; in Japanese, ウォレット.

Frequently asked questions

How does blockchain work in simple terms?

Many computers keep the same list of records. New records are checked against shared rules and then grouped into a block. Each block stores a hash of the block before it, so the list has one fixed order that any participant can verify.

What is blockchain used for?

It is used where several parties need one shared record and no single administrator is trusted to hold it. Applications include transfer records, ownership registries and audit trails between organisations.

Is a blockchain the same as a cryptocurrency?

No. A blockchain is a data structure with a set of network rules. A cryptocurrency, also called a crypto-asset, is one type of record that such a network can store.

Can information on a blockchain be deleted or changed?

An accepted record is designed to remain in place, and later blocks make a change progressively more difficult. A correction is made by adding a new record instead of editing an old one.

Are blockchain transactions anonymous?

They are pseudonymous on a public network. Records display addresses rather than names, and the whole history is readable by anyone. Analysis of that history can connect addresses with each other, and it can connect an address with a person.

Sources

  • Satoshi Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System" — the original description of blocks chained by hashes.
  • National Institute of Standards and Technology, "Blockchain Technology Overview" (report NISTIR 8202) — definitions of blocks, nodes, ledgers and consensus.
  • National Institute of Standards and Technology, "Secure Hash Standard" (publication FIPS 180-4) — the specification for the SHA-256 output length.
  • Ethereum Foundation, "Ethereum development documentation" — reference material on accounts, keys and proof of stake.

About this article

This article provides general educational information about a technology. It is not investment, financial, legal or tax advice, and it makes no recommendation about any asset, product or service.

Metaexplorer sells nothing to readers. It holds no crypto-assets and provides no wallet, exchange, custody or support service. BEKTAS DİJİTAL İÇERİK STÜDYOSU ANONİM ŞİRKETİ has no connection, affiliation, endorsement, sponsorship, partnership or agency relationship with any organisation, brand or product mentioned in its articles.