Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

A blockchain is a shared digital record that stores data in linked blocks across many computers. It matters because it lets people agree on a history of transactions without needing one central owner of the database. Each block contains data, a timestamp, its own hash, and the previous block's hash.

This structure makes the record difficult to change without being detected.

Understanding How Blockchain Works

A transaction starts as a message. It might say that one wallet is sending a certain amount of a digital asset to another wallet. The sender creates a digital signature with a secret private key.

Other computers do not need that secret. They use the matching public key to test whether the signature fits the message. This check proves that the message came from someone who controls the private key.

It does not prove the sender is a real-world person. A wallet address is closer to a pseudonym than a name. If a private key is copied or lost, control of the assets can be stolen or become impossible to recover.

Nodes receive proposed transactions and apply rules before accepting them. For a cryptocurrency, they check that the signature is valid and that the sender has enough unspent balance. They reject transactions that attempt to spend the same funds twice.

This double spending problem is important because digital information can be copied easily. A network needs a shared method for deciding which payment happened first.

Transactions that pass the checks wait in a pool until they are placed into a proposed block. After a block is accepted, later blocks make its position in the record increasingly difficult to replace.

Proof of work is one way to choose who gets to add the next block. A miner repeatedly changes a small trial value and calculates a hash until the result meets the network rule. There is no known shortcut, so success depends mostly on many attempts.

This uses electricity and computer hardware. The cost is deliberate. To rewrite a past transaction, an attacker would need to redo the work for that block and catch up with the work added by honest participants.

A short-lived disagreement can still occur when two valid blocks appear near the same time. The network eventually follows the branch with more accumulated work, while the other branch is discarded. This is why users often wait for several later blocks before treating a payment as final.

Blockchain systems are useful when several parties need a record but do not fully trust one organisation to edit it. Examples include cryptocurrency transfers, tracking items through a supply chain, and recording shared approvals. They are not automatically the best choice for every database.

A normal database is usually faster, cheaper, and easier to correct when one trusted organisation is responsible. Public blockchains can be slow, expensive during busy periods, and poor places for private information because many participants can inspect the stored data. When learning this topic, separate three ideas carefully.

Hashing detects changed data. Digital signatures show control of a key.

Consensus rules help many computers choose one accepted history. These parts work together, but they solve different problems.

Key Facts

  • Block hash = hash(block data + timestamp + previous hash + nonce)
  • Changing one block changes its hash, which breaks the link to the next block.
  • A blockchain is distributed because many nodes store and check copies of the ledger.
  • Proof of work requires miners to find a nonce so the block hash satisfies a difficulty rule.
  • In Bitcoin, a valid hash must be below a target value set by the network difficulty.
  • Digital signatures prove ownership by using a private key to sign and a public key to verify.

Vocabulary

Block
A block is a package of recorded data plus metadata such as a timestamp, a hash, and the previous block's hash.
Hash
A hash is a fixed-length digital fingerprint produced from input data by a one-way algorithm.
Node
A node is a computer on the blockchain network that stores, shares, and checks blockchain data.
Consensus
Consensus is the process nodes use to agree on which version of the blockchain is valid.
Private Key
A private key is a secret number used to create digital signatures that authorize blockchain transactions.

Common Mistakes to Avoid

  • Thinking blockchain data cannot ever be changed. It can be changed in a copy, but the tampering is exposed because hashes and consensus checks no longer match the network history.
  • Confusing encryption with hashing. Encryption is meant to be reversible with a key, while hashing is designed to be one-way and used for fingerprints and integrity checks.
  • Assuming every blockchain uses mining. Mining is part of proof of work systems, but other blockchains may use proof of stake or different consensus methods.
  • Believing a wallet stores coins directly. A wallet stores keys, while the blockchain stores the transaction history that defines which addresses control value.

Practice Questions

  1. 1 A block header contains 80 bytes and a network miner tests 5,000,000 nonces per second. If it takes 30 seconds on average to find a valid nonce, how many nonce attempts were tested?
  2. 2 A simple blockchain has blocks A, B, C, and D. If each block stores the previous block's 64-character hash, how many previous-hash characters are stored in total across blocks B, C, and D?
  3. 3 Explain why changing a transaction in block B would require changing later blocks and convincing the network to accept the altered chain.