Course 5.2Lesson 1 of 3
Some money is never printed or minted. It exists only as records on computers. This lesson explains what a digital currency is, how people use it, and why its records must be kept safe.
Try the code and the simulations beside the lesson.
Think about the money in a bank account. You cannot touch it, but you know it is there, because the bank keeps a record. A digital currency goes one step further. There are no coins or notes of it at all, anywhere.
A digital currency is a currency that only exists electronically. It is a record of who owns how much, kept on computers. To spend it, a computer changes the record. Nothing is handed over by hand.
People use a digital currency in the same ways as other money, but always through a device.
Every payment is recorded in a ledger. A ledger is a list of records: who paid whom, how much, and when. The balance of each person is worked out from the ledger.
For an ordinary bank account, the bank keeps the ledger. Many digital currencies do not have a bank or any single owner in charge. Instead, the ledger is shared between many computers, and it is kept in a blockchain. You meet blockchains in the next two lessons. A digital currency that uses this kind of shared ledger and encryption is often called a cryptocurrency.
Because no single organisation controls the ledger, the records themselves must be impossible to change in secret. Otherwise a person could add units to their own balance.
These are the points that books usually give. They are not in the syllabus wording, but they help you to explain the idea.
The program keeps a small ledger. A dictionary holds each person's balance, and a list holds the payments in the order they were made. A payment goes through only if the sender has enough. You used dictionaries and lists of tuples in the Python Essentials book.
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Every lesson is open to read. Enrolling also lets you:
Log in to join the discussion.
Loading…
This lesson is free to read. Enroll free to keep your place and take the tests.