HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Digital Currency and Blockchain
  1. 1What a digital currency is and how it is used
  2. 2Blocks, hashes and the chain
  3. 3How a blockchain tracks transactions
  1. Computer Science
  2. /Digital Currency and Blockchain
  3. /How a blockchain tracks transactions

Course 5.2·Lesson 3 of 3

How a blockchain tracks transactions

When you pay with a digital currency, how does the payment end up in a blockchain, and why can nobody take it out again? This lesson follows a payment from the moment it is made, and shows how the blockchain lets anyone track it.

about 25 min1 simulation1 practice question
Lesson 3 of 3Show all lessonsHide
Digital Currency and Blockchain
  1. 1What a digital currency is and how it is used
  2. 2Blocks, hashes and the chain
  3. 3How a blockchain tracks transactions

Try the code and the simulations beside the lesson.

Following one payment

Ana sends 151515 units of a digital currency to Ben. No bank is involved. So who checks the payment, and who writes it down? The answer is: a network of many computers, each with its own copy of the whole blockchain. Each of these computers is called a node.

Six computers in a ring, each labelled node, each holding a small picture of the same chain of blocks. In the middle, a new block marked with a time-stamp is being sent to every computer by arrows. A label says that every node adds the same block to its own copy.

Here is how a blockchain tracks the payment.

  1. The payment is made. Ana's digital wallet sends the payment, "Ana pays Ben 15", to the network.
  2. It is checked. Computers in the network check that it is valid: does Ana really own 151515 units? They can tell from the records already in the blockchain.
  3. It is put into a block. Valid payments are grouped into a new block, with a time-stamp and the hash of the last block in the chain. The block's own hash is worked out.
  4. The block is added to the chain. The new block goes on the end of the chain.
  5. Every copy is updated. Every computer in the network adds the same block to its copy.
  6. The record is permanent. The payment is now part of a time-stamped series of records that cannot be altered.

How the blockchain tracks money

Because every payment stays in the chain for ever, anyone with a copy can follow the units back through time. Where did Ana's 151515 units come from? Look further back in the chain, and you find the payment that gave them to her. This is what we mean when we say a blockchain tracks digital currency transactions.

Why nobody can change it

You saw that changing one block means working out new hashes for every block after it. A blockchain adds two more guards.

  • Many copies. The network accepts the version of the chain that more than half of the computers hold. An attacker would have to change more than half of all the copies at the same time.
  • Slow on purpose. Many blockchains make adding a block hard on purpose. A computer must solve a difficult maths puzzle before its block is accepted. So working out new hashes for many blocks takes a very long time, while the honest network keeps adding new blocks.

Practise with new numbers

Try it in Python

The program holds the last hash of the chain as seven computers see it. Two of the copies were changed. It counts the versions, and the version that more than half hold is accepted. Counter from the collections module counts the items of a list for you.

Read it first. Then run it. How many computers hold the changed version 71ab?

1. Change two more copies to 71ab. Which version wins now?

2. Add four more computers holding 9f2c. How many are now needed to agree?

Common mistakes

  • Saying one central computer checks the payments. Many computers in the network check them and each keeps a copy.
  • Saying a payment can be deleted later. Records in a blockchain cannot be altered; a mistake is put right only with a new payment.
  • Thinking half of the copies is enough. It must be more than half.

Remember these

  • A payment is checked by the network, put into a block with a time-stamp and the previous hash, added to the chain, and copied to every computer.
  • Every payment stays in the chain, so the history of the units can be tracked.
  • To change a record, an attacker would need new hashes for every later block, on more than half of all the copies.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Who checks that a payment in a blockchain is valid?
  1. Put these in order: the block is added to the chain; the payment is checked; every copy is updated; the payment is put into a block.
  1. A blockchain is copied on 303030 computers. What is the smallest number that must hold a version for it to be held by more than half?
  1. How does a blockchain let someone track where units of a digital currency came from?
  1. Why does a blockchain keep copies on many computers?

Enroll free in Digital Currency and Blockchain

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

A blockchain is copied on 40 computers in a network…Medium · High School (9–10) · by StemPy Lab
Kemal pays Dana 9 units of a digital currency that uses a blockchain…Medium · High School (9–10) · by StemPy Lab
A blockchain has 56 blocks. A new block is added to the honest chain every 10 minutes…Hard · High School (9–10) · by StemPy Lab
That was the last lessonBack to the course: take the test
← Digital Currency and Blockchain
← Blocks, hashes and the chainNext →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Part of a blockchain holds these payments, oldest first…Hard · High School (9–10) · by StemPy Lab

Question Sets (1)

Digital Currency and Blockchain: Concept Check10 questions · by StemPy Lab

Notes (1)

Digital Currency and Blockchain: Quick RevisionNote · by StemPy Lab