BC4: How a shared ledger agrees: blocks, consensus and finality

Lesson 1 of 5 · reading 15–25 minutes; practice and project time is on the module page

Many copies, one record

🎯You'll be able to

Explain why a shared ledger needs a way to agree, and what the double-spend problem is.

🏠The everyday picture

Five members each keep a copy of the group's register. If two members write different entries at the same time, they need a rule to decide which goes first, or the copies drift apart.

📘What it really is

📝A worked example

Input: a member tries to spend the same 0.5 test ether twice, to two shops, at the same moment.

Steps:

  1. Both transactions reach different nodes first.
  2. The network agrees on one block that contains only one of them, the one the block producer chose.
  3. Every node then refuses the other, because the balance has already been spent in the agreed history.

Expected output: one payment succeeds and the other fails, on every honest node.

🌍Where it's used

📝Case scenario

A federation's three offices each kept their own spreadsheet of loans and synced them weekly by email. Twice, two offices approved loans against the same savings in the same week. A shared ledger with an agreed order would have refused the second approval at the time.

🖱️Try it

Run npm run chain and look at the first lines: the network's chain ID and its accounts. Then stop it. Success: you can say which single node is producing blocks on the practice network, and why that's different from a public network.

⚠️Common mistakes

🛠️For your project

The practice network started by npm run chain is a single node that makes a block for each transaction. Project 3's app connects to it like it would to a public node.

✅Quick check

What is the double-spend problem?

Show the answer

The same digital money being sent to two people, unless the network agrees on one order.

What does consensus give every honest node?

Show the answer

The same agreed history of blocks.

← BackBC4
ProLearners Assist