Sub topic 1
What a Blockchain Ledger Does
A blockchain ledger is a shared record of transactions. It is maintained by many computers rather than by one central database. This chapter assumes you understand hashing and public/private keys at a high level. You should also know that a transaction is a signed instruction, such as transferring cryptocurrency from one address to another.
Prerequisites
You should be comfortable with:
- The idea that a hash is a fixed-length fingerprint of data.
- The difference between a public key, a private key, and an address.
- The idea that digital signatures prove control of a private key.
- Reading a simple data table.
The ledger as a shared state
A ledger records the current state of ownership and the history of changes that produced it. A blockchain does this by ordering transactions into blocks.
A transaction usually contains:
- The sender's public address.
- The recipient's address.
- The amount or requested state change.
- A digital signature.
- Network-specific data, such as a fee or sequence number.
Network participants called nodes receive transactions, check their rules, and keep copies of the ledger. A valid transaction must have a correct signature and must not spend unavailable funds. The exact checks depend on the blockchain.
A block is a batch of accepted transactions. It also includes metadata, such as a timestamp, a reference to the previous block, and a value used by the network's consensus mechanism. The reference to the previous block is usually its hash. If earlier data changes, the hash changes, breaking the chain of references.
| Component | Purpose |
|---|---|
| Transaction | Requests a state change |
| Block | Groups transactions in an ordered record |
| Previous-block hash | Links one block to its predecessor |
| Node | Verifies data and stores a ledger copy |
| Consensus mechanism | Helps participants choose the next valid block |
How a transaction becomes part of history
The process is roughly:
- A user creates and signs a transaction with a wallet.
- Nodes verify the signature and transaction rules.
- The transaction waits in a pool of unconfirmed transactions.
- A block producer selects valid transactions and proposes a block.
- The network applies its consensus rules to accept or reject that block.
- Nodes update their local ledger and relay the block.
Different networks use different meanings of “accepted.” A proof-of-work network treats computational work as evidence for selecting a block. A proof-of-stake network uses bonded funds and validator rules. These mechanisms do not make an entry mathematically impossible to reverse. They make conflicting history expensive or punishable under defined conditions.
Why ordering matters
Suppose two transactions try to spend the same funds. The ledger needs one consistent order. If both transactions were accepted independently, different nodes could calculate different balances.
Consensus provides a shared decision about which valid block comes next. Later blocks add evidence that the transaction belongs to the network's history. This is why users often wait for confirmations before treating a payment as final.
A blockchain does not automatically prove that real-world information is true. It can preserve the statement that an authorized key submitted a transaction, but it cannot by itself verify that a shipment arrived or that a sensor reported accurately. External data requires trusted inputs such as oracles.
Exercise
Why does a block include the hash of the previous block?
Show answer
The reference links the history together. Changing an earlier block changes its hash and makes the later reference inconsistent, so the altered chain must overcome the network's validation and consensus rules.