Digital Currency
Money that only exists electronically, and the blockchain behind a cryptocurrency: a time-stamped ledger of every transaction, chained by hashes so that any change is detected.
WATCH IT EXPLAINED
EXPLORE IT IN 3D
The vault of blocks
A vault hall where the record of every payment is a chain of steel blocks. Open the bank's vault, forge a record, build a block and break the chain — then follow one payment all the way into it.
Money that only exists electronically
Digital currency is money that only exists electronically: there are no coins or notes.
A digital currency only exists electronically. There are no coins or notes to hold.
| Question | Answer |
|---|---|
| Where is it kept? | in an account or a digital wallet |
| How does it move? | by electronic transfer |
| What is it used for? | paying for goods and services online; sending money to a person, even in another country |
A cryptocurrency, such as Bitcoin, is a digital currency that uses cryptography and a blockchain to record every transaction. Cryptography is the maths of keeping data secret and safe. The blockchain does the job a bank would do: it keeps the record.
Who keeps the record?
A bank keeps one record of payments; a blockchain keeps copies of the record on many computers.
When money is in a bank, the bank keeps the only record of who paid whom. Everyone trusts the bank to check each payment and to keep that record correct.
A cryptocurrency has no central bank. Its record, the blockchain, is copied onto many computers in a network.
| Bank | Blockchain | |
|---|---|---|
| The record | one record, the bank's | a copy on many computers |
| Who checks payments | the bank | the computers in the network |
| Someone changes a copy | there is only one copy to change | it no longer matches all the others |
This is called decentralised: there is no single record for anyone to attack or control.
A ledger is a list of transactions
A ledger lists every transaction in time order; a balance is found by adding transactions up.
A blockchain, in its basic form, is a digital ledger: a time-stamped series of records that cannot be altered.
A ledger does not store how much money each person has. It stores every transaction ever made, in time order:
- who paid;
- who was paid;
- how much.
To find a balance, add up that person's transactions. In the figure, Bat has 75, Dorj has 20 and Saraa has 5.
Remember:This is how a blockchain tracks transactions. Each new record is added to the end, and no record is ever rubbed out.
Try to make Dorj send 25 coins.
A hash is a fingerprint for data
A hash is a fingerprint of data: the same data gives the same hash, a tiny change a different one.
A hash is a fixed-length value. A hash function calculates it from data.
- The same data always gives the same hash.
- Change even one character and you get a very different hash:
hellogives4f9f2cab, butHellogivesf55c314b. - You cannot work backwards from a hash to the data.
Watch out:A hash is not encryption. There is no key, and nothing to decrypt.
The hash in the figure is a small made-up one, 8 hex digits long. Bitcoin's blockchain uses SHA-256, which gives 64 hex digits.
What is inside a block
Each block holds its data, a timestamp, the previous block's hash and its own hash.
Each block in a blockchain stores four things:
- its data: the transactions (who paid whom, and how much);
- a timestamp (the date and time it was made);
- the hash of the previous block;
- its own hash.
Its own hash is calculated from everything else in the block. So if anything in the block changes, its own hash changes too.
The first block has no block before it. It is called the genesis block, and its previous hash is all zeros.
The block also holds a number called the nonce, explained two notes further on.
How the blocks are chained
Each block stores the hash of the block before it, so changing an old block breaks the chain.
Every block stores the hash of the block before it. That is the chain.
Suppose someone changes the data in an old block:
- That block's own hash changes.
- It no longer matches the previous hash stored in the next block.
- The link is broken, and the change is easy to see.
- Every block after it is now invalid as well.
Example:Press Tamper. Block 1's data becomes Bat pays Dorj 80, and its hash becomes 61902ecc. Block 2 still stores 009808a3.
Why a change cannot simply be covered up
Proof-of-work makes every block slow to make, so a cheat cannot quickly rebuild the chain.
Could the cheat just calculate the hashes again? Not easily. In Bitcoin, a block is only accepted with proof-of-work:
- A number called the nonce must be found that makes the block's hash start with an agreed pattern, here
00. - The only way to find it is to keep trying.
- Computers that do this work are called miners.
Example:Block 1 needed 76 tries. After the tamper, it needs 708, and then blocks 2 and 3 must be mined again too.
The cheat must redo every later block faster than the honest miners add new ones. That needs more computing power than all of them together. This goes beyond the syllabus.
One transaction, start to finish
A payment is broadcast, checked, put in a block, hashed and added to every copy of the chain.
Follow one payment: Saraa sends 5 coins to Bat.
- The transaction is requested and broadcast to the network.
- The computers in the network validate it: does Saraa really have the coins?
- The checked transaction is grouped with others into a block.
- The block gets its hash, found by proof-of-work, along with the hash of the previous block.
- The block is added to the end of the chain.
- Every copy of the chain across the network is updated.
From then on, the transaction is permanent.
What a blockchain does not do
A blockchain records money and detects changes; it is not encryption and cannot undo a payment.
| People often think | The truth |
|---|---|
| "Cannot be altered" means nobody can type a change. | Any change would be detected and rejected, because the hashes would no longer match. |
| The blockchain is the money. | It is the record of the money, not the money itself. |
| A hash is encryption. | A hash cannot be turned back into the data. |
| A bank looks after it. | It is decentralised: no bank, and many copies. |
A completed payment cannot be reversed.
Watch out:That is also a disadvantage. If you pay a scammer, there is no bank to ask for your money back.
- Click the stages below in the order they happen.
KEY TERMS
CHECK YOURSELF
1.What makes a blockchain very hard to tamper with?
2.What does a block in a blockchain contain?
3.What is a digital currency?
4.What does a blockchain ledger store?
5.Why is a hash not encryption?
6.A cryptocurrency is decentralised. What does this mean?